- Sold between 250 000 and 1 000 000 dollars
- Won a Competition
- Author was Featured
- Item was Featured
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Bought between 10 and 49 items
Hi guys,
I’m thinking about the best way of using widget areas. We all know that we can define widget areas in function.php file, but it will be a tricky (for the novice) to add new widget areas and assign them to the specific pages/posts/categories.
So here is the question: what is the right way of handling the unlimited widget areas and controlling where they should appear?
Thank you in advance!
Hi guys,I’m thinking about the best way of using widget areas. We all know that we can define widget areas in function.php file, but it will be a tricky (for the novice) to add new widget areas and assign them to the specific pages/posts/categories.
So here is the question: what is the right way of handling the unlimited widget areas and controlling where they should appear?
Thank you in advance!
This is a very interesting question! I’d be very happy to know too. Also, your latest template, my god man, ROCK ON !!
- Sold between 250 000 and 1 000 000 dollars
- Referred between 500 and 999 users
- Envato Staff
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author was Featured
- Support Staff
- Was featured in a podcast
I try to include as many as possible for various scenarios but you could also tell your users to use http://wordpress.org/extend/plugins/widget-logic/ for additional options.
- Sold between 250 000 and 1 000 000 dollars
- Won a Competition
- Author was Featured
- Item was Featured
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Bought between 10 and 49 items
Also, your latest template, my god man, ROCK ON !!
Thanks man!
@cudazi: Yes, you are right, but it’s always better to simplify things. I’m looking for the out-of-the-box solution, without asking user to install additional plugins or learn WP conditional tags.
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
I’ve seen a couple of themes that advertise having unlimited widget areas.
How are authors doing this? Are they creating a way for users to add widget areas dymanically through the admin panel? Is there some plugin that does that authors are integrating into themes?
I’ve seen a couple of themes that advertise having unlimited widget areas. How are authors doing this? Are they creating a way for users to add widget areas dymanically through the admin panel? Is there some plugin that does that authors are integrating into themes?
I’m use sidebar generator plugin (modified) in my latest theme
, here’s the link http://www.getson.info
Good luck 
- Sold between 250 000 and 1 000 000 dollars
- Referred between 500 and 999 users
- Envato Staff
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author was Featured
- Support Staff
- Was featured in a podcast
@cudazi: Yes, you are right, but it’s always better to simplify things. I’m looking for the out-of-the-box solution, without asking user to install additional plugins or learn WP conditional tags.
Totally agree, I will be watching this thread as I’ve always wanted a better, more simple solution too.
Try this, I’m using it:
// Register a sidebar widget area for every page
$pages = get_pages('orderby=name&use_desc_for_title=1&hierarchical=0&style=0&hide_empty=0');
if(is_array($pages)) {
foreach($pages as $pag) {
register_sidebar(array(
'name'=>$pag->post_title,
'description' => __('Unique sidebar widget area shown in the ' . $pag->post_title . ' page'),
'before_widget' => '<div class="widget %2$s" id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
}
Then on the sidebar use the following code to display the widgets added to the above defined dynamic widget areas:
<?php /* This Unique Page Widgetized Area */
if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar($post?>post_title) ) : ?>
<?php endif; ?>
Other than these dynamic widget areas I also have one exclusively for the blog, one shared across all the pages and several others that serve the purpose of my theme.
Hope this helps, cheers 
Other than these dynamic widget areas I also have one exclusively for the blog, one shared across all the pages and several others that serve the purpose of my theme.
Hope this helps, cheers![]()
Very interesting Uni. This is an interesting thread…looking forward for more replies.
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
I have just been including multiple widget areas, that serve different purposes as well.
Here’s an example of how they’re setup on my last theme:
http://themeblvd.com/demo-html/complexity/images/features/widget-areas.jpg
But I’ve never played with this plugin that allows the user to create new widget areas (sidebars). I always just refer customers to the Widget Logic plugin if they have a problem with widgets showing up on all pages.
I know Mixey was against the widget logic, but at the same time, I’m not sure giving users the power to create widget areas is something I want with my themes. With the ways I use widget areas, I think that would add more confusion than trying to learn how to use the widget logic plugin.
