/** * Adjust the content width. * * @since 1.0.0 */ function huesos_content_width() { global $content_width; if (in_array('layout-full', get_body_class())) { $content_width = 910; } }
function incir_body_class() { $classes = get_body_class(); if (is_front_page()) { $template = basename(get_page_template()); switch ($template) { case 'page-front-1.php': $classes[] = 'home-1'; break; case 'page-front-2.php': $classes[] = 'home-2'; break; case 'page-front-3.php': $classes[] = 'home-3'; break; case 'page.php': $classes[] = 'home-1'; break; case 'index.php': $classes[] = 'home-1'; break; } } $classes = implode(' ', $classes); return $classes; }
/** * Header data for header section * * @return array */ public static function header_data() { $header_image = get_header_image(); $page_layout_class = ' .page-layout-' . Model_Page_Layout_Settings::get_layout() . ' .page-layout-width-' . Model_Page_Layout_Settings::get_width() . ' .page-layout-sidebar-width-' . Model_Page_Layout_Settings::get_sidebar_width(); $header = array('allowedtags' => $GLOBALS['allowedtags'], 'language_attributes' => get_language_attributes(), 'body_class' => implode(' ', get_body_class()) . $page_layout_class, 'charset' => get_bloginfo('charset'), 'ping_back_url' => get_bloginfo('pingback_url'), 'name' => get_bloginfo('name'), 'home_url' => esc_url(home_url('/')), 'description' => get_bloginfo('description'), 'favicon' => General_Site_Settings_Model::get_favicon(), 'touch_icon' => General_Site_Settings_Model::get_touch_icon(), 'custom_styles' => '', 'is_enabled_preloader' => Model_Logo_And_Favicon::is_enable_page_preloader(), 'logo' => General_Site_Settings_Model::get_logo(), 'socials' => View::make('blocks/socials', array('socials' => Social_Settings_Model::get_all_socials(), 'where' => 'header')), 'socials_show_header' => Social_Settings_Model::is_show_header(), 'disclimer' => Header_Settings_Model::get_disclimer(), 'search_box' => Header_Settings_Model::get_search_box(), 'header_style_layout' => Header_Settings_Model::get_header_style(), 'header_layout_view' => sprintf('header-%s', Header_Settings_Model::get_header_style()), 'header_image' => $header_image, 'header_slogan' => get_option('photolab_header_slogan'), 'header_class' => Header_Settings_Model::get_header_class(), 'static_class' => empty($header_image) ? 'static' : 'absolute', 'term_description' => term_description(), 'welcome_message' => get_option('photolab'), 'main_menu' => wp_nav_menu(array('theme_location' => 'main', 'container' => 'nav', 'container_class' => 'main-navigation', 'container_id' => 'site-navigation', 'menu_class' => 'sf-menu', 'walker' => new Photolab_Walker(), 'echo' => false)), 'top_menu' => wp_nav_menu(array('theme_location' => 'top', 'container' => 'nav', 'container_class' => 'top-navigation', 'container_id' => 'site-navigation', 'menu_class' => 'sf-top-menu', 'walker' => new Photolab_Walker(), 'echo' => false))); $header['alt_mess'] = Utils::array_get($header['welcome_message'], 'welcome_title', get_bloginfo('name')); return $header; }
function cherry_under_construction_page_content() { echo '<body class="' . join(' ', get_body_class()) . '"><div id="motopress-main" class="main-holder"><!--Begin #motopress-main-->'; $files = '/plugin-under-construction-content.php'; $template_dir = file_exists(CURRENT_THEME_DIR . $files) ? CURRENT_THEME_DIR . $files : CHERRY_PLUGIN_DIR . 'includes' . $files; include_once $template_dir; echo '</body></div><html>'; exit; }
/** * @ticket 35164 * @ticket 36510 */ public function test_singular_body_classes() { $post_id = self::factory()->post->create(); $this->go_to(get_permalink($post_id)); $class = get_body_class(); $this->assertContains("single-post", $class); $this->assertContains("postid-{$post_id}", $class); $this->assertContains("single-format-standard", $class); }
/** *处理 AJAX 加载页面数据 *http://www.bgbk.org */ function Bing_ajax_load_page_data($code) { $data = array('code' => $code, 'title' => wp_title('|', false, 'right'), 'body_class' => join(' ', get_body_class($class)), 'refresh_sidebar' => false, 'mobile_menu_current' => Bing_mobile_menu_current(), 'mobile_title' => Bing_mobile_title(), 'mobile_return_show' => is_singular() && get_post_type() != 'page', 'last_change' => get_option(THEME_SLUG . '_last_change')); if ($sidebar_code = apply_filters('ajax_load_page_sidebar_code', null)) { $data['refresh_sidebar'] = true; $data['sidebar_code'] = $sidebar_code; } return wp_json_encode($data); }
public function bodyAttributes($attributes = []) { // TODO: we might need something like // class="{{body_class}}" data-template="{{ twigTemplate|default('base.twig') }}" $wp_body_class = get_body_class(); if (is_array($wp_body_class) && !empty($wp_body_class)) { $attributes['class'] = array_merge_recursive($attributes['class'], $wp_body_class); } return $this->getAttributes((array) $this->config->get('page.body'), $attributes); }
/** * fires actions bound to body class routes */ function route() { do_action("WXP.DomRoute.before"); $body_class = get_body_class(); //add 'common' to the body class array array_unshift($body_class, 'common'); //apply filters to body classes $body_class = apply_filters("WXP.DomRoute.body_classes", $body_class); //return false if no routes set if (empty($this->routes)) { return false; } foreach ($this->routes as $route_hook => $actions) { //if $action has the class key that means an action //was bound to multiple classes and wont be fired unless //all of those classes are present if (isset($actions["class"])) { $found = true; foreach ($actions["class"] as $cls) { $found = in_array($cls, $body_class); if (!$found) { break; } } //if all classes are not found skip to next route if (!$found) { continue; } //else if all classes are found set $actions with the value $actions = (array) $actions['action']; } else { if (!in_array($route_hook, $body_class)) { continue; } } //fire actions if not in $called_callbacks array foreach ($actions as $action) { if (is_string($action) && isset($this->called_callbacks[$action])) { //if value is set to true, that means the //callback has been called already //skip to next action if ($this->called_callbacks[$action] === true) { continue; } //else the callback has not been fired yet //set value to true to prevent it from being fired //again in another route $this->called_callbacks[$action] = true; } //finally fire the callback/action WXP::call_target($action, array(View::getInstance()), true); } } do_action("WXP.DomRoute.after"); }
/** * Add attributes for the body element. * * @return array * @since 1.3 */ function momtaz_atts_body($atts) { if (!isset($atts['class'])) { $atts['class'] = get_body_class(); } else { $atts['class'] = get_body_class($atts['class']); } $atts['itemscope'] = 'itemscope'; $atts['itemtype'] = 'http://schema.org/WebPage'; return $atts; }
public function bodyAttributes($attributes = []) { // TODO: we might need something like // class="{{body_class}}" data-template="{{ twigTemplate|default('base.twig') }}" $body_classes = apply_filters('gantry5_body_classes', ['site', 'outline-' . Gantry::instance()['configuration']]); is_rtl() ? $body_classes[] = 'dir-rtl' : ($body_classes[] = 'dir-ltr'); $wp_body_class = get_body_class($body_classes); if (is_array($wp_body_class) && !empty($wp_body_class)) { $attributes['class'] = array_merge_recursive($attributes['class'], $wp_body_class); } return $this->getAttributes((array) $this->config->get('page.body.attribs'), $attributes); }
public static function scroll_menu_class() { $classes = get_body_class(); $design_options = get_option('experiensa_design_settings'); $display_slider = $design_options['setting_landing_slider']; if (in_array('home', $classes) && $display_slider == 'TRUE') { return 'white-font'; } if (in_array('single-voyage', $classes)) { return 'white-font'; } return ""; }
public function test_body_class_type_click() { The_Neverending_Home_Page::$settings['type'] = 'click'; add_filter('body_class', array($this->infinite_scroll, 'body_class')); $classes = get_body_class(); $this->assertContains('infinite-scroll', $classes); $this->assertNotContains('neverending', $classes); // Disable Infinite Scroll. update_option(The_Neverending_Home_Page::$option_name_enabled, ''); $classes = get_body_class(); $this->assertContains('infinite-scroll', $classes); $this->assertNotContains('neverending', $classes); }
function bizz_html_header() { global $post; echo apply_filters('bizz_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">') . "\n"; #filter ?> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?> > <?php // HEAD echo "<head" . apply_filters('bizz_head_profile', ' profile="http://gmpg.org/xfn/11"') . ">\n"; #filter echo '<meta http-equiv="Content-Type" content="' . get_bloginfo('html_type') . '; charset=' . get_bloginfo('charset') . '" />' . "\n"; #wp if (!is_admin()) { if (is_singular() && comments_open() && get_option('thread_comments') == 1) { wp_enqueue_script('comment-reply'); } } #wp do_action('bizz_head_before'); #hook do_action('bizz_head_title'); #hook do_action('bizz_head_meta'); #hook do_action('bizz_head_stylesheets'); #hook do_action('bizz_head_links'); #hook do_action('bizz_head_scripts'); #hook wp_head(); #wp #hook do_action('bizz_head_after'); #hook echo '<link rel="pingback" href="' . get_bloginfo('pingback_url') . '" />' . "\n"; #wp echo "</head>\n"; #END <head> tag // BODY echo "<body " . apply_filters('bizz_body_class', 'class="' . implode(' ', get_body_class()) . '"') . ">\n"; #filter do_action('bizz_body_after'); #hook do_action('bizz_head_grid'); #hook }
function devio_bodyclass() { switch (true) { case is_front_page(): case is_home(): $level[0] = 'home'; break; case is_singular(): $level[0] = 'singular'; break; default: $level = get_body_class(); break; } return array($level[0]); }
public function category_description_filter($description, $categoryId = null) { $classes = get_body_class(); if (!in_array('date', $classes) && !in_array('post-type-archive', $classes)) { $categoryId; //play nice with All_in_One_SEO_Pack as we cannot use ob_start because of it if ($this->_goodNeighbour->isCallFrom_All_in_One_SEO_Pack()) { return $description; } ob_start(); include pathinfo($this->_plugin_file_path, PATHINFO_DIRNAME) . "/views/ecp_category_description.php"; $description = ob_get_clean(); return $description; } return false; }
/** * @ticket 30883 */ public function test_with_utf8_term_slugs() { register_taxonomy('wptests_tax', 'post'); $term_id1 = $this->factory->term->create(array('taxonomy' => 'wptests_tax', 'name' => 'Первая метка')); $term_id2 = $this->factory->term->create(array('taxonomy' => 'wptests_tax', 'name' => 'Вторая метка')); $term_id3 = $this->factory->term->create(array('taxonomy' => 'wptests_tax', 'name' => '25кадр')); wp_set_post_terms($this->post_id, array($term_id1, $term_id2, $term_id3), 'wptests_tax'); $term1 = get_term($term_id1, 'wptests_tax'); $term2 = get_term($term_id2, 'wptests_tax'); $term3 = get_term($term_id3, 'wptests_tax'); $this->go_to(home_url("?wptests_tax={$term1->slug}")); $this->assertContains("term-{$term_id1}", get_body_class()); $this->go_to(home_url("?wptests_tax={$term2->slug}")); $this->assertContains("term-{$term_id2}", get_body_class()); $this->go_to(home_url("?wptests_tax={$term3->slug}")); $this->assertContains("term-{$term_id3}", get_body_class()); }
function cgp_genesis_header() { do_action('genesis_doctype'); do_action('genesis_title'); do_action('genesis_meta'); wp_head(); //* we need this for plugins ?> </head> <?php genesis_markup(array('html5' => '<body %s>', 'xhtml' => sprintf('<body class="%s">', implode(' ', get_body_class())), 'context' => 'body')); do_action('genesis_before'); genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="wrap">', 'context' => 'site-container')); do_action('genesis_before_header'); do_action('genesis_header'); do_action('genesis_after_header'); genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="inner">', 'context' => 'content-wrapper')); genesis_structural_wrap('content-wrapper'); }
/** * Return the array containing arguments to generate the "Add to cart" form. * * The returned array can then be used with {@link wpsc_get_form_output()} to * generate the HTML output. * * @since 0.1 * @uses apply_filters() Applies 'wpsc_add_to_cart_button_icon' filter. Set the value to an empty value to disable the icon * @uses apply_filters() Applies 'wpsc_add_to_cart_button_title' filter. The return value must be escaped already. * @uses apply_filters() Applies 'wpsc_get_add_to_cart_form_args' filter. Use this filter to add more fields * @uses wpsc_get_product_id() Get current product ID in the loop * @uses wpsc_get_cart_url() Get cart URL for the form action * @uses WPSC_Product::get_instance() get the WPSC_Product object to fetch variation sets and terms * * @param int $id Optional. Product ID. Defaults to the current product in the loop. * @return array Form argument array */ function wpsc_get_add_to_cart_form_args($id = null) { if (!$id) { $id = wpsc_get_product_id(); } $product = WPSC_Product::get_instance($id); $has_variations = $product->has_variations; $classes = get_body_class(); $select_options = $has_variations != false && in_array('wpsc-grid', $classes); $args = array('class' => 'wpsc-form wpsc-form-horizontal wpsc-add-to-cart-form', 'action' => $select_options ? get_permalink($id) : wpsc_get_cart_url("add/{$id}"), 'id' => "wpsc-add-to-cart-form-{$id}", 'fields' => array(array('name' => 'quantity', 'type' => 'textfield', 'title' => __('Quantity', 'wp-e-commerce'), 'value' => 1))); // generate the variation dropdown menus foreach ($product->variation_sets as $variation_set_id => $title) { $variation_terms = $product->variation_terms[$variation_set_id]; $args['fields'][] = array('name' => "wpsc_product_variations[{$variation_set_id}]", 'type' => 'select', 'options' => $variation_terms, 'title' => $title); } // form action section contains the button and hidden values $args['form_actions'] = array(array('type' => 'button', 'primary' => true, 'button_class' => $select_options ? 'wpsc-select-options' : 'wpsc-add-to-cart', 'icon' => apply_filters('wpsc_add_to_cart_button_icon', array($select_options ? '' : 'shopping-cart', 'white')), 'title' => apply_filters('wpsc_add_to_cart_button_title', $select_options ? __('Select Options', 'wp-e-commerce') : __('Add to Cart', 'wp-e-commerce'), $select_options)), array('type' => 'hidden', 'name' => '_wp_http_referer', 'value' => home_url($_SERVER['REQUEST_URI'])), array('type' => 'hidden', 'name' => '_wp_nonce', 'value' => wp_create_nonce("wpsc-add-to-cart-{$id}"))); $args = apply_filters('wpsc_get_add_to_cart_form_args', $args); return $args; }
function nm_is_woocommerce_page() { // Alt. methhod: /*if ( is_woocommerce() ) { return true; } $page_id = get_the_ID(); $woocommerce_keys = array ( 'woocommerce_shop_page_id', 'woocommerce_terms_page_id', 'woocommerce_cart_page_id', 'woocommerce_checkout_page_id', 'woocommerce_pay_page_id', 'woocommerce_thanks_page_id', 'woocommerce_myaccount_page_id', 'woocommerce_edit_address_page_id', 'woocommerce_view_order_page_id', 'woocommerce_change_password_page_id', 'woocommerce_logout_page_id', 'woocommerce_lost_password_page_id' ) ; foreach( $woocommerce_keys as $woocommerce_page_id ) { if ( $page_id == get_option( $woocommerce_page_id, 0 ) ) { return true; } }*/ // Get the current body class $body_classes = get_body_class(); foreach ($body_classes as $body_class) { // Check if the class contains the word "woocommrce" if (strpos($body_class, 'woocommerce') !== false) { return true; } } return false; }
<?php /** * qode_ajax_meta hook * * @hooked qode_ajax_meta - 10 */ do_action('qode_ajax_meta'); ?> <span id="qode_page_id"><?php echo $wp_query->get_queried_object_id(); ?> </span> <div class="body_classes"><?php echo implode(',', get_body_class()); ?> </div> </div> <?php } ?> <div class="content_inner <?php echo $animation; ?> "> <?php if ($qode_options_proya['page_transitions'] == "1" || $qode_options_proya['page_transitions'] == "2" || $qode_options_proya['page_transitions'] == "3" || $qode_options_proya['page_transitions'] == "4" || $animation == "updown" || $animation == "fade" || $animation == "updown_fade" || $animation == "leftright") { ?> <?php do_action('qode_visual_composer_custom_shortcodce_css');
public function body_class($class = "") { echo 'class="' . apply_filters("pe_theme_body_class", join(' ', get_body_class($class))) . '"'; }
<?php } ?> </div> </div> <!-- .top-nav-menu --> </div> </div> </div> <!-- #skehead --> </div> <!-- glow --> </div> <div class="header-clone"></div> </div> <!-- #header --> <div class="head-slide-wrap clearfix"> <!-- header image section --> <?php $classes = get_body_class(); ?> <?php if (in_array('front-page', $classes)) { include "includes/front-bgimage-section.php"; } ?> </div> <div id="main" class="clearfix">
/** * <body> element attributes. * * @since 2.0.0 * @access public * @param array $attr * @return array */ function hybrid_attr_body($attr) { $attr['class'] = join(' ', get_body_class()); $attr['dir'] = is_rtl() ? 'rtl' : 'ltr'; $attr['itemscope'] = 'itemscope'; $attr['itemtype'] = 'http://schema.org/WebPage'; return $attr; }
?> <link rel='stylesheet' href='http://www.begara.com.br/begara.css' type='text/css' media='all' /> <?php } ?> <style> .menu{ margin-right: 10px !important; top: -5px !important; } </style> </head> <body class="<?php echo join(' ', get_body_class()) . ' ' . join(' ', array($bodyClasses, 'ait-rounder')); ?> <?php if ($themeOptions->general->enableCSSFeatures->enable === 'enable') { ?> css-features<?php } ?> " data-themeurl="<?php echo htmlSpecialChars($themeUrl); ?> "> <script> document.body.className+=' js' </script> <div class="mainpage">
/** * <body> element attributes. * * @since 1.0.0 * @access public * @param array $attr Existing attributes. * @return array */ function carelib_attr_body($attr) { $attr['class'] = join(' ', get_body_class()); $attr['dir'] = is_rtl() ? 'rtl' : 'ltr'; return $attr; }
<?php /* Template Name: lvk-winkel */ get_header(); print '<div class="grid-100">'; print '<div class="marge">'; print '<div class="container winkel">'; print '<div class="item-inhoud clearfix">'; if (have_posts()) { $bc = get_body_class(); while (have_posts()) { the_post(); $titel = get_the_title(); print '<h1 class="paginatitel">' . $titel . '</h1>'; the_content(); } } print '</div>'; print '</div>'; print '</div>'; print '</div>'; get_footer();
/** * Display the classes for the body element. * * @since 2.8.0 * * @param string|array $class One or more classes to add to the class list. */ function body_class($class = '') { // Separates classes with a single space, collates classes for body element echo 'class="' . join(' ', get_body_class($class)) . '"'; }
/** * <body> element attributes. * * @since 2.0.0 * @access public * @param array $attr * @return array */ function hybrid_attr_body($attr) { $attr['class'] = join(' ', get_body_class()); $attr['dir'] = is_rtl() ? 'rtl' : 'ltr'; $attr['itemscope'] = 'itemscope'; $attr['itemtype'] = 'http://schema.org/WebPage'; if (is_singular('post') || is_home() || is_archive()) { $attr['itemtype'] = 'http://schema.org/Blog'; } elseif (is_search()) { $attr['itemtype'] = 'http://schema.org/SearchResultsPage'; } return $attr; }
function sf_remove_woo_scripts_alt() { global $post; if (!sf_theme_supports('swift-smartscript') || is_admin()) { return; } // Page Content Meta $page_has_products = false; if ($post) { $page_has_products = sf_get_post_meta($post->ID, 'sf_page_has_products', true); } if (is_active_widget(false, false, 'woocommerce_top_rated_products', true) || is_active_widget(false, false, 'woocommerce_recently_viewed_products', true) || is_active_widget(false, false, 'woocommerce_recent_reviews', true) || is_active_widget(false, false, 'woocommerce_products', true) || is_active_widget(false, false, 'woocommerce_product_categories', true) || is_active_widget(false, false, 'woocommerce_widget_cart', true)) { $page_has_products = true; } // Check page for WoooCommerce content $body_class = get_body_class(); if (!in_array('woocommerce', $body_class) && !in_array('woocommerce-cart', $body_class) && !in_array('woocommerce-checkout', $body_class) && !$page_has_products) { // WooCommerce Styles add_filter('woocommerce_enqueue_styles', 'sf_remove_woocommerce_styles'); } }
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <title>Visual Editor: Loading</title> <?php do_action('headway_visual_editor_head'); ?> </head><!-- /head --> <!-- This background color has been inlined to reduce the white flicker during loading. --> <body class="visual-editor-open visual-editor-mode-<?php echo HeadwayVisualEditor::get_current_mode(); ?> <?php echo join(' ', get_body_class()); ?> " style="background: #1c1c1c;"> <?php do_action('headway_visual_editor_body_open'); ?> <div id="ve-loading-overlay"> <div class="cog-container"><div class="cog-bottom-left"></div><div class="cog-top-right"></div></div> </div><!-- #ve-loading-overlay --> <div id="menu"> <span id="logo"></span> <ul id="modes">