Forums

wrap the "read more" link in a paragraph (4 posts)

  1. bloggingcss
    Member
    Posted 3 years ago #

    Hi all,

    I have another question about my blog, http://www.bloggingcss.com

    I'd like the "read more" link (which I customize thanks to the Headerspace plugin) to be wrapped in separate p tags other than those automatically added by WordPress around the text.

    I've seen this done on other blogs, such as Smashing Magazine, but I don't know how to achieve it.

    TIA,
    grazz

  2. bencarr
    Member
    Posted 2 years ago #

    Hi bloggingcss,

    Not sure if you're still looking for a fix for this, but it may be beneficial for others, as I came across your post searching for this exact problem.

    I ended up using a plugin called Custom More Link. The plugin allows you to format your more link from the admin settings menu; this includes adding additional or changing the class, adding rel="nofollow", changing the link text, and wrapping the link in whatever tags you'd like. The plugin also provides the option of variables to use WordPress' default values. Very simple plugin that makes a world of difference visually.

    Hope this helps,
    Ben

  3. aldolat
    Member
    Posted 2 years ago #

    Hi bloggingcss,

    when you write your article, wrap the tag more in the p tag, like so:
    <p><!--more--></p>

    In this way, your more tag will appear in a separate paragraph.

    ... hoping I have correctly understood your needs. :)

  4. lerizzle
    Member
    Posted 2 years ago #

    add this to your functions.php

    function add_p_tag($link){
    return "<p>$link</p>";
    }
    add_filter('the_content_more_link', 'add_p_tag');

Topic Closed

This topic has been closed to new replies.

About this Topic