ThemeShaper Forums » Thematic

[closed]

NOOB ? - Customize "Read More" Quicktag...How?

(10 posts)
  • Started 9 years ago by Derker
  • Latest reply from Cheryl
  • This topic is resolved
  1. Derker
    Member

    I feel Like I am missing the boat on this one... All i want to do is change the text in the WP <--more--> quicktag from 'Read More >>' to something else and I am having the darndest time trying to figure out where to put the following code:

    <?php the_content('Read on...'); ?>

    I have tried putting it in:
    wp's index.php
    thematic's index.php
    my child theme's functions.php
    I even tried putting in content-extensions.php

    all to no avail...
    Any thoughts, insights, leads mucho appreciado

    thx,
    Derk

    Posted 9 years ago #
  2. Hi Derk,

    this is an example for your child theme's functions.php to filter the "Read More" text:

    function my_more_text($content) {
    	$content = ' ... continue reading the story called "' . get_the_title('', '', false).'" ';
    	return $content;
    }
    add_filter('more_text', 'my_more_text');

    Chris

    Posted 9 years ago #
  3. Derker
    Member

    Thanks Chris! Worked liked a charm...

    Posted 9 years ago #
  4. Related question. . .I'm using the Commune child theme. We love everything about the "Read More" except the location - would like it to show up at the end of the excerpt (rather than starting a new paragraph down below) - where the [...] would be if it weren't an excerpt. Think it would tighten up the spacing on the front page of posts. Possible? Thanks!

    Posted 9 years ago #
  5. Here is one way to go about it:

    You could swap the ellipse out for "Read More" and then hide the original "Read More"
    In your Commune functions.php add:

    function excerpt_ellipse($text) {
       return str_replace('[...]', '<a class="excerpt-link green-read-more" href="'.get_permalink().'">Read More &raquo;</a>', $text);
    }
    add_filter('get_the_excerpt', 'excerpt_ellipse');

    and in style.css add:

    .green-read-more {display: none}
    .excerpt-link.green-read-more  {display:inline-block}

    -Gene

    Posted 9 years ago #
  6. Hi -
    That works if there's no manual excerpt or "more" tag... but if we use either of those, the Green Read More doesn't show up (and we'd like it to). Below is the code in the Commune Main Index Template (index.php) - there's a reason I used the NOOB question for this ;-) My guess is somewhere in here lies the path to nirvana. Appreciate the help!

    <div class="entry-content">
    <?php //the_content(''.__('Read More <span class="meta-nav">»</span>', 'thematic').'');
    the_excerpt();
    ?>
    " class="green-read-more" title="Read More">
    <?php echo __('Read More <span class="meta-nav">»</span>', 'thematic'); ?>

    Posted 9 years ago #
  7. Sorry, I see that caveat now. You could try this alternative. In style.css add:

    .blog #content .entry-content {padding-bottom: 18px;}
    .blog .entry-content p {display: inline; margin-right:5px;}
    .blog .green-read-more {display: inline-block; }

    and remove the previous function and add this instead to remove the [...]

    function excerpt_ellipse($text) {
       return str_replace('[...]', '', $text);
    }
    add_filter('get_the_excerpt', 'excerpt_ellipse');

    -Gene

    Posted 9 years ago #
  8. Nirvana! Thank you so much! It's beautiful!
    Next stop for me is also having it appear in the right place for the category pages.. right now, it's not there at all, just pulls excerpts. I'm playing with it now, have added the alternative css you provided (without the .blog) but with paged .p1 into the "homepage unpaged" section and also in the general content section. No luck so far but I'm still at it. Thank you for your assistance and I totally understand if you have better things to do ;-) Have a great day!

    Posted 9 years ago #
  9. Change the styles to:

    .blog #content .entry-content, .category .entry-content{padding-bottom: 18px;}
    .blog .entry-content p, .category .entry-content p {display: inline; margin-right:5px;}
    .blog .green-read-more, .category .green-read-more {display: inline-block; }

    and find this line in Commune's category.php

    <?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'thematic').'') ?>

    and replace it with this:

    <?php the_excerpt() ?>
    <p><a href="<?php the_permalink(); ?>" class="green-read-more" title="Read More"><?php echo  __('Read More <span class="meta-nav">&raquo;</span>', 'thematic'); ?> </a></p>

    Give that a try

    Posted 9 years ago #
  10. Double Nirvana! If you are ever near Boulder - coffee's on me!
    Thank you again,
    Cheryl

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.