本文整理汇总了PHP中body_class函数的典型用法代码示例。如果您正苦于以下问题:PHP body_class函数的具体用法?PHP body_class怎么用?PHP body_class使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了body_class函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: p2_body_class
function p2_body_class()
{
if (is_taxonomy('mentions')) {
return body_class('mentions');
}
return body_class();
}
示例2: q21_body_tag
function q21_body_tag()
{
?>
<body <?php
body_class('sexy q21');
?>
>
<?php
}
示例3: clink_page_generator
/**
* Generate Clink countdown page when is needed
*/
function clink_page_generator()
{
global $clink_url;
global $post_id;
$clink_powered_by_text = get_option('clink_powered_by_text');
$clink_countdown_duration = get_option('clink_countdown_duration');
if (!is_numeric($clink_countdown_duration) or empty($clink_countdown_duration)) {
$clink_countdown_duration = 10;
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
echo '<title>' . get_the_title($post_id) . ' - ' . get_bloginfo('name') . '</title>';
echo '<meta name="robots" content="noindex,nofollow"/>';
wp_head();
echo "<script>\n\t\t\t\t\t\tvar countdown_duration =" . $clink_countdown_duration . ";\n\t\t\t\t\t\tvar redirect_target_url ='" . $clink_url . "';\t\t\t\t\t\t\n\t\t\t\t\t</script>";
?>
</head>
<body <?php
body_class(get_bloginfo('language'));
?>
<?php
if (is_rtl()) {
echo 'dir="rtl"';
}
?>
>
<div class="clink-page">
<div class="container">
<div class="clink-box">
<p><?php
_e('You will redirect to the destination link In a moment', 'aryan-themes');
?>
</p>
<div id="countdown"></div>
<p class="problem"><?php
printf(__('If the page does not redirect automatically, click on <a href="%s">this link</a>', 'aryan-themes'), $clink_url);
?>
</p>
</div>
</div>
<?php
if ($clink_powered_by_text === "1") {
echo '<div class="aryan-themes"><p>';
printf(__('Powered By <a href="%s">Aryan Themes</a>', 'aryan-themes'), 'http://aryanthemes.com');
echo '</p></div>';
}
?>
</div>
</body>
</html>
<?php
}
示例4: thematic_bodyopen
/**
* thematic_bodyopen function
*/
function thematic_bodyopen()
{
if (apply_filters('thematic_show_bodyclass', TRUE)) {
// Creating the body class
echo '<body ';
body_class();
echo '>' . "\n\n";
} else {
echo '<body>' . "\n\n";
}
}
示例5: pl_standard_head
/**
* Get standard HTML head for user in header.php
* This function is needed if header.php is used in child themes
*/
function pl_standard_head($content)
{
?>
<!DOCTYPE html>
<html class="no-js" <?php
language_attributes();
do_action('the_html_tag');
?>
>
<head>
<meta http-equiv="Content-Type" content="<?php
bloginfo('html_type');
?>
; charset=<?php
bloginfo('charset');
?>
" />
<?php
printf(apply_filters('pl_xfn', '<link rel="profile" href="http://gmpg.org/xfn/11" />' . "\n "));
printf(apply_filters('pl_mobile_viewport', '<meta name="viewport" content="width=device-width, initial-scale=1">' . "\n"));
?>
<?php
wp_head();
?>
</head>
<body <?php
body_class(pl_scheme_class('site_scheme'));
?>
><?php
pl_hook('pagelines_before_site');
?>
<div id="site" class="site-wrap" ><?php
pl_hook('pagelines_before_page');
?>
<div class="site-wrap-pad"><?php
pl_hook('pagelines_site_wrap');
?>
<div id="page" class="page-wrap"><?php
pl_hook('pagelines_page');
?>
<div class="page-wrap-pad"><?php
pl_hook('pagelines_before_main');
?>
<?php
echo $content;
?>
<?php
}
示例6: thematic_bodyopen
function thematic_bodyopen()
{
if (apply_filters('thematic_show_bodyclass', TRUE)) {
// Creating the body class
if (!THEMATIC_COMPATIBLE_BODY_CLASS) {
echo '<body lang="en" ';
body_class();
echo '>' . "\n\n";
} else {
echo '<body class="';
thematic_body_class();
echo '">' . "\n\n";
}
} else {
echo '<body lang="en">' . "\n\n";
}
}
示例7: getFunctions
/**
* Register a list of functions available into Twig templates.
*
* @return array|\Twig_SimpleFunction[]
*/
public function getFunctions()
{
return [new Twig_SimpleFunction('wp_head', 'wp_head'), new Twig_SimpleFunction('wp_footer', 'wp_footer'), new Twig_SimpleFunction('body_class', function ($class = '') {
return body_class($class);
}), new Twig_SimpleFunction('post_class', function ($class = '', $id = null) {
return post_class($class, $id);
}), new Twig_SimpleFunction('wpautop', function ($text, $br = true) {
return wpautop($text, $br);
}), new Twig_SimpleFunction('wp_trim_words', function ($text, $num_words = 55, $more = null) {
return wp_trim_words($text, $num_words, $more);
}), new Twig_SimpleFunction('fn', function ($functionName) {
$args = func_get_args();
// By default, the function name should always be the first argument.
// This remove it from the arguments list.
array_shift($args);
if (is_string($functionName)) {
$functionName = trim($functionName);
}
return call_user_func_array($functionName, $args);
}), new Twig_SimpleFunction('meta', function ($key, $id = null, $context = 'post', $single = true) {
return meta($key, $id, $context, $single);
}), new Twig_SimpleFunction('translate', function ($text, $domain = 'default') {
return translate($text, $domain);
}), new Twig_SimpleFunction('__', function ($text, $domain = 'default') {
return __($text, $domain);
}), new Twig_SimpleFunction('_e', function ($text, $domain = 'default') {
return _e($text, $domain);
}), new Twig_SimpleFunction('_n', function ($single, $plural, $number, $domain = 'default') {
return _n($single, $plural, $number, $domain);
}), new Twig_SimpleFunction('_x', function ($text, $context, $domain = 'default') {
return _x($text, $context, $domain);
}), new Twig_SimpleFunction('_ex', function ($text, $context, $domain = 'default') {
return _ex($text, $context, $domain);
}), new Twig_SimpleFunction('_nx', function ($single, $plural, $number, $context, $domain = 'default') {
return _nx($single, $plural, $number, $context, $domain);
}), new Twig_SimpleFunction('_n_noop', function ($singular, $plural, $domain = 'default') {
return _n_noop($singular, $plural, $domain);
}), new Twig_SimpleFunction('_nx_noop', function ($singular, $plural, $context, $domain = 'default') {
return _nx_noop($singular, $plural, $context, $domain);
}), new Twig_SimpleFunction('translate_nooped_plural', function ($nooped_plural, $count, $domain = 'default') {
return translate_nooped_plural($nooped_plural, $count, $domain);
})];
}
示例8: response_font
/**
* Establishes the theme font family.
*
* @since 1.0
*/
function response_font()
{
global $themeslug, $options;
//Call global variables
$family = apply_filters('response_default_font_family', 'Helvetica, serif');
if ($options->get($themeslug . '_font') == "") {
$font = apply_filters('response_default_font', 'Arial');
} else {
$font = $options->get($themeslug . '_font');
}
?>
<body style="font-family:'<?php
echo str_replace("+", " ", $font);
?>
', <?php
echo $family;
?>
" <?php
body_class();
?>
> <?php
}
示例9: is_numeric
$header_bckOpacity = is_numeric($opValue) ? TRUE : FALSE;
if (is_front_page() && ($header_bckOpacity && intval($opValue) < 100)) {
$bodyClass .= ' transparent-header';
}
if (is_search()) {
if ($slayout == 'fullwidth') {
$bodyClass .= ' fullwidth';
}
if ($slayout == 'sidebar-right') {
$bodyClass .= ' sidebar-right';
}
}
?>
<body <?php
body_class($bodyClass);
?>
>
<?php
$headright_content = get_theme_mod('tesseract_header_right_content');
$wooheader = get_theme_mod('tesseract_woocommerce_headercart') == 1 ? true : false;
$rightclass = '';
if ($headright_content && $headright_content !== 'nothing') {
$rightclass = $wooheader ? $headright_content . ' is-right is-woo ' : $headright_content . ' is-right no-woo ';
} else {
if ($headright_content == 'nothing' && $wooheader) {
$rightclass = $wooheader ? $headright_content . ' no-right is-woo ' : $headright_content . ' no-right no-woo ';
}
}
$headpos = is_front_page() && ($header_bckOpacity && intval($opValue) < 100) ? 'pos-absolute' : 'pos-relative';
?>
示例10: str_replace
$road_opt['opt-favicon'] = str_replace('http:', 'https:', $road_opt['opt-favicon']);
}
?>
<link rel="icon" type="image/png" href="<?php
echo esc_url($road_opt['opt-favicon']['url']);
?>
">
<?php
}
}
wp_head();
?>
</head>
<body <?php
body_class('home');
?>
>
<div id="yith-wcwl-popup-message" style="display:none;"><div id="yith-wcwl-message"></div></div>
<div class="wrapper box-layout">
<div class="page-wrapper">
<div class="header-container fourth layout4">
<?php
if (isset($road_opt)) {
?>
<div class="top-bar">
<div class="container">
<?php
if (isset($road_opt['call_us']) && $road_opt['call_us'] != '') {
?>
示例11: get_template_part
<?php
get_template_part('templates/head');
?>
<body <?php
body_class('');
?>
>
<!--[if lt IE 8]><div class="alert alert-warning"><?php
_e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots');
?>
</div><![endif]-->
<?php
do_action('get_header');
// Use Bootstrap's navbar if enabled in config.php
if (current_theme_supports('bootstrap-top-navbar')) {
get_template_part('templates/header-top-navbar');
} else {
get_template_part('templates/header');
}
?>
<?php
// display the Page Take Over if it's enabled
do_action('display_ptko');
?>
<div class="innerbg wrap container" role="document" <?php
if (is_search()) {
echo 'style="margin-top:28px;"';
示例12: wp_head
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -->
<?php
wp_head();
?>
</head>
<?php
$page_loading = zget_option('show_page_loading', 'general_options') == 'yes' ? 'loading' : '';
$menu_style_color = zget_option('main_menu_color', 'style_options');
if ($menu_style_color !== 'light') {
$menu_style_color = '';
}
?>
<body <?php
body_class(array($page_loading, zget_option('menu_style', 'general_options'), $menu_style_color));
?>
>
<?php
if (!empty($page_loading)) {
$alternative_logo = zget_option('logo_alternative', 'general_options');
?>
<div id="loader" class="text-center">
<?php
echo zn_logo($alternative_logo, false, 'h3');
?>
<h2><?php
_e('is loading...', 'zn_framework');
?>
示例13: bloginfo
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title><?php wp_title('|', true, 'right'); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_enqueue_style('responsive-style', get_stylesheet_uri(), false, '1.9.3.1');?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php responsive_container(); // before container hook ?>
<div id="container" class="hfeed">
<?php responsive_header(); // before header hook ?>
<div id="header">
<?php responsive_header_top(); // before header content hook ?>
<?php if (has_nav_menu('top-menu', 'responsive')) { ?>
<?php wp_nav_menu(array(
'container' => '',
'fallback_cb' => false,
'menu_class' => 'top-menu',
'theme_location' => 'top-menu')
示例14: do_action
<![endif]>
<!-- START HEAD -->
<head>
<?php
do_action('yit_head');
?>
<?php
wp_head();
?>
</head>
<!-- END HEAD -->
<!-- START BODY -->
<body <?php
body_class($body_classes);
?>
>
<!-- START BG SHADOW -->
<div class="bg-shadow">
<?php
do_action('yit_before_wrapper');
?>
<!-- START WRAPPER -->
<div id="wrapper" class="container group">
<?php
do_action('yit_before_header');
?>
示例15: body_class
?>
)">
<?php
} else {
?>
<?php
if (!is_home()) {
$home_class = 'menu-color';
} else {
$home_class = '';
}
?>
<body <?php
body_class($home_class);
?>
itemscope="itemscope" itemtype="http://schema.org/WebPage">
<?php
}
if (function_exists('zerif_top_body_trigger')) {
zerif_top_body_trigger();
}
$minimalzerif_parent_theme = get_template();
if (!empty($minimalzerif_parent_theme) && $minimalzerif_parent_theme == 'zerif-pro') {
/*************************************************/
/************** Background settings *************/
/*************************************************/
$zerif_background_settings = get_theme_mod('zerif_background_settings');
/* Default case when no setting is checked or Slider is selected */