Support » Theme: Frontier » Changing read more text?

  • Resolved Ate Up With Motor

    (@ate-up-with-motor)


    I’m sorry to bother you with another question. I’m trying to figure out how to modify the read more text (so that it says something other than “more…”). I see how to do it by editing the the_content function in loop-blog.php, but is it possible to do that from the child theme without simply copying the file there?

    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author ronangelo

    (@ronangelo)

    Do you mean the “Continue Reading” button?
    You could change that by adding this on your child-theme’s function.php

    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Continue Reading' ) {
    		$translated_text = 'Read Whole Article';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    As long as a text on the theme is translatable, you can change it through the functions.php http://ronangelo.com/change-or-translate-text-on-a-wordpress-theme/

    Theme Author ronangelo

    (@ronangelo)

    Oh, I think you mean the “Read more” when using a <!–more–> tag, right?
    You can use this instead.

    function change_more_link( $more_link, $more_link_text ) {
    	return str_replace( $more_link_text, 'Read This', $more_link );
    }
    add_filter( 'the_content_more_link', 'change_more_link', 10, 2 );

    That’s it exactly. Thank you so much — I spend most of yesterday trying to get my head around how to set up the code for that!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing read more text?’ is closed to new replies.