188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

Hey guys a quick question: I’ve seen a couple of WordPress themes that have two or more blog page styles and they are showcasing all on the theme demo even though in the theme package they don’t have multiple blog pages/templates and changing the way the blog looks is done by changing an option on the theme options page. How is that possible, or how can one do that? Thanks.

289 posts New Elite in Town!
  • Won a competition
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Won a Most Wanted contest
+6 more
icypixels says

I think it’s a switch case scenario :)

188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

Hehe, pai nah, more intel on that ?! :)

289 posts New Elite in Town!
  • Won a competition
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Won a Most Wanted contest
+6 more
icypixels says

Let’s say you have a dropdown option in your theme options panel… And you’ll do a small switch case like this, in your index.php:

Retrieve your setting from the option panel and save it inside a variable, which will be called $dropdown_option for demo purposes:

switch ($dropdown_option) {
    case "0":
    // Oh great, the first option in the dropdown is selected, do some nifty stuff here with the blog
    break;
    case "1":
    // Now figure out a second layout for your blog :))
    break;
    default:
    // A default solution will be needed.
    break;
}

Have it all figured in your mind now? :)

188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

Hmm not really, how do you output those options and have them posted on a new page? I thought about building a shortcode for the second, third… blog pages but you seem to think of a better way.

109 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+4 more
designedbydash says

It’s likely a custom shortcode/page template just on the demo using get_posts() or WP Query.

188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

Hmm…

1278 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

I’m using metaboxes for that.

188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

I think it’s a switch case scenario :)

I’m really curious about this. Where can I see an example? Thanks.

188 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+1 more
The_Silverman says

Well, I’m not quite sure on how some of the great TF authors do their magic related to this subject but after some time thinking I came up with a solution: I’ll implement the blog design change options in the theme options page and only for my theme demo I’ll build a WP_Query shortcode. That way I don’t have to create multiple blog templates.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by