- This topic has 13 replies, 3 voices, and was last updated 6 years, 10 months ago by Tom.
-
AuthorPosts
-
May 4, 2017 at 2:34 pm #314085Maurice
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,
MauriceMay 4, 2017 at 2:39 pm #314087LeoStaffCustomer SupportHi 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 🙂
May 4, 2017 at 2:44 pm #314089MauriceHi 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 :).
May 4, 2017 at 2:47 pm #314090LeoStaffCustomer SupportThe 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
May 4, 2017 at 2:49 pm #314091LeoStaffCustomer SupportThe next section as well: https://codex.wordpress.org/Customizing_the_Read_More#Customizing_the_.22more.E2.80.A6.22_text
May 4, 2017 at 2:51 pm #314092MauriceYep, but how to get this work for this theme :)?
Can you provide me a code I can add tot function.php?
Hope to hear.
May 4, 2017 at 6:05 pm #314145LeoStaffCustomer SupportActually, you should be able to do just do this:
https://codex.wordpress.org/Customizing_the_Read_More#Having_a_custom_text_for_each_postLet me know.
EDIT: sorry this actually doesn’t work
May 5, 2017 at 12:16 am #314198TomLead DeveloperLead DeveloperYou 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 ); }
May 5, 2017 at 1:25 am #314233MauriceThanks 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!
May 5, 2017 at 8:40 am #314397TomLead DeveloperLead DeveloperHmm, 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?
May 5, 2017 at 10:12 am #314451MauriceYep, 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 🙂
May 5, 2017 at 11:54 am #314511TomLead DeveloperLead DeveloperAh 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 ); }
May 5, 2017 at 12:42 pm #314530MauriceYeah, youre the best.
Thanks, tried many things 🙂
Keep up the good work.
Ciao,
MauriceMay 5, 2017 at 7:02 pm #314608TomLead DeveloperLead DeveloperGlad I could help 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.