Forums

[resolved] a little help for a newbee (8 posts)

  1. liquidws
    Member
    Posted 7 months ago #

    hi wordpress world! lol

    just starting out and ran into a snag.. this code in the header.php file
    <body <?php body_class(); ?>>

    renders out like this..
    <body class="home blog projects">

    i need to add another class call.. what file does this <?php body_class(); ?> refer to so i can add ???

    thanks in advance.

  2. doc4
    Member
    Posted 7 months ago #

    The body_class function is detailed here: http://codex.wordpress.org/Function_Reference/body_class

  3. liquidws
    Member
    Posted 7 months ago #

    thank you!

  4. liquidws
    Member
    Posted 7 months ago #

    ok.. maybe i should rephrase this..

    i need to add another class here, so it would look like this..

    <body <?php body_class(); ?> class="demo1" >

    but this throws an error when i validate, saying that there are two classes. therefore, how would i accomplish this?

  5. liquidws
    Member
    Posted 7 months ago #

    woudl this be correct...

    <body <?php body_class('demo1'); ?>>

    ?

  6. liquidws
    Member
    Posted 7 months ago #

    and if i need to add more..

    <body <?php body_class('demo1','demo2'); ?>>

    ?

  7. esmi
    Theme Diva & Forum Moderator
    Posted 7 months ago #

    Yes - that would add a class called demo1 to the body tag.

  8. liquidws
    Member
    Posted 7 months ago #

    @esmi -- thank you!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.