Support » Fixing WordPress » Custom 'read more' link

  • I use a modified ‘continue reading’ link:

    <?php the_content ('<span class="continue-reading">CONTINUE READING »</span>'); ?>

    to which I want to be able to add p tags for easier styling.

    I’ve not yet been able to find a sensible way to do it.

    UPDATE: after another search I found something elsewhere onsite which works:

    function wrap_readmore($more_link)
    {
    	return '<div class="post-readmore">'.$more_link.'</div>';
    }
    add_filter('the_content_more_link', 'wrap_readmore', 10, 1);

    One tiny issue is that it a space between the ‘p’ and ‘a href’ tags – and I can’t find a way to remove it.

  • The topic ‘Custom 'read more' link’ is closed to new replies.