WordPress is adding a "<p>" before the page's content (9 posts)

  1. Stefancom
    Posted 9 years ago #

    I can't change it: though, this "" is not anywhere in my templates, WordPress simply adds it. Right before the content starts.

    But this spoils my CSS design.

    Where can I change this?



  2. mjwood
    Posted 9 years ago #

    Link to your blog would be necessary for anyone to tell you what's going on.

  3. Stefancom
    Posted 9 years ago #

  4. trmtnbike
    Posted 9 years ago #

    Hello Stefancom,

    This is due to the wpautop filter that runs behind the scenes without most users knowing about it.

    You can either run the command

    remove_filter('the_content', 'wpautop');

    at some point before you call the_content(); in the loop, or you can replace

    <?php the_content(); ?>


    <?php echo $post->post_content; ?>

    You should be aware that using the second method bypasses all filters that any plugins run before displaying your content. I believe Markdown and other similar plugins are run at this time, so you may want to use the remove_filter option if you rely on this type of plugin.

  5. bt62190
    Posted 9 years ago #

    Is it possible to use CSS to style the p tag...

    margin:0px 0px 0px 0px;
    padding:0px 0px 0px 0px;

    ...or something like that.

  6. Stefancom
    Posted 9 years ago #

    I see that problem with all these format stuff. Now, also "<br>" signs are gone...

    But well, maybe I can write them myself into the contentpages.

    No chance, just to take away "" and keep the rest?


  7. bt62190
    Posted 9 years ago #


  8. bt62190
    Posted 9 years ago #

    In the settings you can change the main text entry box to be more simplified instead of the real time display deal. When you do this it seems that the p tags are not automatically added. Also I believe returns are added such as ('\\n' aka: chr(13)). The breaks can and prabably should be added later anyway, using a javascript or php function which will replace the return character with a br tag.

  9. iklanhot
    Posted 8 years ago #

    what if i want to remove all of <p> and </p> which is on the database to be not represented in the sites. Because it ruins the website presentation.

    in what file should I add str_replace() for this function ?


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.