• Resolved dpenny2

    (@dpenny2)


    I want to add some CSS to modify header on a specific page ONLY, specifically to “not display” header. I am using ASTRA theme (free) and Elementor (free) and WPcode (free).

    Which is proper:

    1. add CSS code to header at site level (if possible), and activate/filter by page ID/slug,etc
    2. add CSS code anywhere on specific page, and “target it” to header element.
    3. other?
Viewing 1 replies (of 1 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @dpenny2,

    There are 2 ways to do that easily with WPCode.

    The first one is the one you mentioned – adding the code to the Site Wide Header and using conditional logic to limit where the snippet is loaded.

    The other option is CSS specific – because you are using a CSS snippet, in most cases you can target a specific page with the styles by including the page-specific class added to the body. Most themes will use the body_class function and that will have a class specific to a page or post by its id.

    So you could wrap the style like this, replacing 2 with the id of your page.

    .page-id-2 .your-header {
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘CSS act on only specific page ?’ is closed to new replies.