WordPress.org

Ready to get started?Download WordPress

Forums

Keeping the formatting with "the_content_limit" tag (5 posts)

  1. Hedley
    Member
    Posted 5 years ago #

    Dear gurus:

    I'm using "the_content_limit" tag in my theme to display a list of the three most recent posts, along with the first 300 words of the post. It works just fine, except that it does not use the text formatting that appears in the original post. For instance, if in the first 300 words there is one word or phrase that is italicised, the italicisation is not reproduced in the text displayed using the_content_limit.

    Is it not possible to keep this sort of formatting with the_content_limit, or is there an argument or CSS trick I need to know about?

    My usage:

    <?php the_content_limit(300, "[Read more...]"); ?>

    Thanks!

  2. stephanieV
    Member
    Posted 5 years ago #

    Hedley -

    Did you ever find a solution for this? I'm also looking for the answer. People have recommended plugins but they either don't work as advertised or aren't very intuitive to use.

    Thanks!

  3. Hedley
    Member
    Posted 5 years ago #

    No, not so far. I haven't had much time to experiment lately, though, either. One of these days...

  4. NNDT
    Member
    Posted 5 years ago #

    This may be of help to you guys.
    http://wordpress.org/support/topic/217004?replies=4

  5. shirgans
    Member
    Posted 5 years ago #

    Hi,

    You can keep the formatting of the post by the following steps:
    1. make sure you find the limit-post.php under plugins directory.
    2. open the file and comment the line on function the_content_limit:
    `$content = strip_tags($content);'

    this should keep the formatting of your posts.

Topic Closed

This topic has been closed to new replies.

About this Topic