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 8 replies, has 4 voices, and was last updated by  Marcy 1 month, 2 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 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: 383

    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.

    #130518

    jdaviescoates
    Member
    Post count: 36

    I have the same problem. It seems that in Genesis you can only choose from 2 sub-optimal options:

    1. in Genesis Theme Settings -> Content Archives choose Display Post Content and choose some arbitrary content limit. A …[Read More…] link is displayed. Great! But sub-optimal because you can’t use the More Tag within posts to choose exactly where you want that link to appear.

    2. in Genesis Theme Settings -> Content Archives choose Display Post Excerpt. This respects the More Tag in posts and cuts off posts there. Great! But no …[Read More…] link is displayed and so this option is also sub-optimal.

    Is there really no way to be able to choose exactly where you want the …[Read More…] link to be displayed in Genesis?!?

    All I want is to be able to insert the More Tag in a post and for the blog page and content archives to display a …[Read More…] link at that point. This must be possible, no?

    • This reply was modified 1 month, 2 weeks ago by  jdaviescoates.
    • This reply was modified 1 month, 2 weeks ago by  jdaviescoates.
    #130521

    genwrock
    Member
    Post count: 937

    try this once

    add_filter('get_the_content_more_link', 'custom_read_more_link');
    function custom_read_more_link(){
        return '... <a class="button readmore" rel="nofollow" href="' . get_permalink() . '">Continue Reading...</a>';
     }

    See My PRO Genesis Child Themes | Need Genesis Developer? | Follow Me on Twitter

    #130525

    jdaviescoates
    Member
    Post count: 36

    Thanks for trying to help Genwrock, but that doesn’t make any difference.

    All your code does is change the default …[Read More…] link into a button and change the words to Continue Reading.

    My points 1 & 2 above still hold true; that is either I can have a …[Read More…] link displayed after a given number of characters (by choosing Display Post Content and setting the character limit), or I can choose where I want the break to be post by post (by choose Display Post Excerpt) but then no …[Read More…] link link is displayed at all.

    I want to be able to choose where to break posts and have a …[Read More…] link displayed.

    #130537

    Marcy
    Participant
    Post count: 383

    I do what I think you want to do on my blog. I add <!– more –> where I want in my post, and the Read more appears in the blog at that point.

    These are my Genesis settings:
    Content Archives:
    Select one of the following: Display post content
    Limit content to characters: 0

    Try it with no character limit and Display post content.


    #130538

    jdaviescoates
    Member
    Post count: 36

    Marcy, I love you!

    I knew it must be possible!

    Thanks!

    #130602

    Marcy
    Participant
    Post count: 383

    LOL! Glad it helped.


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

You must be logged in to reply to this topic.