• Hi everyone, I have included the sidebar in the shop page where the items can be filtered, the same sidebar appears in the contact page. I want to create another sidebar for the contact page, where I can include the contact details.

    I am registering the sidebar in the storefront/inc/functions/setup.php just below the ‘below header’ widget. Please find the code below

    register_sidebar( array(
    		'name' =>__( 'Contact Page Sidebar', 'storefront'),
    		'id' => 'sidebar-contact',
    		'description' => __( 'Appears on the contact page template', 'storefront' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

    It appears in the widget section of the admin panel. But when I add things to it, it doesn’t appear. This is the code I have included in the storefront/inc/structure/template-tags.php

    if(is_page(49) && is_page(47)) {
    		get_sidebar('sidebar-contact');
    
    }

    Please help me out with this. Thank You.

Viewing 1 replies (of 1 total)
  • Hey,

    First of all please do not make this customisation directly in Storefront. If you do, you won’t be able to update the theme without losing your customisations. Use a child theme instead.

    In your child theme, just create a new template for your contact page that pull in your new sidebar.

    Cheers.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I create a separate sidebar for the contact page?’ is closed to new replies.