Site logo

Archived topic

Taxonomy from WP recipe maker & GP blog compatibility

4 replies · Started by Christine on March 27, 2022

Viewing posts 1–5 of 5

Hi! I have WP recipe maker on my site and when I ask it to make an archive page for one of the taxonomies it has created, it picks up my GP element for the content template, but it doesn't pick up the message that it's supposed to be a grid with three columns and spacing. It's all on one column and no space inbetween.

I've posted privately the link where you can see this. Is there a way to fix it to look like the others?

Thanks!

Hi Cristine,

The reason why the columns functionality isn’t woking is because the Archive page created by your plugin is a Custom Post type archive.

To make the column settings take effect in Custom Post Type Archives as well, you’ll need to add a Custom PHP snippet.

Specifically, this:

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

    return $columns;
} );

Kindly replace CPT_SLUG with the slug name of the CPT created by the plugin. Please reach out to the plugin support of WP recipe maker for assistance with regards to the slug name.

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

Adding it through Code Snippets should work.

Reference :https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type

Hope this helps. :)

Got it!
Thanks very much!

You’re welcome Christine! Glad to be of assistance! Feel free to reach out anytime if you’ll need assistance with anything else. :)

This archived topic is closed to new replies.