Add a custom class name to Wordpress body tag?

前端 未结 7 1579
忘掉有多难
忘掉有多难 2021-02-07 03:29

I\'d like to place a directive in my theme\'s functions.php file which appends a classname to the wordpress body tag. Is there a built-in API method for this?

For exampl

7条回答
  •  甜味超标
    2021-02-07 03:51

    You can also use it directly inside the WP body_class function which will append the string inside body class.

    eg.

    $class="custom-class";
    >
    

    http://codex.wordpress.org/Function_Reference/body_class

提交回复
热议问题