Sidebar widgets – dynamic CSS : problem with widget-title

Not a good solution… but is a solution: using jquery. register_sidebar( array ( ‘name’ => ‘Left Widget Area’, ‘id’ => ‘primary_widget_area’, ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”><div class=”widget-title”></div><div class=”widget-content”>’, ‘after_widget’ => ‘</div></li><!– .widget –>’, ‘before_title’ => ‘<span class=”invisible-title” data-widget=”%1$s” style=”display:none;”>’, ‘after_title’ => ‘</span>’, ) ); and the JS jQuery().ready(function($) { $(‘.invisible-title’).each(function() { var title = … Read more

Sidebar only shows up on blog page

The error you are getting is because you must add the registered sidebar to widgets_init. add_action( ‘widgets_init’, ‘wpa199335_page_sidebar’ ); function wpa199335_page_sidebar(){ register_sidebar(array( ‘name’ => __( ‘Page Sidebar’), ‘id’ => ‘page’, ‘description’ => __( ‘Displays on the side of pages with a sidebar’ ), ‘before_widget’ => ‘<div class=”widget”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h2 class=”module-heading”>’, ‘after_title’ … Read more

Adding an extra sidebar to your theme

get_sidebar(‘left’); actually refers to a file, not the sidebar itself. Are you seeing the sidebar in the Admin section? Are you trying to display it on the front end? If the answer to both of these questions are “yes”, then here’s the solution: Create a file called sidebar-left.php. In this file, you will need to … Read more

Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;

The solution was simple and made me feel tremendously stupid. 90% of the issues I could find remotely similar to my issue were all issues relating to the casing. Throughout this whole process I overlooked the “_HOMEPAGE” and “_RIGHT_SIDEBAR” in my IDs. Those should be lowercase. id – Sidebar id – Must be all in … Read more

Add class to on sidebar widget

In functions.php file : add_action( ‘widgets_init’, ‘my_register_sidebars’ ); function my_register_sidebars() { /* Register the ‘primary’ sidebar. */ register_sidebar( array( ‘id’ => ‘sidebar-2’, ‘name’ => __( ‘Main Sidebar’, ‘mystic’ ), ‘description’ => __( ‘A short description of the sidebar.’, ‘mystic’ ), ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h3 class=”widget-title”>’, ‘after_title’ => … Read more