- This topic has 11 replies, 2 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
March 1, 2019 at 12:08 pm #825944
Heinrich
Hi Tom!
Thanks for your great work!
I have GP PRO installed and additonally implemented a child theme of it.
I want to have the GP for the site and the child theme ONLY on one special category.
I solved this with the pluginmultiple theme
BUT how can I seperately change the blog layout options.
Generally I want to have the blog layout content type = “excerpt” and only wihtin this one special category for which I’m using the child theme I want to use the content type = “full”.THX for your help!
Martin
GeneratePress 2.2.2March 1, 2019 at 4:53 pm #826088Tom
Lead DeveloperLead DeveloperHey Martin,
You could try this function inside the child theme functions.php file:
add_filter( 'generate_show_excerpt', '__return_false' );
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 2, 2019 at 1:02 am #826261Heinrich
Hi Tom!
Thx for your awsome quick answering!
It is working!I additionally added the filter for only one special category:
add_filter( 'generate_show_excerpt','tu_full_post_harvest' ); function tu_full_post_harvest( $show_excerpt ) { if ( is_category( 'toprint' ) ) return false; return $show_excerpt; }
Additional Question:
And how can I show the full post in the category view even if the user has insterted a “read more” tag?BR
MartinMarch 2, 2019 at 9:28 am #826663Tom
Lead DeveloperLead DeveloperTry this:
add_filter( 'generate_more_tag', '__return_empty_string' );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 2, 2019 at 11:20 am #826753Heinrich
Hi Tom,
it’s not working!
Have a look https://schulungen.badhaering.at/category/toprint/
It’s german “weiterlesen” in the first post “full post test”I gave the snippet in the functions.php as well as the others.
BR
MartinMarch 2, 2019 at 10:13 pm #827020Tom
Lead DeveloperLead DeveloperThat’s strange, it should work. Maybe try this:
add_filter( 'generate_more_tag', '__return_false' );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 3, 2019 at 12:56 am #827090Heinrich
Hi,
no it didn’t help!
As I mentioned – it is a <!–more–> tag in the content.
There is no cache plugin!BR
MartinMarch 3, 2019 at 9:27 am #827531Tom
Lead DeveloperLead DeveloperHmm, both the functions should prevent the more tag from affecting the excerpts. I wonder if you have some conflicting code.. What happens if you temporarily remove your other functions and keep the one here?: https://generatepress.com/forums/topic/using-child-theme-with-different-blog-layouts/#post-827020
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 3, 2019 at 12:15 pm #827666Heinrich
Hi,
it’s so strange!
At the moment my functions.php:function child_theme_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/style.css' , array('parent-style')); } add_action( 'wp_enqueue_scripts', 'child_theme_styles' ); add_filter( 'generate_more_tag', '__return_false' ); add_filter( 'generate_show_excerpt', '__return_false' );
If I’m removing add_filter( ‘generate_show_excerpt’, ‘__return_false’ );` then the read more AND the rest of the content won’t be visible.
And the read more (from excerpt) will apear in the other posts again.I additionally have installed the GP Premium PlugIn but it won’t help.
BR
MartinMarch 3, 2019 at 4:42 pm #827837Tom
Lead DeveloperLead DeveloperAh, I misunderstood the question – sorry!
The more tag is dealt with by WordPress in the function that outputs the content. I just dug into some of the code and I couldn’t find a way to disable it using a filter, unfortunately.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 8:19 am #828505Heinrich
okay, thank you for your troubles!
March 4, 2019 at 9:44 am #828586Tom
Lead DeveloperLead DeveloperNo problem! Sorry I couldn’t be more helpful.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.