WordPress.org

Ready to get started?Download WordPress

Forums

More Link - Paragraph: Why? (2 posts)

  1. r0ma
    Member
    Posted 2 years ago #

    Hi,

    I am adapting a template and can't figure out why the "the content" function is returning the read more link in a seperate paragraph. As far as I understand, it shouldn't, unless specified in the functions.php with:

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

    ...but it's not. Yet: the output-sourcecode shows me this:

    ...socio‚Äźspatial configurations.</p>
    <p> <a href="http://justanotherwebsite.com/...city/#more-64" class="more-link">Weiterlesen &raquo;</a></p>

    It's probably something very simple I just don't know or see or find in the forums...?!
    thanks!

  2. nixgadgets
    Member
    Posted 2 years ago #

    Its because of this,
    add_filter( 'the_content', 'wpautop' );

    The read more link is part of the content as you mentioned and it gets wrapped in p tags because of wpautop. This will replace br tags with p tags.

Topic Closed

This topic has been closed to new replies.

About this Topic