Example #1
0
<?php

/**
 * Template Name: Full Width Page
 *
 * @package WordPress
 * @subpackage socute
 */
if (is_posts_page() || is_home()) {
    get_template_part('blog');
    die;
}
// params of sidebar Home Row
$sidebar = 'home-row';
$sidebars = wp_get_sidebars_widgets();
global $wp_registered_sidebars;
if (isset($sidebars[$sidebar])) {
    switch (count($sidebars[$sidebar])) {
        case 1:
            $widget_class = 'span12';
            break;
        case 2:
            $widget_class = 'span6';
            break;
        case 3:
            $widget_class = 'span4';
            break;
        default:
            $widget_class = 'span3';
            break;
    }
Example #2
0
 /**
  * Retrieve the post id
  * 
  * @return integer
  * @since 1.0.0
  */
 function yit_post_id()
 {
     global $post;
     $post_id = 0;
     if (is_posts_page()) {
         $post_id = get_option('page_for_posts');
     } elseif (is_shop_installed() && (is_shop() || is_product_category() || is_product_tag() || is_product_attribute())) {
         $post_id = woocommerce_get_page_id('shop');
     } elseif (isset($post->ID)) {
         $post_id = $post->ID;
     }
     return $post_id;
 }
Example #3
0
<?php

if (yit_get_sidebar_layout() == 'sidebar-no') {
    $span = 5;
    $span_title = 2;
} else {
    $span = 3;
    if ((is_posts_page() || is_home() || is_single()) && (yit_get_option('blog-type') == 'big-ribbon' || yit_get_option('blog-type') == 'small-ribbon')) {
        $span_title = 2;
    } else {
        $span_title = 3;
    }
}
$content = isset($content) && $content != '' ? $content : '';
?>
<div class="row box-title">
    <div class="span<?php 
echo $span;
?>
">
        <?php 
echo do_shortcode('[border]');
?>
    </div>
    <h3 class="span<?php 
echo $span_title;
?>
">
        <?php 
echo $content;
?>
Example #4
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;
$post_id = 0;
if (is_posts_page()) {
    $post_id = get_option('page_for_posts');
} elseif (function_exists('is_shop') && is_shop()) {
    $post_id = woocommerce_get_page_id('shop');
} elseif (isset($post->ID)) {
    $post_id = $post->ID;
}
// use static header image
if (isset($post_id) && yit_get_post_meta($post_id, '_use_static_image')) {
    $image_url = yit_get_post_meta($post_id, '_static_image');
    $image_size = @getimagesize($image_url);
    $image_id = yit_get_attachment_id($image_url);
    list($thumb_url, $image_width, $image_height) = wp_get_attachment_image_src($image_id);
    $static_image_link = yit_get_post_meta($post_id, '_static_image_link');
    ?>
	    <div class="slider fixed-image inner group">
 /**
  * Retrieve the standard sidebar setted for the current page, excluding woocommerce pages.
  * 
  * @return string
  * @since 1.0.0
  */
 function yit_get_standard_corporate_sidebar()
 {
     $page = '';
     if (!is_internal()) {
         if (yit_get_option('enable-all-sidebar') == 1) {
             $page = 'all';
         } else {
             if (is_posts_page() || is_single() && get_post_type() == 'post' || is_page_template('blog.php')) {
                 $page = 'blog';
             } elseif (is_404()) {
                 $page = '404';
             } elseif (is_category()) {
                 $page = 'categories';
             } elseif (is_search()) {
                 $page = 'search';
             } elseif (is_archive()) {
                 $page = 'archives';
             } elseif (is_page()) {
                 $page = 'pages';
             }
         }
     } else {
         if (yit_get_option('enable-all-custom-sidebar') == 1) {
             $page = 'all-custom';
         } else {
             if (is_portfolio()) {
                 $page = 'portfolios';
             } elseif (is_gallery()) {
                 $page = 'galleries';
             } elseif (is_services()) {
                 $page = 'services';
             } elseif (is_testimonial()) {
                 $page = 'testimonial';
             }
         }
     }
     return $page;
 }
Example #6
0
 /**
  * Get a specific option value from the database
  *                     
  * @since 1.0.0
  * @param $id string     
  * @return array
  */
 public function get_option($id, $default = false)
 {
     global $post;
     $post_meta = '';
     if (is_posts_page()) {
         $post_id = get_option('page_for_posts');
     } elseif (is_shop_installed() && (is_shop() || is_product_category() || is_product_tag())) {
         $post_id = function_exists('wc_get_page_id') ? wc_get_page_id('shop') : woocommerce_get_page_id('shop');
     } elseif (isset($post->ID)) {
         $post_id = $post->ID;
     } else {
         $post_id = 0;
     }
     // get eventual custom field hidden from the post, that have the same ID
     if ($post_id != 0) {
         $post_meta = get_post_meta($post_id, '_' . $id, true);
     }
     // get eventual custom field from the post, that have the same ID
     if ($post_id != 0 && empty($post_meta)) {
         $post_meta = get_post_meta($post_id, $id, true);
     }
     // return custom field, if it exists
     if ($post_meta != '') {
         // the only way to check, because with ! empty( $post_meta ) doesn't get the value "0" from the custom field
         return stripslashes_deep($post_meta);
         // otherwise return the value from database, if it exists
     } elseif (isset($this->db_options[$id])) {
         return stripslashes_deep($this->db_options[$id]);
         // else return the default value from the options array, if it's not defined a default value in method parameter
     } elseif (!$default) {
         $new_value = $this->get_default_option($id);
         $this->update_option($id, $new_value);
         return stripslashes_deep($new_value);
         // else return the default value from the method parameter
     } else {
         return stripslashes_deep($default);
     }
 }
Example #7
0
    /**
     * Retrieve the post id
     * 
     * @return integer
     * @since 1.0.0
     */
    function yit_post_id() {
        global $post; 
        
        $post_id = 0;
        if ( is_posts_page() ) $post_id = get_option( 'page_for_posts' );
        elseif ( function_exists( 'is_shop' ) && ( is_shop() || is_product_category() ) ) {

            $post_id = (function_exists( 'wc_get_page_id' )) ? wc_get_page_id('shop') : woocommerce_get_page_id( 'shop' );
        }
        elseif ( isset( $post->ID ) ) $post_id = $post->ID;
        
        return $post_id;
    }
 /**
  * Retrieve the post id
  *
  * @return integer
  * @since 1.0.0
  */
 function yit_post_id()
 {
     global $post;
     $post_id = 0;
     if (is_posts_page()) {
         $post_id = get_option('page_for_posts');
     } elseif (function_exists('is_shop') && is_shop()) {
         $post_id = woocommerce_get_page_id('shop');
     } elseif (isset($post->ID)) {
         $post_id = $post->ID;
     }
     return $post_id;
 }