Support » Themes and Templates » More Link – Paragraph: Why?

  • r0ma



    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="" 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…?!

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘More Link – Paragraph: Why?’ is closed to new replies.