Site logo

Archived topic

Two columns on Category pages

3 replies · Started by Bohdan on February 4, 2023

Viewing posts 1–4 of 4

Hello!
I added taxonomies (categories, tags) to my Pages. I show Pages (not Posts) on Category pages. I want to show Pages in two columns. But GP settings allow me to set only Posts in two columns. How to set the same styles for Pages as for Posts (on Category pages).
This is one of my Category pages: https://merkator.org.ua/category/8-klas/
I need this: https://testy.org.ua/category/astronomija/
Thanks)

Hi there,

add this PHP Snippet to your site:

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

    return $columns;
} );

This doc explains adding PHP: https://docs.generatepress.com/article/adding-php/

Everything works great. Thank you very much!!!

Glad to hear that!

This archived topic is closed to new replies.