Archived topic
Using the more tag
13 replies · Started by Maurice on May 4, 2017
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
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 :)
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 :).
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
The next section as well: https://codex.wordpress.org/Customizing_the_Read_More#Customizing_the_.22more.E2.80.A6.22_text
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.
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
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 );
}
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!
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?
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 :)
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 );
}
Yeah, youre the best.
Thanks, tried many things :)
Keep up the good work.
Ciao,
Maurice
Glad I could help :)