827 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly helped protect Envato Market against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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
  • Bought between 100 and 499 items
  • Canada
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 100 and 199 users
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 !!

675 posts
  • Has attended an Envato Live event
  • Elite Author
  • 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 5-6 years
  • Support Staff
+7 more
cudazi Staff 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.

827 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly helped protect Envato Market against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 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.

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 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?

441 posts Don't be a HATER!
  • Exclusive Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Won a Competition
  • Repeatedly helped protect Envato Market against copyright violations
  • Has been a member for 4-5 years
webinpixels 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 ;)

675 posts
  • Has attended an Envato Live event
  • Elite Author
  • 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 5-6 years
  • Support Staff
+7 more
cudazi Staff 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
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Exclusive Author
  • Grew a moustache for the Envato Movember competition
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Portugal
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
  • Beta Tester
  • Bought between 500 and 999 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Repeatedly helped protect Envato Market against copyright violations
  • Sold between 1 000 and 5 000 dollars
  • United States
  • Won a Competition
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.

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 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