[Support request] Full-width Archive – No Sidebars

Home Forums Support [Support request] Full-width Archive – No Sidebars

Home Forums Support Full-width Archive – No Sidebars

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #357647
    Steven

    I need my archive pages to be full-width, no page title and no sidebar. Since there’s not a page where I can choose these settings, is there some php I can add to my functions.php to make this happen.

    Thanks

    #357667
    Leo
    Staff
    Customer Support

    Hi Steven,

    For full width and remove archive title, try this CSS:

    .archive .grid-container {
        max-width: 100%
    }
    .archive .page-header {
        display: none;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    For removing sidebar, try this filter:

    add_filter( 'generate_sidebar_layout','tu_custom_category_sidebar_layout' );
    function tu_custom_category_sidebar_layout( $layout )
    {
     	if ( is_archive() )
     	 	return 'no-sidebar';
    
     	return $layout;
    
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    https://docs.generatepress.com/article/sidebar-layout/#using-a-function

    #357699
    Steven

    Thanks for the code. The function made my site inaccessible. I had to remove it. Any idea why?

    #357702
    Leo
    Staff
    Customer Support

    Just making sure. The first block is CSS so it can’t go into function file.

    I just tested the sidebar removal and the code worked. Can you try it with Code Snippets?
    https://docs.generatepress.com/article/adding-php/#code-snippets

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.