Site logo

Archived topic

Is This a Bug? Enabling Blog Columns for All Archives messes up Full Width

3 replies · Started by Samuel on July 18, 2020

Viewing posts 1–4 of 4

I have been trying to figure out for a while I could not get generate blocks to display full width on a page. After a lot of testing I finally found the problem.

I had this filter to enable columns on any archive. I added it because I used several custom post types:

add_filter( 'generate_blog_columns', function( $columns ) {
    return true;
});

I had the front page set to a static page, but enabling this added a generate-columns-container to my front page which broke the full page layout. I would think this filter should only apply on a blog page so this seems like a bug or am I missing something?

Hi there,

That code will enable the columns feature everywhere since it doesn't have any conditions.

What was the purpose of the filter, exactly?

I have multiple post types and wanted the archive on all of them to follow the same format I had specified for posts in GeneratePress' setup.

Hi there,

try setting a conditional like so:

add_filter( 'generate_blog_columns','tu_portfolio_columns' );
function tu_portfolio_columns( $columns ) {
    if ( is_archive() ) {
        return true;
    }

    return $columns;
}
This archived topic is closed to new replies.