• JBOT

    (@1moreliftwear)


    (Storefront Theme) I have tried selecting the page-id with # or . and none of them work. I may be doing the code wrong, could somebody please advise me how to do this correctly.

    The code that I have changed removes the page-title heading and the dividing line underneath, which is what I wanted on the home page, but now I have created a blog page for my website that automatically grabs the “posts” and embeds them in this page;
    https://www.1more.com.au/category/the-blog/

    However, notice that there are 2 random sentences, one has “stay tuned” on the end, this is from an entire different blog post which should have a heading and date above it, along with the other one. Notice the headings / date is missing on both, and when playing around with inspect element I can get them to re-appear by changing my previous code from “display: none” to “block”, but then the home page is effected obviously. So how do i make the code that I changed, apply to ONLY the HOME PAGE / WEB PAGES – NOT POSTS, it’s killing me, i’d love to know the proper way to do this.

    I don’t want page headings on web pages / product pages, etc, but on the posts, I do want headings / date. Please advise me on the correct CSS for this.

    Regards,

    Josh.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Josh,

    WordPress adds classes to the body tag, depending on the template or page being shown. You can use those classes to build your CSS selector, and should be able to target just the blog page.

    [Redacted – please don’t offer to contact users outside of www.ads-software.com]

    Thread Starter JBOT

    (@1moreliftwear)

    Yeah I tried looking and the home page didn’t seem to have a code for the body tag, could you inspect for me and tell me if you can see anything?

    I am looking for an “id =” or “class=” so I can address it in the CSS to change the styling, maaaaaan help me out. Pulling my hair out here.

    You could target just the home page by using .home before your selectors, and you could target just the page you linked in your original post by using .category-the-blog before your selectors. Does that help?

    Thread Starter JBOT

    (@1moreliftwear)

    You champion!!! I actually love you (no-homo)
    Thanks a tonne, fixed

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change CSS (headings) on home page only?!’ is closed to new replies.