Forums

Body class (3 posts)

  1. electrocharge
    Member
    Posted 1 year ago #

    I wanted to use the <body <?php body_class(); ?>> function so i could use the class in my css to make the active page link (sprite) active on the corresponding page. I have a static page set for my homepage, so its using page.php instead of the index.php apparently. And for some reason the function is breaking my homepage, but is fine on other 'Pages'...

    Homepage (broken using page.php):
    http://www.theburgerboxtruck.com
    -or- (same page)
    http://www.theburgerboxtruck.com/?page_id=205

    Page thats working (also using page.php):
    http://www.theburgerboxtruck.com/?page_id=102

    And also, Blog page Seems to be working fine (using index.php):
    http://www.theburgerboxtruck.com/?page_id=190

    I dont get why its working on one page and not the other!!! Ideas anyone??? :/

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    this is a conflict of the css class .home -
    your stylesheet is using .home to style the home tab of your menu -

    but body_class is also adding this class .home to the body tag on the home page.

  3. electrocharge
    Member
    Posted 1 year ago #

    OMG I dont know why that didnt click in my head! LOL I must have looked at that class name 20 times!! LOL Guess thats what happens when your staring at code for hours on end! ;)

    Thanks so much! :) I knew if someone else looked at it, it would be simple! Thanks again! :)

    FIXED!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags