Home › Forum › Customization › Custom widget areas failing in Pro
Tagged: child-theme, startuppro, widget
- This topic has 3 replies, 2 voices, and was last updated 11 years, 8 months ago by
StartupWP.
-
AuthorPosts
-
July 2, 2014 at 5:13 AM #1688
StartupWP
KeymasterNo need to add the additional function, just register the new widget areas below:
register_sidebar( array ( 'name' => __( 'Content Widget Area', 'startup' ), 'id' => 'content-widget-area', 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => "</li>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) );Like so:
register_sidebar( array ( 'name' => __( 'Content Widget Area', 'startup' ), 'id' => 'content-widget-area', 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => "</li>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array ( 'name' => __( 'Banner Center Widget Area', 'startup' ), 'id' => 'bannercenter-widget-area', 'before_widget' => '<div id="%1$s">', 'after_widget' => "</div>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array ( 'name' => __( 'Banner Right Widget Area', 'startup' ), 'id' => 'bannerright-widget-area', 'before_widget' => '<div id="%1$s">', 'after_widget' => "</div>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) );July 2, 2014 at 7:34 AM #1689osakawebbie
ParticipantThat simplified the code, but didn’t change the symptom. However, I assumed the widget areas weren’t working because nothing was showing in the header – I didn’t check the Admin side (duh!). I don’t know what the situation looked like while I was putting the theme together, but at the moment the widget areas are all there; the reason nothing was showing correctly (and my tagline was appearing in the sidebar, which was crazy), is that at some point WordPress pushed all the widgets “down” two areas from where they were before! So my Banner Center widget was in Sidebar Widget Area, the Banner Right widget was in Left Sidebar Widget Area (which doesn’t actually appear), and my real sidebar widgets were in Right Sidebar Widget Area (which doesn’t appear). I have moved them all back now, and all is well. :-)
July 2, 2014 at 7:59 PM #1692StartupWP
KeymasterYeah, that’s a common quirk with WordPress. Another thing to look out for when making changes and WP gets confused about widgets, is that they’ll be dropped down under Inactive Widgets. So luckily, they’ll never be lost, just need to be rearranged sometimes if you’re registering/unregistering widget areas.
-
AuthorPosts
- You must be logged in to reply to this topic.
