• Resolved brittanie

    (@brittanie)


    It looks like the_content automatically puts a paragraph tags around the post. Is it possible to change this?

    I currently have posts that look like this:

    5:24 pm | 0 Comments |
    
    if you’re driving west in rush hour there are some amazing clouds right on the horizon right now

    and I would like to have it look like this:

    5:24 pm | 0 Comments | if you’re driving west in rush hour there are some amazing clouds right on the horizon right now

    where the content is on the same line as the meta data.

    Is this possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • No you can’t. I’ve come across this problem and never been able to fix it. Just have to modify your design to accomodate this… or use this:

    <?php echo substr(get_the_content(), 0, 150); ?>

    and change ‘150’ to however many characters you want to show. But it WILL output the html code if you cut it off in the middle of an image or link.

    You’d have to float the time and comments line to the left and let the next paragraph wrap around it with CSS.

    It’s not something I recommend, unless you know that you’ll always use a paragraph as the first thing in your post.

    Thread Starter brittanie

    (@brittanie)

    I’m only doing this for one category, using conditional tags, and I know that category will never have a post that starts with anything other than a paragraph. Thanks for your help, this worked really well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modifying html called by the_content’ is closed to new replies.