How to Append to the_excerpt() Function

I have the following snippet of code:

<?php>$more = '.....';?> 
<p class="extra"><?php the_excerpt(); ?></p>

What I am trying to do is append the value of $more to the_excerpt() function but unsure how to do.

Read More

I have tried:

<p class="extra"><?php the_excerpt() . $more; ?></p>

but no go.

Any help would be appreciated.

Thanks.
sp.

Related posts

Leave a Reply

2 comments

  1. Just echo out the $more after the excerpt:

    <p class="extra"><?php the_excerpt(); echo $more; ?></p>
    

    or a better solution would bet the use a filter and leave the template as is, for example your template uses just the_excerpt()

    <p class="extra"><?php the_excerpt(); ?></p>
    
    
    <?php
    //and this goes in your theme's functions.php file
    add_filter('the_excerpt','my_excerpt_more');
    function my_excerpt_more($excerpt){
       return $excerpt. '.....';
    }