• Resolved bazzle83

    (@bazzle83)


    I’m using this mini-loop on my frontpage.

    <?php query_posts('cat=3&showposts="1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href='<?php the_permalink() ?>'><?php the_content(); ?></a>
    <?php endwhile; ?>

    Basically it shows the first post from a category which is made up of image posts (no text)

    As you can see the_content is wrapped inside the_permalink. The problem here is that the_content automatically generates <p></p> tags around the content output.

    This is undesirable because having paragraph tags within links does not validate.

    Is there a way of modifying the_content tag so it excludes the <p> tags?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent p tags from being generated’ is closed to new replies.