Site logo

[Support request] Custom Post Archive grid layout with Elements Content Block

Home Forums Support [Support request] Custom Post Archive grid layout with Elements Content Block

Home Forums Support Custom Post Archive grid layout with Elements Content Block

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1954309
    Len

    How is a multiple column layout created for a custom taxonomy or custom post type archive with the Elements Content Block.

    I cannot find any help for this. If a layout is created at 50% width, how will that repeat horizontally?

    I have done a single column layout which works fine assigned to my CPT archives etc.

    Thanks, LenW

    #1954493
    David
    Staff
    Customer Support

    Hi there,

    the Block Element Content Template only replaces the content template in the post loop.
    Today you still need to define the Column requirements in the Customizer > Layout > Blog.

    However by default the columns options only work with standard post types.
    To enable columns on a CPT you would need a little PHP:

    add_filter( 'generate_blog_columns', function( $columns ) {
        if ( 'your_cpt_slug' === get_post_type() && ! is_singular() ) {
            return true;
        }
    
        return $columns;
    } );

    We’re working on new archive grid options for a future update.

    #1960374
    Len

    David

    Thanks, this works – as long as the following is done:

    The content template is set to full width as a design for the block, this code then reduces the width to that of the column.
    If I start off with a 50% block in the content template editor, I end up with a 25% column if columns set to 2.

    So template design a little tricky.

    LenW

    #1960393
    David
    Staff
    Customer Support

    You can set the elements Editor Width in the sidebar settings – see here, in the example i have set it to 320px wide:

    https://www.screencast.com/t/pKagnV1BS

    This will allow you to create your design at a size that is representative of the front end display.

    #1961451
    Len

    David, thanks for that suggestion, its a good help.
    LenW

    #1961522
    David
    Staff
    Customer Support

    Glad yo be of help!

    #2013825
    Dan

    Hi David,
    is there an update regarding this:

    We’re working on new archive grid options for a future update.

    or should we still stick to the filter

    add_filter( 'generate_blog_columns', function( $columns ) {
        if ( 'your_cpt_slug' === get_post_type() && ! is_singular() ) {
            return true;
        }
    
        return $columns;
    } );

    Thanks
    Dan

    #2013832
    Ying
    Staff
    Customer Support

    Hi Dan,

    Currently this is still the one to use 🙂

    #2013836
    Dan

    Thanks Ying for the quick answer.

    Dan

    #2013840
    Ying
    Staff
    Customer Support

    No problem 🙂

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