Support » Theme: Virtue » Remove Sidebar – Custom pages

  • Resolved nemothefish

    (@nemothefish)


    Hi,

    I have created a custom page template, I’m using Virtue Premium, I copied the code from the full width template, but a side bar still appears. Is there anything else I should be doing?

    Kindest
    N

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes, You have to add a function, the sidebar is visible by wrapper function.

    Assuming your custom page template is “custom-page.php” here is the function to add to your child theme functions file.

    <?php add_filter('kadence_display_sidebar', 'kad_custom_fullwidth_page');
    function kad_custom_fullwidth_page($sidebar) {
      if (is_page_template('custom-page.php')) {
        return false;
      }
      return $sidebar;
    } ?>

    Kadence Themes

    Thread Starter nemothefish

    (@nemothefish)

    Hi,

    I put the code in to my funtions.php like you said, with the changed custom page template, but it does nothing.

    I have refreshed the page many times..

    I should note that to get the code to work I had to remove the php tags

    this is my child theme functions.php file

    <?php /*
    
      This file is part of a child theme called WildRosanna.
      Functions in this file will be loaded before the parent theme's functions.
      For more information, please read https://codex.wordpress.org/Child_Themes.
    
      Add your own functions below this line.
      ========================================== */ 
    
    add_filter( 'woocommerce_product_tabs', 'sb_woo_remove_reviews_tab', 98);
    function sb_woo_remove_reviews_tab($tabs) {
    
     unset($tabs['reviews']);
    
     return $tabs;
    }
    
    add_filter('kadence_display_sidebar', 'kad_custom_fullwidth_page');
    function kad_custom_fullwidth_page($sidebar) {
      if (is_page_template('page-activities-list.php')) {
        return false;
      }
      return $sidebar;
    }
    Thread Starter nemothefish

    (@nemothefish)

    Sorry, my Bad… Rookie mistake, I used the wrong page template !!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Sidebar – Custom pages’ is closed to new replies.