Support » Themes and Templates » Editing the default <p> tags in a post.

  • Resolved dg77


    Currently, when someone makes a post, paragraphs are enclosed in plain html “p” tags.

    How can I edit these tags? I would like to assign a class to them. So, when a post is made paragraphs are enclosed in <p class=”class_name”>.

    Also: I don’t want to have to do this manually each time, so using the ‘HTML’ button will not work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Any particular reason that you want to do this? The more normal approach to styling these things is to have all your posts enclosed in a content div, and then using something like #content p in your stylesheet to refer to the paragraphs.

    I’ve added wordpress to the current design of our webite. It has it’s own stylesheet, and the powers that be aren’t going to modify it.

    p {margin:0px;}

    That is in our current style sheet. It’s causing me a problem, because it removes the space inbetween paragraphs.

    I can change that with the blog’s stylesheet, but it messes up our navigation menu when I do. So, I’d like to just give the tags in the blog their own class to differentiate the two in the stylesheet.

    If there’s a better way, I’m definitly open to it.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    I’d have to see the site to be specific about what to do, however there’s almost always an easier way than editing the wordpress code itself. Wrap The Loop in a div id=”content” and then add this to the blog’s style sheet:
    #content p { margin: 10px; }
    …or whatever. You can change those p’s without changing *all* p’s, and without using a class on the p’s themselves.

    Fantastic. That’s exactly what I was looking for.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Editing the default <p> tags in a post.’ is closed to new replies.