I’m attempting to modify the TwentyTen theme to include the usual
twentyten_posted_onright after a post in the ‘asides’ category (instead of a new line below it) to create a more compact experience and I’ve run into a problem with the way text from the_content is normally wrapped in paragraph tags, which causes anything after it to land in a new line with spacing around it.
I know I can remove the
the_contentto suppress this, but that removes it from all posts, both asides and regular ones, and I only want to stop that behavior for posts in the asides category. Removing paragraphs entirely also means replicating chunks of style definitions elsewhere that the paragraph tag otherwise inherited like font styles and margins.
So it looks like I need to do one of two things:
- Modify the paragraph tag or the entry content CSS for asides, so that paragraphs simply don’t generate a line break when rendered.
echo get_the_content()instead, which bypasses filters, and then replicate the old paragraph style in another div.
Doing this in CSS seems more elegant. Is it possible? In style.css, I see definitions for
.home #content .category-asides pe.g., but looking at some CSS guides, I don’t see a way to influence the line break behavior for paragraph tags.
- The topic ‘Removing paragraphs/line breaks in asides (TwentyTen theme)’ is closed to new replies.