Wordpress the_content_limit formatting driving me crazy!

Discussion in 'WordPress' started by j0563, Feb 21, 2009.

  1. #1
    I have done tons of searches and I still can not find a real solution to this issue.

    When using the_content_limit in Wordpress, it is adding paragraph "<p>" tags around the content.

    Example:

    <?php the_content_limit(40, ""); ?>
    <strong><a href="<?php the_permalink() ?>">Read More...</a></strong>
    PHP:
    I want the content to cut off and the "Read More" link to stay on the same line as the content. However, it is outputted like this:


    <p>The content cut off at 40 characters<a href='http://www.example.com/article'></a></p><strong><a href="http://www.example.com/article">Read More...</a></strong>
    HTML:
    Notice that the content is wrapped in paragraph tags so now the "Read More..." link appears on a new line.

    How can I correct this??
     
    j0563, Feb 21, 2009 IP
  2. JGK

    JGK Member

    Messages:
    58
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #2
    What file is that in, and is it a different theme or the default? I'm not finding this particular code in the default theme.
     
    JGK, Feb 21, 2009 IP
  3. Sake7

    Sake7 Well-Known Member

    Messages:
    1,098
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Hi,
    I see this is an old thread, but i have the same problem and i can't find a solution. Does anyone know how to remove that <p></p>?

    Edit: Stupid me :p i found it in functions.php (if somebody is looking for it too).
     
    Last edited: Aug 27, 2010
    Sake7, Aug 27, 2010 IP