[Resolved] Using the more tag

Home Forums Support [Resolved] Using the more tag

Home Forums Support Using the more tag

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #314085
    Maurice

    Hi there,

    I used the read more tag on many sites.

    For every blog item I make an unique text, Customize the “Read More” tag > https://en.support.wordpress.com/more-tag/

    For example, I change this one: <!–more–> in: <!–more This car is great for off road!–>

    But the theme doesn’t support this modification?

    How can I make this work 🙂

    Hope to hear, thanks in advanced!

    Greetings,
    Maurice

    #314087
    Leo
    Staff
    Customer Support

    Hi Maurice,

    Not quite sure why you would want to modify the actual more tag itself?

    GP definitely supports the more tag:
    https://docs.generatepress.com/article/using-the-more-tag/

    Let me know 🙂

    #314089
    Maurice

    Hi Leon,

    I dont want 10 times “Read more”, but unique read more texts… better for SEO, visitor experience, etc..

    See this url https://en.support.wordpress.com/more-tag/

    This how I use the more tag. I modify the “<!–more–>” in (for example) “<!–more This car is great for off road!–>”

    Hope you can help me to get this work :).

    #314090
    Leo
    Staff
    Customer Support

    The link you provided is a WordPress.com which I guess it’s a different than WordPress.org.

    This article might help: https://codex.wordpress.org/Customizing_the_Read_More#Modify_the_Read_More_text_when_using_the_the_excerpt.28.29

    #314091
    Leo
    Staff
    Customer Support
    #314092
    Maurice

    Yep, but how to get this work for this theme :)?

    Can you provide me a code I can add tot function.php?

    Hope to hear.

    #314145
    Leo
    Staff
    Customer Support

    Actually, you should be able to do just do this:
    https://codex.wordpress.org/Customizing_the_Read_More#Having_a_custom_text_for_each_post

    Let me know.

    EDIT: sorry this actually doesn’t work

    #314198
    Tom
    Lead Developer
    Lead Developer

    You would need to tell GP to stop adding the more text in order for those custom links to show up.

    This should do it:

    add_action( 'after_setup_theme','tu_remove_content_more_link_filter' );
    function tu_remove_content_more_link_filter() {
        add_filter( 'the_content_more_link', 'generate_content_more' );
        add_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
    }
    #314233
    Maurice

    Thanks guys, but no result yet.

    I add this to function.php

    add_action( 'after_setup_theme','tu_remove_content_more_link_filter' );
    function tu_remove_content_more_link_filter() {
        add_filter( 'the_content_more_link', 'generate_content_more' );
        add_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
    }

    Nothing happends? I use this setting with customizer > show full post en the read more label filled with a read more text of my own langauge. When leaving this empty, the read more text is gone.

    This what I use https://codex.wordpress.org/Customizing_the_Read_More#Having_a_custom_text_for_each_post

    But I cant get the output right/working.

    Hope to hear!

    Ps. Many thanks for your help, great theme, great support!

    #314397
    Tom
    Lead Developer
    Lead Developer

    Hmm, tested it before posting that and it worked.

    Are you using the latest GP and GPP? Which functions.php file did you add it to?

    #314451
    Maurice

    Yep, latest versions.

    Iam using youre child theme.

    See

    <?php
    /**
     * Generate child theme functions and definitions
     *
     * @package Generate
     */
    
    add_action( 'after_setup_theme','tu_remove_content_more_link_filter' );
    function tu_remove_content_more_link_filter() {
        add_filter( 'the_content_more_link', 'generate_content_more' );
        add_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
    }
     
    

    If I deactivated the “blog” option from GPP, the read more text is gone. When activate, the text I put in the customizer shows up.

    Missing some code?

    Hope to hear, thanks.. again 🙂

    #314511
    Tom
    Lead Developer
    Lead Developer

    Ah sorry, stupid mistake on my part.

    This should be the code:

    add_action( 'after_setup_theme','tu_remove_content_more_link_filter' );
    function tu_remove_content_more_link_filter() {
        remove_filter( 'the_content_more_link', 'generate_content_more' );
        remove_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
    }
    #314530
    Maurice

    Yeah, youre the best.

    Thanks, tried many things 🙂

    Keep up the good work.

    Ciao,
    Maurice

    #314608
    Tom
    Lead Developer
    Lead Developer

    Glad I could help 🙂

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