- This topic has 11 replies, 2 voices, and was last updated 5 years, 1 month ago by Tom.
-
AuthorPosts
-
March 1, 2019 at 12:08 pm #825944Heinrich
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
March 1, 2019 at 4:53 pm #826088TomLead 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 🙂
March 2, 2019 at 1:02 am #826261HeinrichHi 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 #826663TomLead DeveloperLead DeveloperTry this:
add_filter( 'generate_more_tag', '__return_empty_string' );
March 2, 2019 at 11:20 am #826753HeinrichHi 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 #827020TomLead DeveloperLead DeveloperThat’s strange, it should work. Maybe try this:
add_filter( 'generate_more_tag', '__return_false' );
March 3, 2019 at 12:56 am #827090HeinrichHi,
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 #827531TomLead 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
March 3, 2019 at 12:15 pm #827666HeinrichHi,
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 #827837TomLead 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.
March 4, 2019 at 8:19 am #828505Heinrichokay, thank you for your troubles!
March 4, 2019 at 9:44 am #828586TomLead DeveloperLead DeveloperNo problem! Sorry I couldn’t be more helpful.
-
AuthorPosts
- You must be logged in to reply to this topic.