188 posts
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+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.

394 posts icypixels.com
  • Weekly Top Seller
  • Winner
  • Elite Author
  • Author Level 8
+7 more
icypixels
says

I think it’s a switch case scenario :)

188 posts
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+1 more
The_Silverman
says

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

394 posts icypixels.com
  • Weekly Top Seller
  • Winner
  • Elite Author
  • Author Level 8
+7 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
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+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.

110 posts
  • Affiliate Level 1
  • Author Level 5
  • Beta Tester
  • Collector Level 1
+5 more
designedbydash
says

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

188 posts
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+1 more
The_Silverman
says

Hmm…

1368 posts
  • Weekly Top Seller
  • 5 Years of Membership
  • Author Level 6
  • Beta Tester
+5 more
Smartik
says

I’m using metaboxes for that.

188 posts
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+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
  • Author Level 5
  • Collector Level 2
  • 5 Years of Membership
  • Exclusive Author
+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