M
(@metacomcreative)
Hi Emi,
Nice work on creating a custom theme!
From the looks of things, you should be able to modify the CSS to add a margin above and/or below the *Posted by…” paragraph. The paragraph’s class is postmetadetaw, so you can use that to style it. For example, this will add a 6px margin above and below the “Posted by…” paragraph:
.postmetadataw {
margin: 6px 0;
}
Where else are you experiencing issues with the linebreaks? If it is in the actual post content, it may be due to the wpautop function. This function automatically adds some formatting to WordPress posts and pages. If you want to remove this auto formatting, you can add the following line in your theme’s functions.php file:
remove_filter('the_content', 'wpautop'); // Remove auto formatting from posts/pages
remove_filter('the_excerpt', 'wpautop'); // Remove auto formatting from excerpts
David Walsh wrote a more comprehensive solution on his blog as well. You can check it out here: http://davidwalsh.name/disable-autop
Note: Since you created this theme, you can modify the functions.php file directly if you would like. If you were editing an existing theme, you would want to do this in a child theme.
Few things going on, first you got this comming out from the thickbox.css
* {margin:0;padding:0;}
So, It’s not really the issue of spacing between the post, but rather the missing proper margins in typography. Because you have that line in the CSS, you lose the browser’s default stylings.
Try this CSS
p {margin:1em 0;}
h2.post-title{margin:1.5em 0;}
and see the different, then you’ll get the idea.
The point is to get rid of that bit comming out from thickbox.css, theme don’t need that css outside of thickbox, so whatever reason why it loads in the theme, just fix that, and your theme will use default browsers styling, and then you can adjust some elements with margin to fit your need.
Thread Starter
Emi
(@jenemi)
Thank you both 🙂 That seems to have fixed it!
M
(@metacomcreative)
Glad you got it working. Nice catch, Paul!