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

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1368062
    Samuel

    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?

    #1368126
    Tom
    Lead Developer
    Lead Developer

    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?

    #1368163
    Samuel

    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.

    #1368458
    David
    Staff
    Customer Support

    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;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.