Displaying text with MORE tag?

Community Forums Forums Design Tips and Tricks Displaying text with MORE tag?

This topic is: not resolved

Tagged: , , ,

This topic contains 2 replies, has 2 voices, and was last updated by  komanderkin 7 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #87801

    komanderkin
    Member
    Post count: 2

    I’m trying to make the more tag output some text on the place where it’s inserted in the post.

    i was suggested to use the following code in functions.php:

    add_filter( 'the_content_more_link', 'read_more_text' );
    function read_more_text() {
    if ( is_single() ) {
    echo '<div class="your-banner">ADD TEXT HERE</div>';
        }
    }

    unfortunately, it doesn’t output anything on the post.

    i’ve searched all around the web for a solution, but couldn’t find a way to fix the code provided above. any ideas on how to do this in Genesis?

    99sounds.org

    http://99sounds.org
    #87841

    Marcy
    Participant
    Post count: 326

    You need to look at the code snippets on this page of studiopress.com

    http://my.studiopress.com/snippets/post-excerpts#content-more-link

    Since you’re inserting the More link into your full content, you would use this one

    //* Modify the WordPress read more link
    add_filter( 'the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
    }

    You would replace [Continue Reading] with the text that you want.


    #87849

    komanderkin
    Member
    Post count: 2

    Hi Marcy, thanks for the reply!

    I’ve tried your code but it still doesn’t do anything (or at least not what I want it to do.

    Here’s what I want to happen. Let’s say that this is the HTML snippet of my post:

    some text
    <!--more-->
    some text

    i want it to look like this on the page:

    some text
    MY TEXT WHICH IS ADDED TO THE MORE TAG
    some text

    I’ve been getting similar suggestions as the one you’ve posted above, but it seems that something is missing in that code.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.