I intend to show an excerpt of each post on my homepage. I use the_excerpt() in my post.php to show an excerpt of each post with a read more button below it. The problem is that I need to have the readmore link in another div (the category metadata div) so that they are inline with each other. That way I can style them easily. So far, I have tried with no success to, first, strip the original the_excerpt's readmore link and then provide each post with another link in the other div.

Please kindly let me know if the above strategy is the right way to do so, and help me find the solution to this problem.


To remove the readme link, I had to use the_content() instead of the the_excerpt():

<?php the_content('', TRUE); ?>

Though I have gotten rid of the original readmore link, I have no idea, how I can add a separate readmote link for each post in front of the intended div.

The code in my post.php file:

<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
                <?php get_template_part( 'templates/part', 'title' ); ?>
                <?php get_template_part( 'templates/part', 'postmetadata' ); ?>
                <?php if(has_post_thumbnail()) { ?>
                                <figure class="theme-post-media">
                                        <a><?php the_post_thumbnail( 'full', array( 'class' =>'img-responsive' ) ); ?></a>
                <?php } ?>
                <?php the_excerpt(); ?>
       <div class="postcatmeta">
                        <?php get_template_part( 'templates/part', 'postcatmeta' ); ?>
  • Can you post what you tried?
    – Howard E
    Jun 19, 2016 at 11:34
  • No ideas anyone?
    – developer
    Jun 24, 2016 at 9:12

1 Answer 1


Remove the read more with this code in your functions.php:

function wpse_230169_excerpt_more($more) {
    return '';
add_filter('excerpt_more', 'wpse_230169_excerpt_more');

Then in your template file just add the link wherever you want with:

<a href="<?php the_permalink(); ?>">Read More</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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