WordPress.org

Ready to get started?Download WordPress

Forums

dynamic style id for body tag (1 post)

  1. fibaby
    Member
    Posted 8 years ago #

    Hi- I am wanting to create a dynamic style id for the body tag in the header of my header.php file. eg:

    <body id="post34">...

    where the id name is pulled from the id of the page it is going to.

    I realise I can change templates by creating new ones for specific layout, but in some cases I just want to change the background image within my header, and it would be simpler to just define this in the style.css, rather than create redundant templates or repeat code.

    I have tried a few things to pull the id in... but my php is very rusty.

    Any assistance will be greatly appreciated.

    cheers

    fi

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags