837 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $2M+ on Envato Market
+7 more
wpbakery
says

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!

552 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 100+ members
  • Located in Canada
  • Has collected 100+ items on Envato Market
+2 more
OurWebMedia
says
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 !!

679 posts Cudazi
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi
Envato team
says

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.

837 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Made it to the Authors' Hall of Fame
  • Has sold $2M+ on Envato Market
+7 more
wpbakery
says
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.

1035 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd
says

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?

461 posts Don't be a HATER!
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has been part of the Envato Community for over 5 years
+5 more
CodeElite
says
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 ;)

679 posts Cudazi
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $250,000+ on Envato Market
  • Has referred 500+ members
+11 more
cudazi
Envato team
says
@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.

415 posts
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
unisphere
says

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

3135 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 500+ items on Envato Market
+4 more
Daniel_R
says

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.

1035 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd
says

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.

by
by
by
by
by
by