"blog" Body Class doesn't show up when Blog isn't on home page (2 posts)

  1. Digital Skraps
    Posted 5 years ago #

    Not sure if that headline makes sense.

    We're using a static page as the home page of our site and the blog is pointed to a WP Page: "My Blog Page".

    when you take the blog off of the home page in the reading settings, WP no longer includes "blog" as a body class. in fact it doesn't give the body ANY classes.

    i tried some if is_home() crap but that didn't work because WP doesnt know it's on the blog anymore.

    basically, i have to have blog in the body class and can't figure out how to get it in there using WP functionality. I dont want to parse the URL so thats not really an option.

    anybody know how to fix this?

  2. Matt McInvale
    Posted 5 years ago #

    Use is_front_page() to determine if you're on a "static" homepage. You should still get several classes with body, home, page, page-id-X, etc...

Topic Closed

This topic has been closed to new replies.

About this Topic