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!
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!
index.php
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:
http://codex.wordpress.org
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.
I have it set up at http://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>
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 />
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"?
Thanks, using this now <?php echo $post->post_content; ?>
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.
remove_filter('the_content', 'wpautop');
(filter without s) would be the right function. You can place it anywhere in your php code, but you should use it _before_ the output with the_content(); - if you want to have the effect ;)
For filters also have a look here: http://codex.wordpress.org/Plugin_API#Removing_Actions_and_Filters
//EDIT: I get no error when calling the function, but it doesn't seem as if it has any effect.
//EDIT2: Solved with disabling the Markdown-Plugin which uses its own filters - but I don't know what I've disabled with disabling the Markdown-plugin *g*
Hi Guys - <newbie warning!>
I understand the point of this thread but it doesn't quite do what I need. My blog - soon to be launched - is called blogolob. I've been trying out some dummy posts which include two or more quotations. It works fine on the home page but with 'Permalink' or 'Archives' the spacing in the quotes goes awry if I have more than one quote (look at the blue background). The problem seems to be caused by an extra set of <p> </p> in the offending pages but if I use one of the fixes above, I lose more lines than I want.
Can anyone help?
This topic has been closed to new replies.