• Currently <?php the_content(); ?> is being wrapped by <P> </P>. Which file can I modify to just put in a <BR> instead? Thanks a lot!

Viewing 15 replies - 1 through 15 (of 17 total)
  • index.php

    Thread Starter rknet

    (@rknet)

    I don’t see it in there. I don’t have a <P> or <BR> before the content… yet from viewing the source I can see it is putting in <P> </P>. Thanks.

    By default, your content should be in paragraphs. If we had a link to your site we could see what you want to do and help you be more specific.

    Proper HTML formatting puts every paragraph in a <p> tag. This sets, by default, a break between the paragraphs. You can control the break between the paragraphs within the style.css under any reference to this tag.

    If you do not want “space” between the paragraphs, then you can change the style to something like this:

    #content p {margin: 0px 5px; padding: 0px 5px}

    This makes the paragraph have a 5 px margin on the left and the right, combined with a 5px padding “margin” on the left and right, adding up to 10pxs on either side to provide “space” between the edges of the container or page in which the content paragraph sits, BUT there should be no space between the tops and bottoms of the paragraph container.

    For more information on CSS and styling your WordPress Theme, check out the WordPress Codex, official documentation site:
    https://codex.www.remarpro.com

    Also, the <p> is added by default automatically by WordPress. If we understood better how you want to use this, we could give you a better answer on how to change this.

    You will not “see” it until you have generated the page.

    Thread Starter rknet

    (@rknet)

    I have it set up at https://www.rilokiley.net/. There is an extra blank area inbetween the author/timestamp and content lines that I don’t care for.

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

    Thread Starter rknet

    (@rknet)

    Wow, that worked quite nicely. Thank you Schulte!!

    If you are going to use the <br>, please use it right. In XHTML, it must have a self-closing tag and look like this: <br />

    Thread Starter rknet

    (@rknet)

    Where does it go? Does it hurt to not use it?

    just put the slash in the code above before the end tag for the br and place a space between both as Lorelle as outlined

    it doesn’t hurt not to use it – it’s just valid xhtml markup. can we jut erase the marchitecture of “semantic”?

    Thread Starter rknet

    (@rknet)

    Thanks, using this now <?php echo $post->post_content; ?>

    Thread Starter rknet

    (@rknet)

    Er, I mean <?php echo $post->post_content; ?><br />

    The solution of “schulte” its so great! Thanks a lot!

    The nicer way would be to do remove_filters(‘the_content’, ‘wpautop’); before the loop.

    masquerade, does this remove the autoformatting features in the post entry box (wrapping things in <p> </p> tags, for example?).

    If so, I’m looking for exactly that, but am not sure where to use the remove_filters('the_content', 'wpautop'); line.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Remove <P> </P> around <?php the_content(); ?>’ is closed to new replies.