Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Paragraph Class in Wordpress the_content

I'm sure this is simple, but I've searched Google for about 30 minutes with no luck. I'd like to know if it's possible to adjust the default class of paragraphs that are output by the_content in Wordpress.

I've read that you can add filters to the theme's functions.php file, but this particular use of WordPress isn't using a theme. Think of a static HTML site (5 pages) with a main content area on each page. Wordpress is literally only used to change the contents of those 5 content areas by the client editing any of the necessary 5 posts.

The problem is that the p tags that WordPress spits out don't have any classes applied to them. Can I change that in my query or anything? Ideally I'd be able to change the paragraph class that is output on each page individually.

Thoughts?

Thanks in advance for any help!

like image 409
Tom Winchester Avatar asked Mar 10 '13 22:03

Tom Winchester


1 Answers

Wrap your content with a div, and apply a class to that:

<div class="content">
    <? the_content(); ?>
</div>

And style it like so:

.content p { ... }
/* Page-specific */
.page-id-1 .content p { ... }
like image 165
ebsddd Avatar answered Sep 22 '22 15:09

ebsddd