Site logo

Archived topic

Question on a mysterious discovery...

4 replies · Started by Henry on August 7, 2020

Viewing posts 1–5 of 5

I'm using a Custom Post Type / Taxonomy builder called Pods which works great with GeneratePress.

One "issue" though, and I am wondering if there is a fix somewhere/somehow.

OK, so the workflow is that I create Custom Posts and those Custom Posts can be connected to WordPress categories that I created. Nothing at all unusual with all of that.

However, I've noticed that the archive loop for the Custom Post Types doesn't "obey" the GeneratePress customizing.

In other words, if I create a Post using default WordPress and hit the category archive page (loop) then I can easily manipulate the layout via

Appearance > Customizing > Layout > Blog

So, for example I can have two columns etc etc.

The above rules do NOT work for the Custom Post Type loop.

Is there a "work-around" to get the Custom Posts to follow what GeneratePress is instructing?

I hope that makes sense, thanks for all help

Thanks, but no dice....

Can I just confirm what I am trying to do here...

So, I have a Custom Post Type called "Conferences 2020" and the slug is "conference_2020"

If I associate any of the (custom) posts with a WordPress category, and then view that category archive page it is a single column of featured image and title. I am trying to have a 2 column layout.

I see that this functions.php code might help:

add_filter( 'generate_blog_columns','tu_portfolio_columns' );
function tu_portfolio_columns( $columns ) {
    if ( is_post_type_archive( 'XXXX' ) ) {
        return true;
    }

    return $columns;
}

So, if change the XXXX to the WordPress category name nothing happens.

Am I doing something wrong?

Thanks!

I fixed it!

OK, just to help other people out:

add_filter( 'generate_blog_columns','tu_portfolio_columns' );
function tu_portfolio_columns( $columns ) {
    if ( is_category( '16' ) ) {
        return true;
    }

    return $columns;
}

So, you need to make sure that the Conditional Tag is correctly applied, in my case "16" - you can check here: https://codex.wordpress.org/Conditional_Tags

Glad to hear :)

This archived topic is closed to new replies.