0

I'm currently using the Hemingway theme as seen here:

gamingprofessors.com

Currently this theme provides a pleasing tag when generated, however I can't change what the tag reads as. At least individually. I know I can go into the functions.php and change the $more_link_text:

// Custom more-link text
add_filter( 'the_content_more_link', 'hemingway_custom_more_link', 10, 2 );

function hemingway_custom_more_link( $more_link, $more_link_text ) {
return str_replace( $more_link_text, __('Episode Summary and Extras', 
'hemingway'), $more_link );
}

as I have done. However, I also am interested in writing normal blog posts and don't wish for them to take up large amounts of page real estate. The reason I chose "episode summary and extras" as the text is it's more obvious and entices a click vs "read more". However during a regular blog post this tag wouldn't make sense. Is there anyway to allow me to customize the tag and have it display, for example and without losing the formatting and colored box behind the tag currently? Also Hemingway doesn't support excerpts, at least not on blog posts as far as I can tell. So this isn't an option. I don't mind typing out the custom tag each post.

  • if the more text is fixed by the theme you should be able to find it in the theme files. Is there any way to distinguish ordinary posts? you could add a custom post type, or check the category for instance. – inarilo Aug 22 '17 at 7:11
  • Yes, I set them by category, then people can look them up by that. Despite this the more tag still reads whatever the $more_link_text is set to. If I don't use the more tag then my blog feed page (the home page) becomes long and crowded. The point is I want to use the more tag on both post types. Those with a podcast so it would read "episode summary and extras" and then on a ordinary post so it would read "Read More" or something similar. – Justin Brooks Aug 22 '17 at 20:14
1

WordPress has the functionality built-in natively.

Try updating the read more tag in the Text editor. Examples:

<!--more Episode Summary and Extras -->
<!--more Regular Blog Post -->
<!--more Read More About My Cats -->

This only works with the_content(), but it sounds like your theme's blog loop is using that.

  • This didn't work. I had already tried that. – Justin Brooks Aug 22 '17 at 20:06
  • The problem is no matter what I include with <!--more XYZ --> it still only reads what is set for the $more_link_text. – Justin Brooks Aug 22 '17 at 21:01
  • 1
    Actually for some reason, after I went back and just took out that code line it is now working correctly today with formatting in tact. Thanks for the help. – Justin Brooks Aug 22 '17 at 21:11
0

You can make shortcode with custom more text and show it only on archive pages (not single.php). It allows customize you read more text.

Something like this

add_shortcode('readmore', ...)

if(!is_singular())
  do_shortcode('readmore');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.