Site logo

Archived topic

Custom posts be displayed in two columns in archive

3 replies · Started by twarrior on May 9, 2022

Viewing posts 1–4 of 4

Hello,

– Custom Post Type created with CPT UI (called “Organizations”)
– Custom Fields added with ACF
– Create a New GP Block Element:
— Element type = Content Template
— Location = “Organizations Archive
— Create dynamic content blocks (THIS IS INCREDIBLY WONDERFUL)

Everything perfect! Thanks GP team!

Now,

How can the Custom Posts be displayed in two columns in Archive?

Hi there,

if you want the CPT archive to use the GP Blog columns you need to add this snippet:

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

    return $columns;
} );

Change the CPT_SLUG string to match your CPT.

great
thanks, for your software and for your support

You're welcome

This archived topic is closed to new replies.