[Resolved] Editing header elements for POSTS only

Home Forums Support [Resolved] Editing header elements for POSTS only

Home Forums Support Editing header elements for POSTS only

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1636745
    Ben

    Hi Guys,

    Is there a way to edit the header elements for posts only?

    I want to increase the margin on the header elements which I can do with

    h2 {
    	margin-top: 40px;
    }

    But it affects the pages too and I don’t want that.

    Can this be done?

    Thanks

    Ben

    #1636807
    David
    Staff
    Customer Support

    Hi there,

    WordPress adds classes to the body element which can be used to target specific posts types ( amongst other things ). For the single post you can use the single-post class in your CSS selector eg.

    .single-post h2 {
        /* styles for the H2 in the single post */
    }
    #1637155
    Ben

    Oh yeah!

    Sorted it.

    Thanks

    #1637185
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.