-
gp_user
Hi,
I created a page some month ago which stores one picture per “WordPress Post”. All posts will be listed in category archives. And for this kind of posts I optimized my layout.
Now I ran into the following issue: I want to create “normal” posts with text, all the posts will be stored in the category “aktuelles”. All the posts of the category “aktuelles” should be displayed without the 4 columns layout.Is there a possibility to change the behaviour just for a specific category? Maybe with an own “category-aktuelles.php” file?
Thank you!
Best regards,
Nico -
Hi there,
what is the changes you want to make to the
aktuelles
category archive? -
gp_user
Hi,
I want to change the layout to one or two columns and I want to show at least the title of the blog post.
Best regards,
Nico -
For the columns you can use the
generate_blog_get_column_count
filter hook:https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columns
for example:
add_filter( 'generate_blog_get_column_count','tu_search_column_count' ); function tu_search_column_count( $count ) { if ( is_category('your-category-slug') ) { return 50; } return $count; }
This will set the column width to 50% ( 2 columns ) for the slug you set in the condition:
if ( is_category('your-category-slug') ) {
For the title, how are you currently removing that from your other archives ?
-
gp_user
Thank you, I will try your suggestions.
The last question regarding the title. I was wrong, I do not remove titles. The title formatting is just broken – for sure because of my changes I already did.
For now, I have no questions.Best regards,
Nico -
You’re welcome
- You must be logged in to reply to this topic.