184 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.

272 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 :)

184 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 ?! :)

272 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? :)

184 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.

108 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.

184 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…

1189 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.

184 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.

184 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.

by
by
by
by
by
by