• I need to override the automatic paragraph tags that get created in a post.
    I want to be able to include an image in a post, but I need more specific style handling for the image(i.e. I don’t want the same padding and margin values as my default p‘s.
    Is there any way to

    1. include an img without it being automatically wrapped by p‘s.
    2. apply a special class to a p that contains an image.
    3. override all the automatic p tags so that i have to manually include them
Viewing 7 replies - 1 through 7 (of 7 total)
  • I am not sure if this helps you but under Options, General Blog Settings there is an option to ‘use_bbcode’
    I haven’t tried it but it seems to allow you to use html formatting tags.

    can u include a class to the img tag?

    I use the quicktag for the img but I then add manually one of several classes I have added in my css for left, center, right, icons etc. It does it for me. And it validates.

    I got almost the same problem here. In CSS I have added border, and background color to the p tags, and got another style for the img. But when I post an img, it gets the borders and background from the p and from its own style. So it would be nice if there would be a way to turn off WP’s HTML formatting style, and make it encode p tags in the post only if I write so. Any idea how to skip this problem?

    I believe you are always better not to tamper with the template (or even more so, the WordPress core) if you can avoid it. Using the stylesheet you should be able to style an image within a paragraph tag with (eg):

    .entry p img, .entrytext p img { etc

    or place the image inside a div of your own styling.

    Thanks a lot. Turning off the automatic paragraph tag was a solution good enough for this one.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Override automatic p tags in posts’ is closed to new replies.