• Marco1969

    (@marcorm69)


    Hi all.

    I create a my custom page template (page-mycustom.php) and I would like to eliminate the sidebar from this page.

    I add this code in function.php (child theme)

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

    The code works until you insert a loop in the template.
    It seems that a second cycle, the function is no longer considered.

    Can you help me?

    Thank,
    Marco

Viewing 1 replies (of 1 total)
  • Hey,
    Which loop are you adding? You can see on the page-blog.php a loop is added there and this function would still work.

    Are you making this your posts page in the settings > reading? That would override the page template.

    Can you post to more of the code?

    Kadence Themes

Viewing 1 replies (of 1 total)

The topic ‘Sidebar, custom template and WP_query’ is closed to new replies.