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);
 }
Beispiel #2
0
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'));
}
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';
}
Beispiel #4
0
    $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;
/**
 * 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;
}
Beispiel #6
0
 /**
  * Get OG Description
  *
  * Return Open Graph Description
  *
  *
  * @return void
  * @since  1.0.0
  * @author Emanuela Castorina <*****@*****.**>
  */
 public function get_og_description($description)
 {
     $og_desc = YIT_Layout()->seo_description;
     if (empty($og_desc)) {
         return $description;
     } else {
         return $og_desc;
     }
 }
Beispiel #7
0
/*
 * 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');
        ?>
Beispiel #8
0
 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 
     }
 }
<?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 -->
Beispiel #10
0
/*
 * 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' ?>">
Beispiel #11
0
    /**
     * Set image and content width for single product image
     *
     * @return array
     * @since 1.0.0
     * @author Francesco Licando <*****@*****.**>
     */
    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;

    }
Beispiel #12
0
        $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;
}
 /**
  * Set image and content width for single product image
  *
  * @return array
  * @since 1.0.0
  * @author Francesco Licando <*****@*****.**>
  */
 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;
 }
Beispiel #14
0
     *
     * Run when the plugin is activated, add a custom options in database
     *
     * @return void
     * @since    1.0
     * @author   Emanuela Castorina <*****@*****.**>
     */
    public function activate()
    {
        YIT_Layout_Options()->add_default_options();
    }
}
/**
 * Main instance of plugin
 *
 * @return object
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
function YIT_Layout()
{
    return YIT_Layout::instance();
}
/**
 * Instantiate Sidebar class
 *
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
YIT_Layout();
Beispiel #15
0
        $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 . '"';
}
?>
 >
Beispiel #16
0
<?php

/*
 * 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
 */
/**
 * Markup of frontend
 *
 * @use $portfolio \YIT_Portfolio_Object The object of portfolio
 */
$layout_sidebar = YIT_Layout()->sidebars['layout'];
$thumbs = '';
?>

<div class="portfolio-<?php 
echo esc_attr($layout);
?>
">

    <?php 
if ($portfolio->get('config-activate_filters')) {
    ?>
        <?php 
    yit_get_template('portfolios/common/filters.php', array('portfolio' => $portfolio));
    ?>
    <?php 
Beispiel #17
0
 * Your Inspiration Themes
 *
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <*****@*****.**>
 *
 * 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
 */
global $post;
if (!is_page() || !isset($post->ID)) {
    return;
}
$map_url = yit_get_post_meta(get_the_ID(), '_url') != '' ? yit_get_post_meta(get_the_ID(), '_url') : YIT_Layout()->gmap_url;
//$map_url = yit_get_post_meta( get_the_ID(), '_url' );
if (empty($map_url)) {
    return;
}
$is_gmap = false;
if (preg_match('#(www|maps)\\.google\\.([a-z]{2,4}(\\.([a-z]{2,4}))?)/(maps|\\?)#', $map_url)) {
    $is_gmap = true;
}
if (!$is_gmap) {
    $image_id = yit_get_attachment_id($map_url);
    if ($image_id != 0) {
        list($image_url, $image_width, $image_height) = wp_get_attachment_image_src($image_id, 'map_image');
        if (empty($width)) {
            $width = $image_width;
        }
$woocommerce_loop['loop']++;
// Extra post classes
$woocommerce_loop['li_class'] = array();
// view
if (!(isset($woocommerce_loop['view']) && !empty($woocommerce_loop['view'])) && yit_get_option('shop-enable-masonry') == 'no') {
    $woocommerce_loop['view'] = yit_get_option('shop-view-type', 'grid');
} elseif (yit_get_option('shop-enable-masonry') == 'yes') {
    $woocommerce_loop['view'] = 'masonry_item';
}
$woocommerce_loop['li_class'][] = $woocommerce_loop['view'];
// Set column
if ((is_shop() || is_product_category()) && yit_get_option('shop-enable-masonry') == 'no') {
    $woocommerce_loop['li_class'][] = 'col-sm-' . intval(12 / intval(yit_get_option('shop-num-column')));
    $woocommerce_loop['columns'] = intval(yit_get_option('shop-num-column'));
} else {
    $sidebar = YIT_Layout()->sidebars;
    if ($sidebar['layout'] == 'sidebar-double') {
        $woocommerce_loop['li_class'][] = 'col-sm-6';
        $woocommerce_loop['columns'] = '2';
    } elseif ($sidebar['layout'] == 'sidebar-right' || $sidebar['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';
    }
}
// Add class first or last
if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) {
    $woocommerce_loop['li_class'][] = 'first';
}
Beispiel #19
0
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
global $post;
if (!is_page() || !isset($post->ID)) {
    return;
}
$address = YIT_Layout()->google_map_overlay_address;
$latitude = YIT_Layout()->google_map_overlay_latitude;
$longitude = YIT_Layout()->google_map_overlay_longitude;
if ($address == '' && ($latitude == '' && $longitude == '')) {
    return;
}
$full_width = YIT_Layout()->google_map_full_width;
$width = YIT_Layout()->google_map_width;
$height = YIT_Layout()->google_map_height;
$zoom = YIT_Layout()->google_map_overlay_zoom;
$marker = YIT_Layout()->google_map_overlay_marker;
$style = YIT_Layout()->google_map_overlay_style;
$google_map = '[googlemap full_width="' . $full_width . '" width="' . $width . '" height="' . $height . '" address="' . $address . '" latitude="' . $latitude . '" longitude="' . $longitude . '" zoom="' . $zoom . '" marker="' . $marker . '" style="' . $style . '"]';
?>
<!-- START MAP -->
<div id="map">
    <div class="container">
        <div class="border">
            <?php 
echo do_shortcode($google_map);
?>
        </div>
    </div>
</div>
<!-- END MAP -->