- This topic has 1 reply, 2 voices, and was last updated 7 years, 9 months ago by Hash.
- AuthorPosts
- April 24, 2016 at 10:03 pm #298sknappParticipant
I want to add a second left sidebar to my site libertysquarewifi.com as a secondary navigation for my About page.
I did this by creating a new widgetized area in sidebar.php., creating the new layout option in inc/square-metabox.php, and adding this to the functions in my child theme:
register_sidebar( array( 'name' => esc_html__( 'Left Sidebar 2', 'square' ), 'id' => 'square-left-sidebar-2', 'description' => '', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', ) ); add_action( 'widgets_init', 'square_widgets_init' );
This made the sidebar appear in the customizer and let’s me add widgets to it but it won’t appear in the page editor to let me apply the new sidebar layout to the page I need it on.
Is there another file I need to edit or put in my child them to make it appear or have I just done something wrong?
April 26, 2016 at 3:35 pm #303HashKeymasterHi,
Please use this plugin https://wordpress.org/plugins/restrict-widgets/
This should easily let you restrict the widget to show/hide in the desired pages without having to create multiple widgets. - AuthorPosts
- You must be logged in to reply to this topic.