Forums

[resolved] how to target a specific page (3 posts)

  1. emmamin
    Member
    Posted 3 months ago #

    I want to change the css in my theme for a specific page....
    so for example I want to change the wrapper of my About page.

    I'm thinking this in my css would work...
    #wrapper.page-id-11{
    }

    but the problem is I want to be able to update my page sometimes and every time I do one little update, it changes my page id so i would have to by hand change it in the css.

    Is there a better way of doing this??

    Thank you!

  2. Christine
    Moderator
    Posted 3 months ago #

    If you update your page, the id won't change. The id will only change when you delete the page and create a new one.

    Additionally, I think that your css should be:

    .page-id-11 #wrapper not the other way around. This is the way you should use it if you use the body_class() function.

  3. emmamin
    Member
    Posted 3 months ago #

    Hi Christine,
    Thank you for your answer. It's working now. Also I suppose I was changing my mind about pages and deleting and recreating them more than I thought. hahaha.

Reply

You must log in to post.

About this Topic

Tags