Community Forums › Forums › Archived Forums › Design Tips and Tricks › Displaying text with MORE tag?
- This topic has 8 replies, 4 voices, and was last updated 10 years, 1 month ago by Marcy.
-
AuthorPosts
-
January 30, 2014 at 6:57 am #87801komanderkinMember
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.orgJanuary 30, 2014 at 11:45 am #87841MarcyParticipantYou need to look at the code snippets on this page of studiopress.com
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.
Marcy | Amethyst Website Design | Twitter
January 30, 2014 at 12:15 pm #87849komanderkinMemberHi 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.
November 4, 2014 at 10:16 pm #130518jdaviescoatesMemberI 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?
November 4, 2014 at 10:27 pm #130521Genesis DeveloperMembertry 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>'; }
November 4, 2014 at 10:39 pm #130525jdaviescoatesMemberThanks 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.
November 4, 2014 at 11:07 pm #130537MarcyParticipantI 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: 0Try it with no character limit and Display post content.
Marcy | Amethyst Website Design | Twitter
November 4, 2014 at 11:28 pm #130538jdaviescoatesMemberMarcy, I love you!
I knew it must be possible!
Thanks!
November 5, 2014 at 10:01 am #130602MarcyParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.