本文整理汇总了PHP中body_class函数的典型用法代码示例。如果您正苦于以下问题:PHP body_class函数的具体用法?PHP body_class怎么用?PHP body_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了body_class函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: p2_body_class
function p2_body_class()
{
if (is_taxonomy('mentions')) {
return body_class('mentions');
}
return body_class();
}
开发者ID:alx,项目名称:pressmark,代码行数:7,代码来源:template-tags.php
示例2: q21_body_tag
function q21_body_tag()
{
?>
<body <?php
body_class('sexy q21');
?>
>
<?php
}
开发者ID:rfair404,项目名称:q21-theme,代码行数:9,代码来源:q21-markup.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
}
开发者ID:aryanthemes,项目名称:Clink,代码行数:58,代码来源:clink-template.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";
}
}
开发者ID:rowatt,项目名称:Thematic,代码行数:14,代码来源:dynamic-classes.php
示例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
}
开发者ID:voomco,项目名称:WordPress,代码行数:54,代码来源:functions.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";
}
}
开发者ID:sams,项目名称:Thematic-html5boilerplate,代码行数:17,代码来源:dynamic-classes.php
示例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);
})];
}
开发者ID:themosis,项目名称:framework,代码行数:48,代码来源:ThemosisTwigExtension.php
示例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
}
开发者ID:nodejs-es,项目名称:nodejs-es-media,代码行数:28,代码来源:header-actions.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';
?>
开发者ID:nullality,项目名称:FEWD-SEA-7,代码行数:31,代码来源:header.php
示例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'] != '') {
?>
开发者ID:roadthemez,项目名称:allen,代码行数:31,代码来源:demo8.php
示例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;"';
开发者ID:smark73,项目名称:979theeagle,代码行数:31,代码来源:base.php
示例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');
?>
开发者ID:fjbeteiligung,项目名称:development,代码行数:31,代码来源:header.php
示例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')
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:31,代码来源:header.php
示例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');
?>
开发者ID:gloomyghost,项目名称:Tip-Top-Art,代码行数:31,代码来源:header.php
示例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 */
开发者ID:9Pixels,项目名称:minimalzerif,代码行数:31,代码来源:header.php
示例16: wp_title
wp_title('|', true, 'right');
?>
</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php
bloginfo('pingback_url');
?>
" />
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<?php
wp_head();
?>
</head>
<body <?php
body_class('basic');
?>
>
<div id="page">
<!-- <header class="navbar-inverse navbar navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a id="site-title" class="navbar-brand" href="<?php
echo esc_url(home_url());
开发者ID:Trying-On-The-Trades,项目名称:panomanager,代码行数:31,代码来源:header.php
示例17: if
<!-- Mobile Specific Metas & Favicons
========================================================= -->
<?php if($smof_data['rnr_favicon_url'] != "") { ?><link rel="shortcut icon" href="<?php echo $smof_data['rnr_favicon_url']; ?>"><?php } ?>
<!-- WordPress Stuff
========================================================= -->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!-- Google Web Fonts -->
<?php get_template_part( 'includes/googlefonts'); ?>
<?php wp_head(); ?>
</head>
<body <?php body_class('onepage'); ?> data-spy="scroll" data-target=".navigation" data-offset="82">
<div id="load"></div>
<!-- START PAGE WRAP -->
<div class="page-wrap <?php if($smof_data['rnr_enable_dark_skin'] == true) { echo 'dark-skin'; } ?>">
<!-- HEADER SECTION -->
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:26,代码来源:header.php
示例18: bf_body_class
/**
* bf_body_class() - Semantic Body Class Function
*
* Checks for body_class() function (WordPress 2.8) before running its own.
* Prints out body semantic class for easy customization using CSS. Based on Sandbox theme.
*
* You can override this using the <b>body_class</b> filter.
*
* @hook filter bf_body_class
* @since 0.5.2
* @uses bf_date_classes()
*/
function bf_body_class()
{
if (function_exists('body_class')) {
return body_class();
}
global $wp_query, $current_user;
// It's surely a WordPress blog, right?
$c = array('wordpress');
// Applies the time- and date-based classes (below) to BODY element
bf_date_classes(time(), $c);
// Generic semantic classes for what type of content is displayed
is_front_page() ? $c[] = 'home' : null;
// For the front page, if set
is_home() ? $c[] = 'blog' : null;
// For the blog posts page, if set
is_archive() ? $c[] = 'archive' : null;
is_date() ? $c[] = 'date' : null;
is_search() ? $c[] = 'search' : null;
is_paged() ? $c[] = 'paged' : null;
is_attachment() ? $c[] = 'attachment' : null;
is_404() ? $c[] = 'four04' : null;
// CSS does not allow a digit as first character
// Special classes for BODY element when a single post
if (is_single()) {
$postID = $wp_query->post->ID;
the_post();
// Adds 'single' class and class with the post ID
$c[] = 'single postid-' . $postID;
// Adds classes for the month, day, and hour when the post was published
if (isset($wp_query->post->post_date)) {
bf_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-');
}
// Adds category classes for each category on single posts
if ($cats = get_the_category()) {
foreach ($cats as $cat) {
$c[] = 's-category-' . $cat->slug;
}
}
// Adds tag classes for each tags on single posts
if ($tags = get_the_tags()) {
foreach ($tags as $tag) {
$c[] = 's-tag-' . $tag->slug;
}
}
// Adds MIME-specific classes for attachments
if (is_attachment()) {
$mime_type = get_post_mime_type();
$mime_prefix = array('application/', 'image/', 'text/', 'audio/', 'video/', 'music/');
$c[] = 'attachmentid-' . $postID . ' attachment-' . str_replace($mime_prefix, "", "{$mime_type}");
}
// Adds author class for the post author
$c[] = 's-author-' . sanitize_title_with_dashes(strtolower(get_the_author_login()));
rewind_posts();
} elseif (is_author()) {
$author = $wp_query->get_queried_object();
$c[] = 'author';
$c[] = 'author-' . $author->user_nicename;
} elseif (is_category()) {
$cat = $wp_query->get_queried_object();
$c[] = 'category';
$c[] = 'category-' . $cat->slug;
} elseif (is_tag()) {
$tags = $wp_query->get_queried_object();
$c[] = 'tag';
$c[] = 'tag-' . $tags->slug;
} elseif (is_page()) {
$pageID = $wp_query->post->ID;
$page_children = wp_list_pages("child_of={$pageID}&echo=0");
the_post();
$c[] = 'page pageid-' . $pageID;
$c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login')));
// Checks to see if the page has children and/or is a child page; props to Adam
if ($page_children) {
$c[] = 'page-parent';
}
if ($wp_query->post->post_parent) {
$c[] = 'page-child parent-pageid-' . $wp_query->post->post_parent;
}
if (is_page_template()) {
// Hat tip to Ian, themeshaper.com
$c[] = 'page-template page-template-' . str_replace('.php', '-php', get_post_meta($pageID, '_wp_page_template', true));
}
rewind_posts();
} elseif (is_search()) {
the_post();
if (have_posts()) {
$c[] = 'search-results';
} else {
//.........这里部分代码省略.........
开发者ID:jagtesh,项目名称:op_theme,代码行数:101,代码来源:template.php
示例19: bloginfo
<head>
<meta charset="<?php
bloginfo('charset');
?>
">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0">
<?php
wp_head();
?>
</head>
<?php
$body_extra_class = array();
if (ffThemeOptions::getQuery('layout boxed-layout')) {
$body_extra_class[] = "boxed";
}
?>
<body <?php
body_class($body_extra_class);
?>
>
<?php
$body_extra_class = array();
if (ffThemeOptions::getQuery('layout boxed-layout')) {
ff_load_section_printer('section-background', ffThemeOptions::getQuery('layout background'));
}
?>
<div id="page-wrapper">
<?php
ffContainer()->getThemeFrameworkFactory()->getLayoutsNamespaceFactory()->getLayoutPrinter()->printLayoutHeader()->printLayoutBeforeContent();
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:31,代码来源:header.php
示例20: wp_enqueue_script
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<?php
if (is_singular()) {
wp_enqueue_script('comment-reply');
}
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<?php
wp_head();
?>
</head>
<body <?php
body_class($class);
?>
>
<?php
wp_nav_menu(array('theme_location' => 'header-menu', 'container' => false, 'menu_class' => 'nav', 'echo' => true, 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 0, 'walker' => new description_walker()));
?>
<!-- WordPress Menu Structure -->
开发者ID:surdaft,项目名称:Base,代码行数:29,代码来源:header.php
注:本文中的body_class函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论