Support » Requests and Feedback » WordPress bug with the_content (), PRE tag and force_balance_tags()

  • When share the contents of the recording tag more for example what is inside of me tag PRE, reference a la “read more” is inside of the tag itself PRE, but it has to be outside it.

    How to fix:
    post-template.php. Source site:

    if ( ! empty($more_link_text) )
       $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
    $output = force_balance_tags($output);

    Change the order of the call, first let force_balance_tags () will work with balanced tag and then url “read more” is added – fuck him unclosed tags balance (there are none).

    Here it is:

    $output = force_balance_tags($output);
    if ( ! empty($more_link_text) )
      $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );

    Lines 218-220 ~ in post-template.php.

    Example bug (screenshot) – http://sitehint.ru/wp-content/uploads/2013/05/Bagi-WordPress-formatirovanie-v-the_content.png

  • The topic ‘WordPress bug with the_content (), PRE tag and force_balance_tags()’ is closed to new replies.