- This topic has 4 replies, 2 voices, and was last updated 5 years, 8 months ago by
Leo.
-
AuthorPosts
-
August 7, 2020 at 6:39 pm #1392305
Henry
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 > BlogSo, 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
August 7, 2020 at 9:52 pm #1392402Leo
StaffCustomer SupportHi there,
This should help:
https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-typeAugust 8, 2020 at 2:09 am #1392561Henry
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!
August 8, 2020 at 2:27 am #1392578Henry
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
August 8, 2020 at 9:04 am #1393083Leo
StaffCustomer SupportGlad to hear 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.