[Resolved] Using Child Theme with different blog layouts

Home Forums Support [Resolved] Using Child Theme with different blog layouts

Home Forums Support Using Child Theme with different blog layouts

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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 plugin multiple themeBUT 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

    #826088
    Tom
    Lead Developer
    Lead Developer

    Hey Martin,

    You could try this function inside the child theme functions.php file:

    add_filter( 'generate_show_excerpt', '__return_false' );

    Let me know 🙂

    #826261
    Heinrich

    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
    Martin

    #826663
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'generate_more_tag', '__return_empty_string' );

    #826753
    Heinrich

    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
    Martin

    #827020
    Tom
    Lead Developer
    Lead Developer

    That’s strange, it should work. Maybe try this:

    add_filter( 'generate_more_tag', '__return_false' );

    #827090
    Heinrich

    Hi,
    no it didn’t help!
    As I mentioned – it is a <!–more–> tag in the content.
    There is no cache plugin!

    BR
    Martin

    #827531
    Tom
    Lead Developer
    Lead Developer

    Hmm, 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

    #827666
    Heinrich

    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
    Martin

    #827837
    Tom
    Lead Developer
    Lead Developer

    Ah, 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.

    #828505
    Heinrich

    okay, thank you for your troubles!

    #828586
    Tom
    Lead Developer
    Lead Developer

    No problem! Sorry I couldn’t be more helpful.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.