wfx_display_body_tag

Description

Inserts the <body> code output in your webpage output. Similar to the core WordPress function body_class(), but also adds in the following dynamic Wonderflux CSS class definitions for advanced targeting of different layout types and dimensions:

  • Overall layout description, see example: content-with-sidebar-1
  • Position of primary sidebar, see example: sidebar-1-left
  • Main site width, see example: width-950

Parameters

None.

Return values

Echo string, including WordPress dynamic CSS body class definitions and Wonderflux layout references.

Example

<?php
// Example 1
// In your child theme header.php file
echo '</head>';
wf_after_head(); //WF display hook
wfx_display_body_tag('');
wfbody_before_wrapper(); //WF display hook
wfheader_before_wrapper(); //WF display hook
?>

Example output

<body class="home page page-id-98 page-template-default
content-with-sidebar-1 sidebar-1-left width-950">

Example CSS

/*
Example 1
In style.css file
Set main background when sidebar set to left and width 950px
*/
.sidebar-1-left.width-950 #main-content {
 background: url(images/bg-sidebar.png) repeat-y 230px top;
}
/*
Example 2
In style.css file
Set main background when sidebar set to right, any site width
*/
.sidebar-1-right #main-content {
 background: url(images/bg-sidebar.png) repeat-y 700px top;
}

Notes

If you use your own header.php file in your child theme, you should use this function to allow for advanced CSS targeting. Alternatively you could use the normal WordPress <body <?php body_class(); ?>> style body class function after closing the <head> section. If you want completely ‘clean’ output, just include a simple <body> opening tag, but that’s no fun!

If you use your own header.php file in your child theme – copy the core Wonderflux file into your child theme directory as a starting point to ensure that all Wonderflux hooks, code and functionality are maintained.

Development note: Wonderflux V0.931 adds this as a separate function – this was originally embed in a depreciated core function and has been split-up to allow more flexibility in child themes.

This function documentation was last modified on: August 13, 2011 by Jonny