本文整理汇总了PHP中YIT_Layout函数的典型用法代码示例。如果您正苦于以下问题:PHP YIT_Layout函数的具体用法?PHP YIT_Layout怎么用?PHP YIT_Layout使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了YIT_Layout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_box
public function get_box()
{
$recent_posts = $this->_get_content();
$tabs = array();
if (!empty($recent_posts)) {
$tabs['view-all'] = array('title' => __('View all', 'yit'), 'content' => $recent_posts);
}
$data = array('model' => 'static', 'type' => 'static', 'tabs' => $tabs, 'label' => $this->name, 'label_all' => sprintf(__('All %s', 'yit'), $this->name));
yit_plugin_get_template(YIT_Layout()->plugin_path, 'admin/accordion-item.php', $data);
}
示例2: yit_revslider_slider
function yit_revslider_slider()
{
if ( ! class_exists('RevOperations') ) {
return;
}
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");
$isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ( YIT_Layout()->slider_name===false
|| (YIT_Layout()->slider_name != 'none' && YIT_Slider::get_slider( YIT_Layout()->slider_name )->config->layout != 'revolution-slider')
|| $includesGlobally == "on"
|| $isWidgetActive
|| $hasShortcode ) {
return;
}
if ( defined( 'RS_PLUGIN_URL' ) ) {
wp_enqueue_style( 'rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION );
}
else {
wp_enqueue_style( "rs-plugin-settings", UniteBaseClassRev::$url_plugin . "rs-plugin/css/settings.css", array(), GlobalsRevSlider::SLIDER_REVISION );
}
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = (is_ssl()) ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
wp_enqueue_script("jquery", $url_jquery);
// put javascript to footer
add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
示例3: array
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
$woocommerce_loop['li_class'] = array();
//standard li class
$woocommerce_loop['li_class'][] = 'product-category product';
if (YIT_Layout()->sidebars['layout'] == 'sidebar-double') {
$woocommerce_loop['li_class'][] = 'col-sm-6';
$woocommerce_loop['columns'] = '2';
} elseif (YIT_Layout()->sidebars['layout'] == 'sidebar-right' || YIT_Layout()->sidebars['layout'] == 'sidebar-left') {
$woocommerce_loop['li_class'][] = 'col-sm-4';
$woocommerce_loop['columns'] = '3';
} else {
$woocommerce_loop['li_class'][] = 'col-sm-3';
$woocommerce_loop['columns'] = '4';
}
// Increase loop count
$woocommerce_loop['loop']++;
// add class first/last
if (($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] == 0 || $woocommerce_loop['columns'] == 1) {
$woocommerce_loop['li_class'][] = 'first';
}
if ($woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0) {
$woocommerce_loop['li_class'][] = 'last';
}
示例4: yit_getimagesize
$image_size = yit_getimagesize( $image_upload );
$image_id = yit_get_attachment_id( $image_upload );
list( $thumb_url, $image_width, $image_height ) = wp_get_attachment_image_src( $image_id );
//check if parallax effects is enabled
$parallax = YIT_Layout()->parallax;
if ( $parallax == 'yes' ):
$height = YIT_Layout()->parallax_height;
$color = YIT_Layout()->parallax_text_color;
$hover_color = YIT_Layout()->parallax_link_color;
$valign = YIT_Layout()->parallax_vertical_align;
$halign = YIT_Layout()->parallax_horizontal_align;
$effect = YIT_Layout()->parallax_effect;
$content = YIT_Layout()->parallax_content;
$overlay_opacity = YIT_Layout()->parallax_overlay_opacity;
$parallax = "[parallax ";
$parallax .= " image='{$image_upload}' ";
if( $height ) $parallax .= " height='{$height}' ";
if( $color ) $parallax .= " color='{$color}' ";
if( $hover_color ) $parallax .= " hover_color='{$hover_color}' ";
if( $overlay_opacity ) $parallax .= " overlay_opacity='{$overlay_opacity}' ";
if( $valign ) $parallax .= " valign='{$valign}' ";
if( $halign ) $parallax .= " halign='{$halign}' ";
if( $effect ) $parallax .= " effect='{$effect}' ";
$parallax .= "]";
if( $content ) $parallax .= $content;
示例5: yit_content_width
/**
* Adjust content_width value for image attachment template.
*
* @since Twenty Fourteen 1.0
*
* @return void
*/
function yit_content_width()
{
$full_width = $GLOBALS['content_width'];
$sidebar_width = $full_width * (25 / 100);
// 25% (col-3)
$sidebar = YIT_Layout()->sidebars;
$sidebar = is_array($sidebar) ? $sidebar : array('layout' => $sidebar);
if ('sidebar-double' == $sidebar['layout']) {
$GLOBALS['content_width'] -= $sidebar_width * 2;
} elseif ('sidebar-no' != $sidebar['layout']) {
$GLOBALS['content_width'] -= $sidebar_width;
}
$GLOBALS['content_width'] -= 30;
}
示例6: get_og_description
/**
* Get OG Description
*
* Return Open Graph Description
*
*
* @return void
* @since 1.0.0
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
*/
public function get_og_description($description)
{
$og_desc = YIT_Layout()->seo_description;
if (empty($og_desc)) {
return $description;
} else {
return $og_desc;
}
}
示例7: YIT_Layout
/*
* This file belongs to the YIT Framework.
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
$show_slogan = YIT_Layout()->show_slogan;
$slogan = YIT_Layout()->slogan;
$subslogan = YIT_Layout()->sub_slogan;
if (empty($show_slogan) || $show_slogan == 'no') {
if (function_exists('WC') && (is_cart() && sizeof(WC()->cart->get_cart()) != 0 || is_checkout() || is_order_received_page())) {
$slogan_class = 'yith-checkout-single';
$show_slogan = 'yes';
ob_start();
?>
<span <?php
if (is_cart()) {
?>
class="current"<?php
}
?>
><?php
_e('Shopping Bag ', 'yit');
?>
示例8: yit_page_meta
function yit_page_meta()
{
if (function_exists('YIT_Layout') && YIT_Layout()->show_title == '1') {
echo '<h1>' . get_the_title() . '</h1>';
}
if (function_exists('YIT_Layout') && YIT_Layout()->show_breadcrumb == '1') {
?>
<div class="breadcrumbs">
<?php
yit_breadcrumb(apply_filters('yit_breadcrumb_delimiter', ' / '));
?>
</div>
<?php
}
}
示例9:
<?php
/**
* Content Wrappers
*/
if (is_product()) {
return;
}
?>
<!-- PAGE META -->
<div id="page-meta">
<?php
if (!is_product_category() && (yit_get_option('shop-show-page-title') == 'yes' || YIT_Layout()->show_title == 1) || is_product_category() && (yit_get_option('shop-category-show-page-title') == 'yes' || YIT_Layout()->show_title == 1)) {
?>
<h1 class="page-title"><?php
woocommerce_page_title();
?>
</h1>
<?php
}
?>
<div class="page-meta-wrapper border-2 clearfix">
<?php
do_action('shop-page-meta');
?>
</div>
</div>
<!-- END PAGE META -->
示例10: yit_get_option
/*
* This file belongs to the YIT Framework.
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$sticky = ( yit_get_option('header-sticky') == 'yes' ) ? ' sticky-header' : '';
$skin = yit_get_option('header-skin');
$slider = YIT_Layout()->slider_name;
$layout = ! in_array( $slider, array( false, '', 'none' ) ) && function_exists( 'YIT_Slider' ) ? YIT_Slider::get_slider( YIT_Layout()->slider_name )->config->layout : '';
// remove transparent skin if is not applicable
if ( 'transparent' == $skin && ! in_array( $layout, array( 'parallax', 'revolution-slider' ) ) && 'yes' != YIT_Layout()->static_image && 'yes' != YIT_Layout()->parallax && '' == get_header_image() ) {
$skin = 'skin1';
}
if ( 'transparent' == $skin ) {
$skin .= ' skin1';
if ( 'yes' == YIT_Layout()->enable_dark_header ) {
$skin .= ' dark';
}
}
?>
<!-- START HEADER -->
<div id="header" class="clearfix <?php echo $skin . $sticky ?><?php if ( 'yes' != yit_get_option('show-dropdown-indicators') ) echo ' no-indicators' ?>">
示例11: yit_image_content_single_width
/**
* Set image and content width for single product image
*
* @return array
* @since 1.0.0
* @author Francesco Licando <francesco.licandro@yithemes.it>
*/
function yit_image_content_single_width() {
$size = array();
if ( ( yit_get_option( 'general-layout-type' ) == 'fluid' && ! wp_is_mobile() ) || is_quick_view() ) return $size;
$img_size = yit_shop_single_w();
$sidebar = YIT_Layout()->sidebars;
if ( intval( $img_size ) < $GLOBALS['content_width'] ) {
$size['image'] = ( intval( $img_size ) * 100 ) / $GLOBALS['content_width'];
if ( $sidebar['layout'] != 'sidebar-no' && ! wp_is_mobile() ) $size['image'] -= 20;
}
else {
$size['image'] = 100;
}
$size['content'] = 100 - ( $size['image'] );
$min_size = ( wp_is_mobile() ) ? '40' : '20';
if ( $size['content'] < $min_size ) {
$size['content'] = 100;
}
return $size;
}
示例12: elseif
$content_cols = 12;
$content_order = '';
if ( $sidebar['layout'] == 'sidebar-left' ) {
$content_cols -= 3;
$content_order = ' col-sm-push-3';
}
elseif ( $sidebar['layout'] == 'sidebar-right' ) {
$content_cols -= 3;
}
elseif ( $sidebar['layout'] == 'sidebar-double' && $sidebar['sidebar-left'] != '-1' ) {
$content_cols -= 6;
$content_order = ' col-sm-push-3';
}
?>
<!-- START CONTENT -->
<div class="content col-sm-<?php echo $content_cols ?><?php echo $content_order ?> clearfix" role="main">
<?php
if ( YIT_Layout()->show_breadcrumb == 1 ){
do_action( 'yit_single_page_breadcrumb' );
}
?>
<?php
break;
}
示例13: yit_image_content_single_width
/**
* Set image and content width for single product image
*
* @return array
* @since 1.0.0
* @author Francesco Licando <francesco.licandro@yithemes.it>
*/
function yit_image_content_single_width()
{
$size = array();
if (is_quick_view()) {
return $size;
}
$img_size = yit_shop_single_w();
$sidebar = YIT_Layout()->sidebars;
if (intval($img_size) < $GLOBALS['content_width']) {
$size['image'] = intval($img_size) * 100 / $GLOBALS['content_width'];
if ($sidebar['layout'] != 'sidebar-no' && !wp_is_mobile()) {
$size['image'] -= 20;
}
} else {
$size['image'] = 100;
}
$size['content'] = 100 - $size['image'];
$min_size = wp_is_mobile() ? '40' : '20';
if ($size['content'] < $min_size) {
$size['content'] = 100;
}
return $size;
}
示例14: activate
*
* Run when the plugin is activated, add a custom options in database
*
* @return void
* @since 1.0
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
*/
public function activate()
{
YIT_Layout_Options()->add_default_options();
}
}
/**
* Main instance of plugin
*
* @return object
* @since 1.0
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
*/
function YIT_Layout()
{
return YIT_Layout::instance();
}
/**
* Instantiate Sidebar class
*
* @since 1.0
* @author Emanuela Castorina <emanuela.castorina@yithemes.it>
*/
YIT_Layout();
示例15: YIT_Layout
$slogan_class = 'yit-my-account-slogan';
$show_slogan = YIT_Layout()->myaccount_show_slogan;
$slogan = is_user_logged_in() ? YIT_Layout()->myaccount_welcome_text : YIT_Layout()->myaccount_login_text;
$show_user_name = YIT_Layout()->myaccount_show_user_name;
if ('yes' == $show_user_name && is_user_logged_in()) {
$current_user = get_user_by('id', get_current_user_id());
$slogan .= '[' . $current_user->display_name . ']';
}
}
}
if (empty($show_slogan) || $show_slogan == 'no') {
return;
}
// main text tag
$tag = 'h2';
if ('0' == YIT_Layout()->show_title) {
$tag = 'h1';
}
if (!empty($slogan)) {
$slogan = sprintf('<%s><span>%s</span></%s>', $tag, str_replace(array('[', ']'), array('</span><span class="title-highlight">', '</span><span>'), $slogan), $tag);
$slogan = str_replace('<span></span>', '', $slogan);
}
?>
<!-- START SLOGAN -->
<div id="slogan" <?php
if (isset($slogan_class)) {
echo 'class="' . $slogan_class . '"';
}
?>
>