• I’m trying to format the content of my posts with css and it’s not working. Works fine on other lines, but I get nothing with that one. Here’s the code I’m using to insert posts on my page:

    <?php query_posts(‘category_name=News&showposts=1’); ?>
    <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <p style=”color: #ffffff; font-family: tahoma, geneva; font-size: 10pt; margin-left: 30px;”><?php the_content(); ?></p>
    <p style=”color: #ffffff; font-family: tahoma, geneva; font-size: 10pt; margin-left: 20px;”>Posted by <?php the_author(); ?> on <?php the_date(); ?></p>
    <?php endwhile; ?>

    As you can see I’m using the EXACT same <p style line in front of both the_content AND the_author. This works for the author, but the content just comes up default on the page.

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter romanonly

    (@romanonly)

    Switched from using <p> to using <div> and it solved the problem. If anyone has ideas on how to make the <p> work feel free to post.

    Wrapping <p> around the_content won’t work properly because the post content already has <p> tags, leading to incorrectly nested paragraph tags.

    Does anyone know how to remove the <p> tag the “the_content() ” is already having?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Formatting the_content() with CSS’ is closed to new replies.