Select a Sidebar from Page Creation

Sounds like you could use page templates for this. You’d create a file in your theme called ‘page-services.php’ (for instance). When users create new pages, they’d select the “Services” template, rather than the “Services” sidebar, but it’s basically the same thing for your purposes. Here’s how to set up templates: http://codex.wordpress.org/Pages#Page_Templates And here’s the conditional … Read more

activate custom sidebar widgets

You would register the sidebar in the functions.php file with something like this: <?php register_sidebar(array(‘name’=>’custom-content’, ‘before_widget’ => ‘<section>’, ‘after_widget’ => “</section>”, ‘before_title’ => ‘<h3>’, ‘after_title’ => “</h3>” )); ?> And Use it in your theme like this: <div class=”contents”> <?php if ( function_exists(dynamic_sidebar(1) ) ) : ?> <?php dynamic_sidebar(custom-content); ?> <?php endif; ?> </div>

How to exclude categories from a sidebar with active widgets in it?

If i understand correctly, a quick solution could be using something like Widget Logic and create a custom menu for each category, then use whatever Conditional Tags applies.// such as is_category() or in_category( ‘5’ ) Or, if you don’t want to use a plug-in, you could try duplicating the widget and then adding the conditional … Read more

How do i replace the sidebar to use pages instead of blogs?

An alternative method to what @Tanmoy gave above is to make an additional navigation menu (Appearance – Menus) and call it something like Sidebar-Pages. Then you can add the headers with a “link” like #. Add the sub-pages you want and save when you’re done. Then go to widgets (Appearance – Widgets) and there you … Read more

How to Catch Last Widget box From Same Widget Area?

Add the following code in your functions.php file of the theme directory. Replace widget name “Home Widget Area” with your widget’s name /*=============WIDGETs CSS CLASS CONTROLLER==============*/ $GLOBALS[‘my_widget_num’]=1; function edei_widget_class_adder($params){ if( $params[0][‘name’]==’Home Widget Area’ ){ $GLOBALS[‘my_widget_num’]++; if( ($GLOBALS[‘my_widget_num’]%4)==0 ){ $params[0][‘before_widget’] = str_replace(‘class=”‘, ‘class=”marginAdjust ‘, $params[0][‘before_widget’]); } } //print_r($params); return $params; } add_filter(‘dynamic_sidebar_params’,’edei_widget_class_adder’); function edei_widget_counter_reset($sidebars_widgets) { $GLOBALS[‘my_widget_num’] … Read more

Multiple loops breaking side bar

Since the sidebar was being deployed while inside the loop, the if ( have_posts() ) : was what was causing it to break. Here’s the fix: <div id=”FL-pest-libray-sidebar”> <?php $category_query_string = new WP_Query(array( ‘post_type’ => ‘page’ , ‘posts_per_page’ => ‘-1’ , ‘post_parent’ => ‘413’)); while ( $category_query_string->have_posts() ) : $category_query_string->the_post(); ?> <div <?php $catspacetitle = … Read more

Why is registering a sidebar for each page causing my sidebars to reset?

You need to wrap this in a function then add it to the widgets_init action. Also the register sidebar function does not have $arguments for sort_column or sort_order. I would also change the id to ‘sidebar-‘.$page->ID add_action( ‘widgets_init’, ‘prefix_register_sidebars’ ); function prefix_register_sidebars() { foreach($pages as $page){ register_sidebar( array( ‘name’=>$page->post_title, ‘id’=> ‘sidebar-‘.$page->ID, ‘before_widget’ => ‘<div id=”%1$s” … Read more

Upgraded to 3.3, My Widgets Disappeared

Check if your theme is compatible with WP 3.3. To check, you may try switching to the default theme (twentyeleven) for a moment by renaming your current theme’s folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue. -also, make sure all your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)