/**
  * Upload
  * Ajax callback function
  *
  * @return string Error or (XML-)response
  */
 static function handle_upload()
 {
     global $wpdb;
     $post_id = is_numeric($_REQUEST['post_id']) ? $_REQUEST['post_id'] : 0;
     $field_id = isset($_REQUEST['field_id']) ? $_REQUEST['field_id'] : '';
     check_ajax_referer("rwmb-upload-images_{$field_id}");
     // You can use WP's wp_handle_upload() function:
     $file = $_FILES['async-upload'];
     $file_attr = wp_handle_upload($file, array('test_form' => false));
     //Get next menu_order
     $meta = sf_get_post_meta($post_id, $field_id, false);
     if (empty($meta)) {
         $next = 0;
     } else {
         $meta = implode(',', (array) $meta);
         $max = $wpdb->get_var("\n\t\t\t\t\tSELECT MAX(menu_order) FROM {$wpdb->posts}\n\t\t\t\t\tWHERE post_type = 'attachment'\n\t\t\t\t\tAND ID in ({$meta})\n\t\t\t\t");
         $next = is_numeric($max) ? (int) $max + 1 : 0;
     }
     $attachment = array('guid' => $file_attr['url'], 'post_mime_type' => $file_attr['type'], 'post_title' => preg_replace('/\\.[^.]+$/', '', basename($file['name'])), 'post_content' => '', 'post_status' => 'inherit', 'menu_order' => $next);
     // Adds file as attachment to WordPress
     $id = wp_insert_attachment($attachment, $file_attr['file'], $post_id);
     if (!is_wp_error($id)) {
         wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $file_attr['file']));
         // Save file ID in meta field
         add_post_meta($post_id, $field_id, $id, false);
         wp_send_json_success(self::img_html($id));
     }
     exit;
 }
 public function content($atts, $content = null)
 {
     $title = $el_class = $title_heading_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'alt_background' => 'none', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
     $output = '';
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $el_class .= ' spb_text_column';
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     if ($alt_background == "none" || $sidebars != "no-sidebars") {
         $output .= "\n\t" . '<div class="full-width-text spb_content_element ' . $width . $el_class . '">';
         $title_heading_class = "spb-text-heading";
     } else {
         $output .= "\n\t" . '<div class="full-width-text spb_content_element alt-bg ' . $alt_background . ' ' . $width . $el_class . '">';
         $title_heading_class = "spb-center-heading";
     }
     $output .= "\n\t\t" . '<div class="spb_wrapper clearfix">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading ' . $title_heading_class . '"><span>' . $title . '</span></h3></div>' : '';
     $output .= "\n\t\t\t" . do_shortcode($content);
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
Beispiel #3
0
 /**
  * Get meta value
  * If field is cloneable, value is saved as a single entry in DB
  * Otherwise value is saved as multiple entries (for backward compatibility)
  *
  * @see "save" method for better understanding
  *
  * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
  *
  * @param $post_id
  * @param $saved
  * @param $field
  *
  * @return array
  */
 static function meta($post_id, $saved, $field)
 {
     $meta = sf_get_post_meta($post_id, $field['id'], $field['clone']);
     $meta = !$saved && '' === $meta || array() === $meta ? $field['std'] : $meta;
     $meta = array_map('esc_attr', (array) $meta);
     return $meta;
 }
function lip_get_love_count($post_id)
{
    $love_count = sf_get_post_meta($post_id, '_li_love_count', true);
    if ($love_count) {
        return $love_count;
    }
    return 0;
}
 /**
  * Get meta value
  *
  * @param $post_id
  * @param $saved
  * @param $field
  *
  * @return array
  */
 static function meta($post_id, $saved, $field)
 {
     $meta = sf_get_post_meta($post_id, $field['id']);
     if (is_array($meta) && !empty($meta)) {
         $meta = $meta[0];
     }
     return $meta;
 }
 protected function content($atts, $content = null)
 {
     $btn_color = $btn_text = $display_type = $target = $href = $promo_bar_text = $fullwidth = $inline_style = $inline_style_alt = $width = $position = $el_class = '';
     extract(shortcode_atts(array('btn_color' => 'accent', 'btn_text' => '', 'btn_type' => 'dropshadow', 'target' => '', 'display_type' => '', 'href' => '', 'shadow' => 'yes', 'promo_bar_text' => '', 'content' => '', 'promo_bar_text_size' => '', 'width' => '1/1', 'bg_color' => '', 'text_color' => '', 'fullwidth' => 'no', 'el_class' => '', 'el_position' => ''), $atts));
     $output = '';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     if ($bg_color != "") {
         $inline_style .= 'background-color:' . $bg_color . ';';
     }
     if ($text_color != "") {
         $inline_style_alt .= 'color:' . $text_color . ';';
     }
     // Button type
     $btn_type = str_replace("_", " ", $btn_type);
     if ($target == 'same' || $target == '_self') {
         $target = '_self';
     }
     if ($target != '') {
         $target = $target;
     }
     $next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
     $output .= '<div class="spb-promo-wrap spb_content_element clearfix ' . $width . ' ' . $position . $el_class . '">' . "\n";
     $output .= '<div class="sf-promo-bar ' . $display_type . '" style="' . $inline_style . '">';
     if ($display_type == "promo-button") {
         $output .= '<p class="' . $promo_bar_text_size . '" style="' . $inline_style_alt . '">' . $promo_bar_text . '</p>';
         $output .= '<a href="' . $href . '" target="' . $target . '" class="sf-button ' . $btn_type . ' ' . $btn_color . '">' . $btn_text . '</a>';
     } else {
         if ($display_type == "promo-arrow") {
             $output .= '<a href="' . $href . '" target="' . $target . '" style="' . $inline_style_alt . '"><p>' . $promo_bar_text . '</p>' . $next_icon . '</a>';
         } else {
             if ($display_type == "promo-text") {
                 $output .= '<a href="' . $href . '" target="' . $target . '" class="' . $promo_bar_text_size . '" style="' . $inline_style_alt . '"><p>' . do_shortcode($promo_bar_text) . '</p></a>';
             } else {
                 $output .= '<p>' . do_shortcode($content) . '</p>';
             }
         }
     }
     $output .= '</div>';
     $output .= '</div> ' . $this->endBlockComment('.spb-promo-wrap') . "\n";
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     return $output;
 }
Beispiel #7
0
/**
 * Filter tabs and allow third parties to add their own
 *
 * Each tab is an array containing title, callback and priority.
 * @see woocommerce_default_product_tabs()
 */
function sf_add_desc_tab($tabs = array())
{
    global $post;
    $product_description = sf_get_post_meta($post->ID, 'sf_product_description', true);
    if ($product_description != "") {
        $tabs['description'] = array('title' => __('Description', 'woocommerce'), 'priority' => 10, 'callback' => 'woocommerce_product_description_tab');
    }
    return $tabs;
}
    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $number = strip_tags($instance['number']);
        $loved_icon = apply_filters('sf_loved_icon', '<i class="ss-heart"></i>');
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
            <ul class="most-loved">
                <?php 
        $args = array('post_type' => 'any', 'numberposts' => $number, 'meta_key' => '_li_love_count', 'orderby' => 'meta_value_num', 'order' => 'DESC');
        $most_loved = get_posts($args);
        foreach ($most_loved as $loved) {
            ?>
                        <?php 
            global $post;
            $post_id = $loved->ID;
            if (function_exists('icl_object_id')) {
                $post_id = icl_object_id($post_id, 'post', true);
            }
            $author_id = get_post_field('post_author', $post_id);
            $author_name = get_the_author_meta('user_nicename', $author_id);
            ?>

                        <li class="loved-item">
                            <a href="<?php 
            echo get_permalink($post_id);
            ?>
"></a>
                            <h5><?php 
            echo get_the_title($post_id);
            ?>
</h5>
                            <span><?php 
            echo sprintf(__('By %1$s', 'swiftframework'), $author_name);
            ?>
</span>

                            <div class="loved-count"><?php 
            echo $loved_icon;
            ?>
<span><?php 
            echo sf_get_post_meta($post_id, '_li_love_count', true);
            ?>
</span>
                            </div>
                        </li>
                    <?php 
        }
        ?>
            </ul>
            <?php 
        echo $after_widget;
    }
    function sf_newsletter_bar()
    {
        global $sf_options, $post;
        $enable_newsletter_sub_bar = $enable_newsletter_bar_page = false;
        if (isset($sf_options['enable_newsletter_sub_bar'])) {
            $enable_newsletter_sub_bar = $sf_options['enable_newsletter_sub_bar'];
        }
        if (is_page() && $post) {
            $enable_newsletter_bar_page = sf_get_post_meta($post->ID, 'sf_enable_newsletter_bar', true);
        }
        if (isset($sf_options['enable_newsletter_sub_bar_globally'])) {
            $enable_newsletter_bar_page = $sf_options['enable_newsletter_sub_bar_globally'];
        }
        if ($enable_newsletter_sub_bar && (is_home() || is_front_page()) || $enable_newsletter_bar_page) {
            $sub_bar_text = __($sf_options['sub_bar_text'], "swiftframework");
            $sub_bar_code = __($sf_options['sub_bar_code'], "swiftframework");
            $fullwidth_header = $sf_options['fullwidth_header'];
            $page_layout = $sf_options['page_layout'];
            if (isset($_GET['layout'])) {
                $page_layout = $_GET['layout'];
            }
            ?>
                <!--// OPEN #sf-newsletter-bar //-->
                <div id="sf-newsletter-bar">

                	<?php 
            if (!$fullwidth_header || $page_layout == "boxed") {
                ?>
                	<div class="container">
                	<?php 
            }
            ?>
                		<h3 class="sub-text"><?php 
            echo esc_attr($sub_bar_text);
            ?>
</h3>
                		<div class="sub-code"><?php 
            echo do_shortcode($sub_bar_code);
            ?>
</div>
                		<a href="#" class="sub-close"><i class="sf-icon-close"></i></a>

                	<?php 
            if (!$fullwidth_header || $page_layout == "boxed") {
                ?>
                	</div>
                	<?php 
            }
            ?>

                    <!--// CLOSE #sf-newsletter-bar //-->
                </div>
            <?php 
        }
    }
Beispiel #10
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $filter_output = $exclude_categories = $output = $tax_terms = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'display_type' => 'standard', 'columns' => '4', 'show_title' => 'yes', 'show_subtitle' => 'yes', 'show_excerpt' => 'no', 'hover_show_excerpt' => 'no', "excerpt_length" => '20', 'item_count' => '-1', 'category' => '', 'portfolio_filter' => 'yes', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     /*  for PRO users! -  SIDEBAR CONFIG
         ================================================== */
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /*  for PRO users! -  PORTFOLIO FILTER
         ================================================== */
     if ($portfolio_filter == "yes" && $sidebars == "no-sidebars") {
         if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
             $filter_output = sf_portfolio_filter('full-width', $category);
         } else {
             $filter_output = sf_portfolio_filter('', $category);
         }
     }
     /*  for PRO users! -  PORTFOLIO ITEMS
         ================================================== */
     $items = sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars);
     /*  for PRO users! -  PAGE BUILDER OUTPUT
     			================================================== */
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_portfolio_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper portfolio-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
     if ($filter_output != "") {
         $output .= "\n\t\t\t" . $filter_output;
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
         $output = $this->startRow($el_position, '', true, "full-width") . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_isotope;
     $sf_include_isotope = true;
     global $sf_has_portfolio;
     $sf_has_portfolio = true;
     return $output;
 }
Beispiel #11
0
function sf_excerpt($limit)
{
    global $post;
    $excerpt = "";
    $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
    if ($custom_excerpt != "") {
        $excerpt = wp_trim_words($custom_excerpt, $limit);
    } else {
        $excerpt = wp_trim_words(get_the_excerpt(), $limit);
    }
    $excerpt = preg_replace('`\\[[^\\]]*\\]`', '', $excerpt);
    return '<p>' . $excerpt . '</p>';
}
Beispiel #12
0
 /**
  * Add custom fields to $item nav object
  * in order to be used in custom Walker
  *
  * @access      public
  * @since       1.0 
  * @return      void
  */
 function sf_mega_menu_add_custom_nav_fields($menu_item)
 {
     $menu_item->subtitle = sf_get_post_meta($menu_item->ID, '_menu_item_subtitle', true);
     $menu_item->htmlcontent = sf_get_post_meta($menu_item->ID, '_menu_item_htmlcontent', true);
     $menu_item->nocolumnspacing = sf_get_post_meta($menu_item->ID, '_menu_nocolumnspacing', true);
     $menu_item->ismegamenu = sf_get_post_meta($menu_item->ID, '_menu_is_megamenu', true);
     $menu_item->isnaturalwidth = sf_get_post_meta($menu_item->ID, '_menu_is_naturalwidth', true);
     $menu_item->altstyle = sf_get_post_meta($menu_item->ID, '_menu_is_altstyle', true);
     $menu_item->hideheadings = sf_get_post_meta($menu_item->ID, '_menu_hideheadings', true);
     $menu_item->megatitle = sf_get_post_meta($menu_item->ID, '_menu_megatitle', true);
     $menu_item->menuicon = sf_get_post_meta($menu_item->ID, '_menu_item_icon', true);
     $menu_item->menuwidth = sf_get_post_meta($menu_item->ID, '_menu_item_width', true);
     return $menu_item;
 }
Beispiel #13
0
/**
 * Filter tabs and allow third parties to add their own
 *
 * Each tab is an array containing title, callback and priority.
 * @see woocommerce_default_product_tabs()
 */
function sf_add_desc_tab($tabs = array())
{
    global $post;
    $pb_active = sf_get_post_meta($post->ID, '_spb_js_status', true);
    $product_description = "";
    if ($pb_active == "true") {
        $product_description = sf_get_post_meta($post->ID, 'sf_product_description', true);
    } else {
        $product_description = get_the_content();
    }
    if ($product_description != "") {
        $tabs['description'] = array('title' => __('Description', 'swiftframework'), 'priority' => 10, 'callback' => 'woocommerce_product_description_tab');
    }
    return $tabs;
}
Beispiel #14
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $show_blog_aux = $exclude_categories = $blog_aux = $show_read_more = $offset = $posts_order = $content_output = $items = $item_figure = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'show_blog_aux' => 'yes', "blog_type" => "standard", "masonry_effect_type" => "effect-1", 'show_title' => 'yes', 'show_excerpt' => 'yes', "show_details" => 'yes', "offset" => '0', "posts_order" => 'DESC', "excerpt_length" => '20', 'show_read_more' => 'yes', "item_count" => '5', "category" => '', "exclude_categories" => '', "pagination" => "no", "content_output" => 'excerpt', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $width = spb_translateColumnWidthToSpan($width);
     /*  for PRO users! -  SIDEBAR CONFIG
         ================================================== */
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /*  for PRO users! -  BLOG AUX
         ================================================== */
     if ($show_blog_aux == "yes" && $sidebars == "no-sidebars") {
         $blog_aux = sf_blog_aux($width);
     }
     /*  for PRO users! -  BLOG ITEMS
         ================================================== */
     $items = sf_blog_items($blog_type, $masonry_effect_type, $show_title, $show_excerpt, $show_details, $excerpt_length, $content_output, $show_read_more, $item_count, $category, $exclude_categories, $pagination, $sidebars, $width, $offset, $posts_order);
     /*  for PRO users! -  FINAL OUTPUT
     			================================================== */
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_blog_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper blog-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
     if ($blog_aux != "") {
         $output .= "\n\t\t\t" . $blog_aux;
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($blog_type == "masonry-fw") {
         $output = $this->startRow($el_position, '', true, "full-width") . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_has_blog, $sf_include_imagesLoaded;
     $sf_include_imagesLoaded = true;
     $sf_has_blog = true;
     return $output;
 }
 public function content($atts, $content = null)
 {
     $title = $order = $items = $el_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'twitter_username' => '', 'tweets_count' => '6', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
     $output = '';
     if ($autoplay == "yes") {
         $items .= '<div class="flexslider tweets-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides cS-hidden">';
     } else {
         $items .= '<div class="flexslider tweets-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides cS-hidden">';
     }
     $items .= sf_get_tweets($twitter_username, $tweets_count);
     $items .= '</ul></div>';
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $el_class .= ' testimonial';
     $output .= "\n\t" . '<div class="spb_tweets_slider_widget ' . $width . $el_class . '">';
     $output .= "\n\t" . '<div class="spb-bg-color-wrap">';
     $output .= "\n\t\t" . '<div class="spb-asset-content spb_wrapper slider-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading">' . $title . '</h3></div>' : '';
     if ($title == "") {
         $output .= "\n\t\t\t" . '<div class="tweet-icon"><i class="fa-twitter"></i></div>';
     }
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_carousel;
     $sf_include_carousel = true;
     return $output;
 }
Beispiel #16
0
    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $number = strip_tags($instance['number']);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
					<ul class="most-loved">
					<?php 
        $args = array('post_type' => 'any', 'numberposts' => $number, 'meta_key' => '_li_love_count', 'orderby' => 'meta_value_num', 'order' => 'DESC');
        $most_loved = get_posts($args);
        foreach ($most_loved as $loved) {
            ?>
							
							<?php 
            $author_name = get_the_author_meta('nickname', $loved->post_author);
            ?>
							<li class="loved-item">
								<a href="<?php 
            echo get_permalink($loved->ID);
            ?>
"><?php 
            echo get_the_title($loved->ID);
            ?>
</a>
								<span><?php 
            echo sprintf(__('By %1$s', 'swiftframework'), $author_name);
            ?>
</span>
								<div class="loved-count"><i class="ss-heart"></i><span><?php 
            echo sf_get_post_meta($loved->ID, '_li_love_count', true);
            ?>
</span></div>
							</li>
						<?php 
        }
        ?>
					</ul>
              <?php 
        echo $after_widget;
    }
Beispiel #17
0
    function sf_breadcrumbs($alt = false)
    {
        global $post, $sf_options;
        $remove_breadcrumbs = false;
        $breadcrumb_in_heading = 0;
        if (isset($sf_options['breadcrumb_in_heading'])) {
            $breadcrumb_in_heading = $sf_options['breadcrumb_in_heading'];
        }
        // Remove breadcrumbs
        if ($post && is_singular()) {
            $remove_breadcrumbs = sf_get_post_meta($post->ID, 'sf_no_breadcrumbs', true);
        }
        // Breadcrumb in heading
        if ($breadcrumb_in_heading && !$alt) {
            return;
        }
        if (!$remove_breadcrumbs) {
            if (function_exists('bcn_display')) {
                ?>
                    <div id="breadcrumbs">
                        <div class="container"><?php 
                bcn_display();
                ?>
</div>
                    </div>
                <?php 
            } else {
                if (function_exists('yoast_breadcrumb')) {
                    ?>
                    <div id="breadcrumbs">
                        <div class="container"><?php 
                    yoast_breadcrumb("", "");
                    ?>
</div>
                    </div>
                <?php 
                }
            }
        }
    }
Beispiel #18
0
 protected function content($atts, $content = null)
 {
     $title = $asset_type = $width = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'asset_type' => 'best-sellers', 'item_count' => '4', 'category' => '', 'el_position' => '', 'width' => '1/4', 'el_class' => ''), $atts));
     /* SIDEBAR CONFIG
        ================================================== */
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* PRODUCT ITEMS
        ================================================== */
     if (sf_woocommerce_activated()) {
         $items = sf_mini_product_items($asset_type, $category, $item_count, $sidebars, $width);
     } else {
         $items = __("Please install/activate WooCommerce.", 'swift-framework-plugin');
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="product_list_widget woocommerce spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : '';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_has_products;
     $sf_has_products = true;
     return $output;
 }
Beispiel #19
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $gutters = $fullwidth = $columns = $hover_style = $show_read_more = $offset = $order = $content_output = $items = $item_figure = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'blog_type' => 'standard', 'gutters' => 'yes', 'columns' => '4', 'fullwidth' => 'no', 'include_sticky' => 'no', 'show_title' => 'yes', 'show_excerpt' => 'yes', 'show_details' => 'yes', 'offset' => '0', 'order_by' => 'date', 'order' => 'DESC', 'excerpt_length' => '20', 'show_read_more' => 'yes', 'item_count' => '5', 'category' => '', 'exclude_categories' => '', 'pagination' => 'no', 'social_integration' => 'no', 'twitter_username' => '', 'instagram_id' => '', 'instagram_token' => '', 'blog_filter' => '', 'basic_blog_filter' => '', 'alt_styling' => 'no', 'hover_style' => 'default', 'content_output' => 'excerpt', 'post_type' => 'post', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $width = spb_translateColumnWidthToSpan($width);
     /* SIDEBAR CONFIG
        ================================================== */
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     /* BLOG AUX
        ================================================== */
     //          if ($show_blog_aux == "yes" && $sidebars == "no-sidebars") {
     //              $blog_aux = sf_blog_aux($width);
     //          }
     /* BLOG ITEMS
        ================================================== */
     $items = sf_blog_items($atts);
     /* FINAL OUTPUT
        ================================================== */
     $title_wrap_class = "";
     if ($blog_filter == "yes") {
         $title_wrap_class .= 'has-filter ';
     }
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $title_wrap_class .= 'container ';
     }
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_blog_widget blog-wrap spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     if ($title != '' || $blog_filter == "yes") {
         $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
         if ($title != '') {
             $output .= '<h2 class="spb-heading"><span>' . $title . '</span></h2>';
         }
         if ($blog_filter == "yes") {
             $filter_style = "";
             if ($basic_blog_filter == "yes") {
                 $filter_style = "basic";
             }
             $output .= sf_post_filter($filter_style, $post_type, $category);
         }
         $output .= '</div>';
     }
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_has_blog, $sf_include_imagesLoaded;
     $sf_include_imagesLoaded = true;
     $sf_has_blog = true;
     return $output;
 }
    function sf_pageslider()
    {
        global $post;
        if (!is_page()) {
            return;
        }
        // Get page slider meta values
        $page_slider = sf_get_post_meta($post->ID, 'sf_page_slider', true);
        // Swift Slider meta
        $ss_type = sf_get_post_meta($post->ID, 'sf_ss_type', true);
        $ss_category = sf_get_post_meta($post->ID, 'sf_ss_category', true);
        $ss_fs = sf_get_post_meta($post->ID, 'sf_ss_fs', true);
        $ss_maxheight = sf_get_post_meta($post->ID, 'sf_ss_maxheight', true);
        $ss_slidecount = sf_get_post_meta($post->ID, 'sf_ss_slides', true);
        $ss_autoplay = sf_get_post_meta($post->ID, 'sf_ss_autoplay', true);
        $ss_transition = sf_get_post_meta($post->ID, 'sf_ss_transition', true);
        $ss_loop = sf_get_post_meta($post->ID, 'sf_ss_loop', true);
        $ss_nav = sf_get_post_meta($post->ID, 'sf_ss_nav', true);
        $ss_pagination = sf_get_post_meta($post->ID, 'sf_ss_pagination', true);
        $ss_continue = sf_get_post_meta($post->ID, 'sf_ss_continue', true);
        if ($ss_continue == "") {
            $ss_continue = 'true';
        }
        // Revolution Slider ID
        $rs_ID = sf_get_post_meta($post->ID, 'sf_rev_slider_alias', true);
        // LayerSlider ID
        $ls_ID = sf_get_post_meta($post->ID, 'sf_layerslider_id', true);
        // Master Slider ID
        $ms_ID = sf_get_post_meta($post->ID, 'sf_masterslider_id', true);
        ?>

            <?php 
        if ($page_slider == "swift-slider") {
            global $sf_has_swiftslider;
            $sf_has_swiftslider = true;
            echo do_shortcode('[swift_slider type="' . $ss_type . '" category="' . $ss_category . '" fullscreen="' . $ss_fs . '" max_height="' . $ss_maxheight . '" slide_count="' . $ss_slidecount . '" transition="' . $ss_transition . '" loop="' . $ss_loop . '" nav="' . $ss_nav . '" pagination="' . $ss_pagination . '" autoplay="' . $ss_autoplay . '" continue="' . $ss_continue . '"]');
        } else {
            if ($page_slider == "revslider" && $rs_ID != "") {
                ?>

                <div class="home-slider-wrap">
                    <a href="#container" id="slider-continue"><?php 
                echo apply_filters('swift_slider_continue_icon', '<i class="ss-navigatedown"></i>');
                ?>
</a>
                    <?php 
                if (function_exists('putRevSlider')) {
                    putRevSlider($rs_ID);
                }
                ?>
                </div>

            <?php 
            } else {
                if ($page_slider == "layerslider" && $ls_ID != "") {
                    ?>

                <div class="home-slider-wrap">
                    <?php 
                    echo do_shortcode('[layerslider id="' . $ls_ID . '"]');
                    ?>
                </div>

            <?php 
                } else {
                    if ($page_slider == "masterslider" && $ms_ID != "") {
                        ?>

                <div class="home-slider-wrap">
                    <?php 
                        echo do_shortcode('[masterslider id="' . $ms_ID . '"]');
                        ?>
                </div>

            <?php 
                    }
                }
            }
        }
    }
 function sf_product_short()
 {
     global $post;
     $product_short_description = sf_get_post_meta($post->ID, 'sf_product_short_description', true);
     if ($product_short_description == "") {
         $product_short_description = $post->post_excerpt;
     }
     if (substr($product_short_description, 0, 4) === '[spb') {
         $product_short_description = "";
     }
     if ($product_short_description != "") {
         ?>
             <div class="product-short" class="entry-summary">
                 <?php 
         echo do_shortcode(sf_add_formatting($product_short_description));
         ?>
             </div>
         <?php 
     }
 }
 public function content($atts, $content = null)
 {
     $title = $order = $text_size = $items = $el_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'text_size' => '', 'item_count' => '', 'order' => '', 'category' => 'all', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1'), $atts));
     $output = '';
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // TESTIMONIAL QUERY SETUP
     global $post, $wp_query;
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $testimonials = new WP_Query($testimonials_args);
     if ($autoplay == "yes") {
         $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides">';
     } else {
         $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides">';
     }
     // TESTIMONIAL LOOP
     while ($testimonials->have_posts()) {
         $testimonials->the_post();
         $testimonial_text = get_the_content();
         $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true);
         $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true);
         $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID);
         foreach ($testimonial_image as $detail_image) {
             $testimonial_image_url = $detail_image['url'];
             break;
         }
         if (!$testimonial_image) {
             $testimonial_image = get_post_thumbnail_id();
             $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full');
         }
         $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false);
         $items .= '<li class="testimonial">';
         $items .= '<div class="testimonial-text text-' . $text_size . '">' . do_shortcode($testimonial_text) . '</div>';
         if ($testimonial_image) {
             $items .= '<div class="testimonial-cite has-image">';
             $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />';
             if ($testimonial_cite_subtext != "") {
                 $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>';
             } else {
                 $items .= '<cite>' . $testimonial_cite . '</cite>';
             }
         } else {
             $items .= '<div class="testimonial-cite">';
             if ($testimonial_cite_subtext != "") {
                 $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>';
             } else {
                 $items .= '<cite>' . $testimonial_cite . '</cite>';
             }
         }
         $items .= '</div>';
         $items .= '</li>';
     }
     wp_reset_postdata();
     $items .= '</ul></div>';
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     $el_class .= ' testimonial';
     // Full width setup
     $fullwidth = false;
     if ($alt_background != "none") {
         $fullwidth = true;
     }
     $output .= "\n\t" . '<div class="spb_testimonial_slider_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper slider-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>' : '';
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position, $width, $fullwidth, false, $alt_background) . $output . $this->endRow($el_position, $width, $fullwidth, false);
     global $sf_include_carousel;
     $sf_include_carousel = true;
     return $output;
 }
 public function content($atts, $content = null)
 {
     $title = $order = $page_link = $items = $item_class = $el_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => 'all', 'pagination' => 'no', 'page_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
     $output = '';
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // TESTIMONIAL QUERY SETUP
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $testimonials = new WP_Query($testimonials_args);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     global $column_width;
     if ($column_width != "") {
         if ($column_width == "1/1") {
             if ($sidebars == "both-sidebars") {
                 $item_class = "span6";
             } else {
                 if ($sidebars == "one-sidebar") {
                     $item_class = "span8";
                 } else {
                     $item_class = "span12";
                 }
             }
         } else {
             if ($column_width == "1/2") {
                 if ($sidebars == "both-sidebars") {
                     $item_class = "span3";
                 } else {
                     if ($sidebars == "one-sidebar") {
                         $item_class = "span4";
                     } else {
                         $item_class = "span6";
                     }
                 }
             } else {
                 if ($column_width == "3/4") {
                     if ($sidebars == "both-sidebars") {
                         $item_class = "span-bs-threequarter";
                     } else {
                         if ($sidebars == "one-sidebar") {
                             $item_class = "span6";
                         } else {
                             $item_class = "span9";
                         }
                     }
                 } else {
                     if ($column_width == "1/4") {
                         if ($sidebars == "both-sidebars") {
                             $item_class = "span-bs-quarter";
                         } else {
                             if ($sidebars == "one-sidebar") {
                                 $item_class = "span2";
                             } else {
                                 $item_class = "span3";
                             }
                         }
                     }
                 }
             }
         }
     } else {
         if ($width == "1/1") {
             if ($sidebars == "both-sidebars") {
                 $item_class = "span6";
             } else {
                 if ($sidebars == "one-sidebar") {
                     $item_class = "span8";
                 } else {
                     $item_class = "span12";
                 }
             }
         } else {
             if ($width == "1/2") {
                 if ($sidebars == "both-sidebars") {
                     $item_class = "span3";
                 } else {
                     if ($sidebars == "one-sidebar") {
                         $item_class = "span4";
                     } else {
                         $item_class = "span6";
                     }
                 }
             } else {
                 if ($width == "3/4") {
                     if ($sidebars == "both-sidebars") {
                         $item_class = "span-bs-threequarter";
                     } else {
                         if ($sidebars == "one-sidebar") {
                             $item_class = "span6";
                         } else {
                             $item_class = "span9";
                         }
                     }
                 } else {
                     if ($width == "1/4") {
                         if ($sidebars == "both-sidebars") {
                             $item_class = "span-bs-quarter";
                         } else {
                             if ($sidebars == "one-sidebar") {
                                 $item_class = "span2";
                             } else {
                                 $item_class = "span3";
                             }
                         }
                     }
                 }
             }
         }
     }
     $items .= '<div class="carousel-overflow"><ul id="carousel-' . $sf_carouselID . '" class="testimonials carousel-items clearfix" data-columns="1" data-auto="false">';
     // TESTIMONIAL LOOP
     while ($testimonials->have_posts()) {
         $testimonials->the_post();
         $testimonial_text = get_the_content();
         $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true);
         $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true);
         $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID);
         foreach ($testimonial_image as $detail_image) {
             $testimonial_image_url = $detail_image['url'];
             break;
         }
         if (!$testimonial_image) {
             $testimonial_image = get_post_thumbnail_id();
             $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full');
         }
         $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false);
         $items .= '<li class="testimonial carousel-item ' . $item_class . ' clearfix">';
         $items .= '<div class="testimonial-text">' . do_shortcode($testimonial_text) . '</div>';
         $items .= '<div class="testimonial-cite">';
         if ($testimonial_image) {
             $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />';
             $items .= '<div class="cite-text has-cite-image"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>';
         } else {
             $items .= '<div class="cite-text"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>';
         }
         $items .= '</div>';
         $items .= '</li>';
     }
     wp_reset_postdata();
     $items .= '</ul>';
     $items .= '<a href="#" class="prev"><i class="ss-navigateleft"></i></a><a href="#" class="next"><i class="ss-navigateright"></i></a>';
     $options = get_option('sf_dante_options');
     if ($options['enable_swipe_indicators']) {
         $items .= '<div class="sf-swipe-indicator"></div>';
     }
     $items .= '</div>';
     if ($page_link == "yes") {
         $options = get_option('sf_dante_options');
         $testimonials_page = __($options['testimonial_page'], 'swiftframework');
         if ($testimonials_page) {
             $items .= '<a href="' . get_permalink($testimonials_page) . '" class="read-more">' . __("More", "swiftframework") . '<i class="ssnavigate-right"></i></a>';
         }
     }
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $el_class .= ' testimonial';
     $output .= "\n\t" . '<div class="spb_testimonial_carousel_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap">';
     if ($title != '') {
         $output .= "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
 function sf_directory_items($excerpt_length, $pagination, $item_count, $directory_cat)
 {
     /* OUTPUT VARIABLE
        ================================================== */
     $directory_items_output = $grid_size = "";
     $count = 0;
     $order = "standard";
     /* DIRECTORY QUERY SETUP
        ================================================== */
     global $post, $wp_query;
     if (get_query_var('paged')) {
         $paged = get_query_var('paged');
     } elseif (get_query_var('page')) {
         $paged = get_query_var('page');
     } else {
         $paged = 1;
     }
     $order_mode = $order_by = "";
     if ($order == "standard") {
         $order_mode = "DESC";
         $order_by = "date";
     } else {
         if ($order == "date-asc") {
             $order_mode = "ASC";
             $order_by = "date";
         } else {
             if ($order == "title-desc") {
                 $order_mode = "DESC";
                 $order_by = "title";
             } else {
                 if ($order == "title-asc") {
                     $order_mode = "ASC";
                     $order_by = "title";
                 }
             }
         }
     }
     $tax_query = array();
     $tax_query_category = array();
     $tax_query_location = array();
     if (isset($directory_cat) && $directory_cat != '' && $directory_cat != 'All') {
         $directory_cat_array = array();
         $directory_cat_array = explode(",", $directory_cat);
         $tax_query_category = array('taxonomy' => 'directory-category', 'field' => 'slug', 'terms' => $directory_cat_array);
         array_push($tax_query, $tax_query_category);
     }
     if (isset($_POST['dir-category-id']) && $_POST['dir-category-id'] != '' && $_POST['dir-category-id'] != 'All') {
         $category_term = $_POST['dir-category-id'];
         $tax_query_category = array('taxonomy' => 'directory-category', 'field' => 'slug', 'terms' => array($category_term));
         array_push($tax_query, $tax_query_category);
     }
     if (isset($_POST['dir-location-id']) && $_POST['dir-location-id'] != '' && $_POST['dir-location-id'] != 'All') {
         $location_term = $_POST['dir-location-id'];
         $tax_query_location = array('taxonomy' => 'directory-location', 'field' => 'slug', 'terms' => array($location_term));
         array_push($tax_query, $tax_query_location);
     }
     $search_term = "";
     if (isset($_POST['dir-search-value'])) {
         $search_term = $_POST['dir-search-value'];
     }
     //Get all itens when there is no pagination
     if ($pagination != 'yes') {
         $item_count = -1;
     }
     $directory_args = array('s' => $search_term, 'post_type' => 'directory', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => $item_count, 'order' => $order_mode, 'orderby' => $order_by, 'tax_query' => $tax_query, 'meta_query' => array('relation' => 'AND', array('key' => 'sf_directory_address', 'value' => '', 'compare' => '!=')));
     $directory_items = new WP_Query($directory_args);
     /* ITEMS OUTPUT
        ================================================== */
     global $sf_options;
     $directory_items_output .= '<div class="directory-list-results">';
     while ($directory_items->have_posts()) {
         $directory_items->the_post();
         $directory_items_output .= '<div class="directory-item clearfix">';
         /* META VARIABLES
            ================================================== */
         $item_title = get_the_title();
         $img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumb-image');
         $pin_link = esc_url(sf_get_post_meta($post->ID, 'sf_directory_pin_link', true));
         $pin_button_text = sf_get_post_meta($post->ID, 'sf_directory_pin_button_text', true);
         $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($excerpt_length != '') {
             if ($custom_excerpt != '') {
                 $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
             } else {
                 $post_excerpt = sf_excerpt($excerpt_length);
             }
         } else {
             $post_excerpt = sf_excerpt(200);
         }
         $post_excerpt .= ' <a class="read-more-directory" href="' . get_permalink($post->ID) . '">  ' . __('Read More', 'swiftframework') . '</a>';
         $post_terms = get_the_terms($post->ID, 'directory-category');
         $term_slug = " ";
         $category_list_text = "";
         if (!empty($post_terms)) {
             foreach ($post_terms as $post_term) {
                 $term_slug = $term_slug . $post_term->slug . ' ';
                 $category_list_text .= $post_term->name . ' | ';
             }
         }
         $category_list_text = rtrim($category_list_text, "| ");
         $location_terms = get_the_terms($post->ID, 'directory-location');
         $location_text = "";
         if (!empty($location_terms)) {
             foreach ($location_terms as $location_term) {
                 $location_text .= $location_term->name . ' | ';
             }
             $location_text = rtrim($location_text, "| ");
             if ($category_list_text != '') {
                 $location_text = '| ' . $location_text;
             }
         }
         /* ITEM OUTPUT
            ================================================== */
         if (isset($img_src[0])) {
             $directory_items_output .= '<figure class="animated-overlay overlay-alt">';
             $directory_items_output .= '<img itemprop="image" src="' . $img_src[0] . '" alt="' . $item_title . '">';
             $directory_items_output .= '<a href="' . get_permalink($post->ID) . '" class="link-to-post"></a><div class="figcaption-wrap"></div>';
             $directory_items_output .= '<figcaption><div class="thumb-info"><h4>' . $item_title . '</h4></div></figcaption></figure>';
             $item_left_margin = "";
         } else {
             $item_left_margin = "dir-item-no-margin";
         }
         $directory_items_output .= '<div class="directory-item-details ' . $item_left_margin . '"><h3>' . $item_title . '</h3>';
         $directory_items_output .= '<div class="item-meta">' . $category_list_text . ' ' . $location_text . '</div><div class="excerpt" itemprop="description">' . $post_excerpt . '</div>';
         if ($pin_button_text != '' && $pin_link != '') {
             $directory_items_output .= '<a class="read-more-button" href="' . $pin_link . '" target="_blank">' . $pin_button_text . '</a>';
         }
         $directory_items_output .= '</div></div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     /* PAGINATION OUTPUT
        ================================================== */
     if ($pagination == "yes") {
         $directory_items_output .= pagenavi($directory_items, '<div class="pagination-wrap">', '</div>');
     }
     $directory_items_output .= '</div>';
     /* FUNCTION OUTPUT
        ================================================== */
     return $directory_items_output;
 }
Beispiel #25
0
                $content = apply_filters('the_content', $content);
                $post_excerpt = $content;
            }
        }
    }
}
$post_permalink_config = 'href="' . $post_permalink . '" class="link-to-post"';
if ($post_links_match_thumb) {
    $link_config = sf_post_item_link();
    $post_permalink_config = $link_config['config'];
}
$thumb_type = sf_get_post_meta($post_id, 'sf_thumbnail_type', true);
$download_button = sf_get_post_meta($post_id, 'sf_download_button', true);
$download_file = sf_get_post_meta($post_id, 'sf_download_file', true);
$download_text = apply_filters('sf_post_download_text', __("Download", "swiftframework"));
$download_shortcode = sf_get_post_meta($post_id, 'sf_download_shortcode', true);
// Media
$item_figure = "";
if ($thumb_type != "none") {
    $item_figure = sf_post_thumbnail('mini', $fullwidth);
}
?>
<div class="mini-blog-item-wrap clearfix">

	<?php 
if ($post_format == "quote" || $post_format == "link") {
    ?>
	
		<div class="mini-alt-wrap"><!-- OPEN .mini-alt-wrap -->
	
	<?php 
    function widget($args, $instance)
    {
        global $post;
        extract($args);
        // Widget Options
        $title = apply_filters('widget_title', $instance['title']);
        // Title
        $number = $instance['number'];
        // Number of posts to show
        $category = $instance['category'];
        // Category to show
        if ($category == "All") {
            $category = "all";
        }
        if ($category == "all") {
            $category = '';
        }
        $category_slug = str_replace('_', '-', $category);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $video_icon = apply_filters('sf_video_icon', '<i class="ss-video"></i>');
        $audio_icon = apply_filters('sf_audio_icon', '<i class="ss-music"></i>');
        $picture_icon = apply_filters('sf_picture_icon', '<i class="ss-picture"></i>');
        $recent_portfolio = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => $number, 'portfolio-category' => $category_slug));
        if ($recent_portfolio->have_posts()) {
            ?>

                <ul class="recent-posts-list">

                    <?php 
            while ($recent_portfolio->have_posts()) {
                $recent_portfolio->the_post();
                $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
                $post_title = get_the_title();
                $post_permalink = get_permalink();
                $thumb_image = get_post_thumbnail_id();
                $thumb_img_url = wp_get_attachment_url($thumb_image, 'widget-image');
                $image = sf_aq_resize($thumb_img_url, 94, 75, true, false);
                $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true));
                ?>
                        <li>
                            <a href="<?php 
                echo $post_permalink;
                ?>
" class="recent-post-image">
                                <?php 
                if ($image) {
                    ?>
                                    <img src="<?php 
                    echo $image[0];
                    ?>
" width="<?php 
                    echo $image[1];
                    ?>
"
                                         height="<?php 
                    echo $image[2];
                    ?>
" alt="<?php 
                    echo $image_alt;
                    ?>
"/>
                                <?php 
                } else {
                    if ($thumb_type == "video") {
                        ?>
                                    <?php 
                        echo $video_icon;
                        ?>
                                <?php 
                    } else {
                        if ($thumb_type == "audio") {
                            ?>
                                    <?php 
                            echo $audio_icon;
                            ?>
                                <?php 
                        } else {
                            ?>
                                    <?php 
                            echo $picture_icon;
                            ?>
                                <?php 
                        }
                    }
                }
                ?>
                            </a>

                            <div class="recent-post-details">
                                <a class="recent-post-title" href="<?php 
                echo $post_permalink;
                ?>
"
                                   title="<?php 
                echo $post_title;
                ?>
"><?php 
                echo $post_title;
                ?>
</a>
                            </div>
                        </li>

                        <?php 
                wp_reset_query();
            }
            ?>
                </ul>

            <?php 
        }
        ?>

            <?php 
        echo $after_widget;
    }
Beispiel #27
0
 function sf_mini_product_items($asset_type, $category, $item_count, $sidebar_config, $width)
 {
     global $woocommerce, $sf_catalog_mode;
     $product_list_output = $image = "";
     $args = array();
     // ARRAY ARGUMENTS
     if ($asset_type == "latest-products") {
         $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count);
         $args['meta_query'] = array();
         $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
         $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
     } else {
         if ($asset_type == "featured-products") {
             $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'meta_key' => '_featured', 'meta_value' => 'yes', 'posts_per_page' => $item_count);
         } else {
             if ($asset_type == "top-rated") {
                 add_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses'));
                 $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count);
                 $args['meta_query'] = $woocommerce->query->get_meta_query();
             } else {
                 if ($asset_type == "recently-viewed") {
                     // Get recently viewed product cookies data
                     $viewed_products = !empty($_COOKIE['woocommerce_recently_viewed']) ? (array) explode('|', $_COOKIE['woocommerce_recently_viewed']) : array();
                     $viewed_products = array_filter(array_map('absint', $viewed_products));
                     // If no data, quit
                     if (empty($viewed_products)) {
                         return '<p class="no-products">' . __("You haven't viewed any products yet.", "swiftframework") . '</p>';
                     }
                     // Create query arguments array
                     $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post__in' => $viewed_products, 'orderby' => 'rand');
                     // Add meta_query to query args
                     //$args['meta_query'] = array();
                     // Check products stock status
                     //$args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
                 } else {
                     if ($asset_type == "sale-products") {
                         // Get products on sale
                         $product_ids_on_sale = wc_get_product_ids_on_sale();
                         $meta_query = array();
                         $meta_query[] = WC()->query->visibility_meta_query();
                         $meta_query[] = WC()->query->stock_status_meta_query();
                         $meta_query = array_filter($meta_query);
                         $args = array('product_cat' => $category, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'meta_query' => $meta_query, 'post__in' => array_merge(array(0), $product_ids_on_sale));
                     } else {
                         $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')));
                         $args['meta_query'] = array();
                         $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
                         $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
                     }
                 }
             }
         }
     }
     // OUTPUT PRODUCTS
     $products = new WP_Query($args);
     if ($products->have_posts()) {
         $product_list_output .= '<ul class="mini-list mini-' . $asset_type . '">';
         while ($products->have_posts()) {
             $products->the_post();
             $product_output = $rating_output = "";
             global $product, $post, $wpdb, $woocommerce_loop;
             // Ensure visibility
             if (!$product->is_visible()) {
                 return;
             }
             if (has_post_thumbnail()) {
                 $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
                 $image_alt = esc_attr(sf_get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true));
                 $image_link = wp_get_attachment_url(get_post_thumbnail_id());
                 if ($image_link == "") {
                     $image_link = "default";
                 }
                 $image = sf_aq_resize($image_link, 70, 70, true, false);
                 if ($image) {
                     $image_html = '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" title="' . $image_title . '" alt="' . $image_alt . '" />';
                 }
             }
             if (comments_open()) {
                 $count = $wpdb->get_var("\n\t\t           \t\t    SELECT COUNT(meta_value) FROM {$wpdb->commentmeta}\n\t\t           \t\t    LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t           \t\t    WHERE meta_key = 'rating'\n\t\t           \t\t    AND comment_post_ID = {$post->ID}\n\t\t           \t\t    AND comment_approved = '1'\n\t\t           \t\t    AND meta_value > 0\n\t\t           \t\t");
                 $rating = $wpdb->get_var("\n\t\t           \t        SELECT SUM(meta_value) FROM {$wpdb->commentmeta}\n\t\t           \t        LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t           \t        WHERE meta_key = 'rating'\n\t\t           \t        AND comment_post_ID = {$post->ID}\n\t\t           \t        AND comment_approved = '1'\n\t\t           \t    ");
                 if ($count > 0) {
                     $average = number_format($rating / $count, 2);
                     $rating_output = '<div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'swiftframework'), $average) . '" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span style="width:' . $average * 16 . 'px"><span itemprop="ratingValue" class="rating">' . $average . '</span> ' . __('out of 5', 'swiftframework') . '</span></div>';
                 }
             }
             $product_output .= '<li class="clearfix" itemscope itemtype="http://schema.org/Product">';
             if ($image) {
                 $product_output .= '<figure>';
                 $product_output .= '<a href="' . get_permalink($post->ID) . '">';
                 $product_output .= $image_html;
                 $product_output .= '</a>';
                 $product_output .= '</figure>';
             }
             $product_output .= '<div class="product-details">';
             $product_output .= '<h5 itemprop="name"><a href="' . get_permalink($post->ID) . '">' . get_the_title() . '</a></h5>';
             if ($asset_type == "top-rated") {
                 $product_output .= $rating_output;
             } else {
                 $size = sizeof(get_the_terms($post->ID, 'product_cat'));
                 $product_output .= $product->get_categories(', ', '<span class="product-cats">', '</span>');
             }
             if (!$sf_catalog_mode) {
                 $product_output .= '<span class="price" itemprop="price">' . $product->get_price_html() . '</span>';
             }
             $product_output .= '</div>';
             $product_output .= '</li>';
             $product_list_output .= $product_output;
         }
         wp_reset_query();
         wp_reset_postdata();
         remove_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses'));
         $product_list_output .= '</ul>';
         return $product_list_output;
     }
 }
    function sf_page_heading()
    {
        global $wp_query, $post;
        $shop_page = false;
        $page_title_bg = "";
        $page_title = $page_subtitle = $page_title_style = $page_title_overlay_effect = $fancy_title_image_url = $article_heading_bg = $article_heading_text = $page_heading_el_class = $page_design_style = $extra_styles = $page_title_text_align = "";
        $show_page_title = apply_filters('sf_page_heading_ns_pagetitle', 1);
        $remove_breadcrumbs = apply_filters('sf_page_heading_ns_removebreadcrumbs', 0);
        $page_title_height = 300;
        $page_title_style = "standard";
        // Shop page check
        if (function_exists('is_shop') && is_shop() || function_exists('is_product_category') && is_product_category()) {
            $shop_page = true;
        }
        // Defaults
        $options = get_option('sf_dante_options');
        $default_page_heading_bg_alt = $options['default_page_heading_bg_alt'];
        $default_show_page_heading = $options['default_show_page_heading'];
        $show_page_title = $default_show_page_heading;
        // Post meta
        if ($post && is_singular()) {
            $show_page_title = sf_get_post_meta($post->ID, 'sf_page_title', true);
            $remove_breadcrumbs = sf_get_post_meta($post->ID, 'sf_no_breadcrumbs', true);
            $page_title = sf_get_post_meta($post->ID, 'sf_page_title_one', true);
            $page_subtitle = sf_get_post_meta($post->ID, 'sf_page_subtitle', true);
            $remove_breadcrumbs = sf_get_post_meta($post->ID, 'sf_no_breadcrumbs', true);
            $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true);
            $page_title_bg = sf_get_post_meta($post->ID, 'sf_page_title_bg', true);
            $fancy_title_image = rwmb_meta('sf_page_title_image', 'type=image&size=full');
            $page_title_text_style = sf_get_post_meta($post->ID, 'sf_page_title_text_style', true);
            $fancy_title_image_url = "";
            foreach ($fancy_title_image as $detail_image) {
                $fancy_title_image_url = $detail_image['url'];
                break;
            }
        } else {
            $page_title_bg = $default_page_heading_bg_alt;
        }
        // Woo setup
        if ($shop_page) {
            $show_page_title = $options['woo_show_page_heading'];
            $page_title_style = $options['woo_page_heading_style'];
            $page_title_bg = $options['woo_page_heading_bg_alt'];
            $fancy_title_image = $options['woo_page_heading_image'];
            $page_title_text_style = $options['woo_page_heading_text_style'];
            $fancy_title_image_url = $fancy_title_image;
            if (is_product_category()) {
                $category = $wp_query->get_queried_object();
                $hero_id = get_woocommerce_term_meta($category->term_id, 'hero_id', true);
                if ($hero_id != "" && $hero_id != 0) {
                    $fancy_title_image_url = wp_get_attachment_url($hero_id, 'full');
                }
            }
        }
        // Page Title
        if ($page_title == "") {
            $page_title = get_the_title();
        }
        if ($page_title_height == "") {
            $page_title_height = apply_filters('sf_shop_fancy_page_height', 300);
        }
        // Page Title Hidden
        if (!$show_page_title) {
            $page_heading_el_class = "page-heading-hidden";
        }
        ?>
            
            <?php 
        if ($page_title_style == "fancy") {
            ?>
			<div class="page-heading fancy-heading col-sm-12 clearfix asset-bg <?php 
            echo $page_title_bg;
            ?>
 <?php 
            echo $page_title_text_style;
            ?>
-style fancy-image <?php 
            echo esc_attr($page_heading_el_class);
            ?>
" style="background-image: url(<?php 
            echo $fancy_title_image_url;
            ?>
);">
			<?php 
        } else {
            ?>
			<div class="page-heading <?php 
            echo esc_attr($page_heading_el_class);
            ?>
 clearfix asset-bg <?php 
            echo $page_title_bg;
            ?>
">
			<?php 
        }
        ?>
                <div class="container">
                    <div class="heading-text">

                        <?php 
        if (sf_woocommerce_activated() && is_woocommerce()) {
            ?>

                            <?php 
            if (is_product()) {
                ?>

                                <h1 class="entry-title" <?php 
                echo $article_heading_text;
                ?>
><?php 
                echo esc_attr($page_title);
                ?>
</h1>

                            <?php 
            } else {
                ?>

                                <h1 class="entry-title" <?php 
                echo $article_heading_text;
                ?>
><?php 
                woocommerce_page_title();
                ?>
</h1>

                            <?php 
            }
            ?>

                        <?php 
        } else {
            if (is_search()) {
                ?>

                            <?php 
                $s = get_search_query();
                $allsearch = new WP_Query("s={$s}&showposts=-1");
                $key = esc_html($s, 1);
                $count = $allsearch->post_count;
                wp_reset_query();
                ?>
                            <?php 
                if ($count == 1) {
                    ?>
                                <?php 
                    printf(__('<h1>%1$s result for <span>%2$s</span></h1>', 'swiftframework'), $count, get_search_query());
                    ?>
                            <?php 
                } else {
                    ?>
                                <?php 
                    printf(__('<h1>%1$s results for <span>%2$s</span></h1>', 'swiftframework'), $count, get_search_query());
                    ?>
                            <?php 
                }
                ?>

                        <?php 
            } else {
                if (is_category()) {
                    ?>

                            <h1 <?php 
                    echo $article_heading_text;
                    ?>
><?php 
                    single_cat_title();
                    ?>
</h1>

                        <?php 
                } else {
                    if (is_archive()) {
                        ?>

                            <?php 
                        /* If this is a tag archive */
                        if (is_tag()) {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("Posts tagged with", "swiftframework");
                            ?>
                                    &#8216;<?php 
                            single_tag_title();
                            ?>
&#8217;</h1>
                                <?php 
                            /* If this is a daily archive */
                        } elseif (is_day()) {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("Archive for", "swiftframework");
                            ?>
 <?php 
                            the_time('F jS, Y');
                            ?>
</h1>
                                <?php 
                            /* If this is a monthly archive */
                        } elseif (is_month()) {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("Archive for", "swiftframework");
                            ?>
 <?php 
                            the_time('F, Y');
                            ?>
</h1>
                                <?php 
                            /* If this is a yearly archive */
                        } elseif (is_year()) {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("Archive for", "swiftframework");
                            ?>
 <?php 
                            the_time('Y');
                            ?>
</h1>
                                <?php 
                            /* If this is an author archive */
                        } elseif (is_author()) {
                            ?>
                                <?php 
                            $author = get_userdata(get_query_var('author'));
                            ?>
                                <?php 
                            if (class_exists('ATCF_Campaigns')) {
                                ?>
                                    <h1 <?php 
                                echo $article_heading_text;
                                ?>
><?php 
                                _e("Projects by", "swiftframework");
                                ?>
 <?php 
                                echo esc_attr($author->display_name);
                                ?>
</h1>
                                <?php 
                            } else {
                                ?>
                                    <h1 <?php 
                                echo $article_heading_text;
                                ?>
><?php 
                                _e("Author archive for", "swiftframework");
                                ?>
 <?php 
                                echo esc_attr($author->display_name);
                                ?>
</h1>
                                <?php 
                            }
                            ?>
                                <?php 
                            /* If this is a paged archive */
                        } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("Blog Archives", "swiftframework");
                            ?>
</h1>
                            <?php 
                        } else {
                            ?>
                                <h1 <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            single_term_title();
                            ?>
</h1>
                            <?php 
                        }
                        ?>

                        <?php 
                    } else {
                        if (is_404()) {
                            ?>

                            <h1 class="entry-title" <?php 
                            echo $article_heading_text;
                            ?>
><?php 
                            _e("404", "swiftframework");
                            ?>
</h1>
						
						<?php 
                        } else {
                            if (is_home() && get_option('page_for_posts')) {
                                ?>

                            <h1 class="entry-title" <?php 
                                echo $article_heading_text;
                                ?>
><?php 
                                echo apply_filters('the_title', get_page(get_option('page_for_posts'))->post_title);
                                ?>
</h1>
						
                        <?php 
                            } else {
                                ?>

                            <h1 class="entry-title" <?php 
                                echo $article_heading_text;
                                ?>
><?php 
                                echo $page_title;
                                ?>
</h1>

                        <?php 
                            }
                        }
                    }
                }
            }
        }
        ?>
                        
                        <?php 
        if ($page_title_style == "fancy" && $page_subtitle != "") {
            ?>
                        	<h3><?php 
            echo $page_subtitle;
            ?>
</h3>
                        <?php 
        }
        ?>

                    </div>

					<?php 
        if (!$remove_breadcrumbs && $page_title_style != "fancy") {
            echo sf_breadcrumbs(true);
        }
        ?>

                </div>
            </div>
        <?php 
    }
Beispiel #29
0
    return;
}
?>

<?php 
// Availability
$availability = $product->get_availability();
if ($availability['availability']) {
    echo apply_filters('woocommerce_stock_html', '<p class="stock ' . esc_attr($availability['class']) . '">' . esc_html($availability['availability']) . '</p>', $availability['availability']);
}
?>

<?php 
// WooCommerce Min/Max Quanties Plugin
if (class_exists('WC_Min_Max_Quantities_Addons')) {
    $custom_min_qty = sf_get_post_meta(get_the_ID(), 'minimum_allowed_quantity', true);
    if ($custom_min_qty != "") {
        $minimum_allowed_quantity = $custom_min_qty;
    }
}
?>

<?php 
if ($product->is_in_stock()) {
    ?>

	<?php 
    do_action('woocommerce_before_add_to_cart_form');
    ?>

	<form class="cart" method="post" enctype='multipart/form-data'>
 protected function content($atts, $content = null)
 {
     $options = get_option('sf_dante_options');
     $title = $category = $item_class = $excerpt_length = $width = $offset = $el_class = $output = $filter = $items = $el_position = $item_count = '';
     extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "offset" => '0', "posts_order" => 'ASC', "category" => 'all', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'no_found_rows' => 1, 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $blog_items = new WP_Query($blog_args);
     $count = $columns = 0;
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     if (is_singular('portfolio')) {
         $sidebar_config = "no-sidebars";
     }
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $item_class = 'span2';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $item_class = 'span-bs-quarter';
         } else {
             $item_class = 'span3';
         }
     }
     if ($width == "1/4") {
         $columns = 1;
     } else {
         if ($width == "1/2") {
             $columns = 2;
         } else {
             if ($width == "3/4") {
                 $columns = 3;
             } else {
                 $columns = 4;
             }
         }
     }
     $items .= '<div class="carousel-wrap">';
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="blog-items carousel-items clearfix" data-columns="' . $columns . '">';
     while ($blog_items->have_posts()) {
         $blog_items->the_post();
         $item_title = get_the_title();
         $post_author = get_the_author_link();
         $post_date = get_the_date();
         $post_comments = get_comments_number();
         $post_category = get_the_category();
         $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = sf_get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $item_title = get_the_title();
         $post_permalink = get_permalink();
         $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = sf_excerpt($excerpt_length);
         }
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">';
         $items .= '<figure class="animated-overlay overlay-alt">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, 270, 202);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, 420, 315, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $link_config . '></a>';
                     if ($show_title == "yes") {
                         $items .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     } else {
                         $items .= '<figcaption><div class="thumb-info">';
                         $items .= '<h4>' . $item_title . '</h4>';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     }
                 }
             }
         }
         $items .= '</figure>';
         $items .= '<div class="details-wrap">';
         // POST TITLE
         if ($show_title == "yes") {
             $items .= '<h5><a href="' . $post_permalink . '">' . $item_title . '</a></h5>';
         }
         if ($show_details == "yes") {
             $items .= '<div class="post-details">' . sprintf(__('%1$s - %2$s', 'swiftframework'), $post_date, sf_get_comments_number($post->ID)) . '</div>';
         }
         // POST EXCERPT
         if ($excerpt_length != "0" && $show_excerpt == "yes") {
             $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
         }
         $items .= '</div>';
         $items .= '</div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     $items .= '<a href="#" class="carousel-prev"><i class="ss-navigateleft"></i></a><a href="#" class="carousel-next"><i class="ss-navigateright"></i></a>';
     $options = get_option('sf_dante_options');
     if ($options['enable_swipe_indicators']) {
         $items .= '<div class="sf-swipe-indicator"></div>';
     }
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_posts_carousel_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap alt-nav">';
     if ($title != '') {
         if ($width == "col-sm-12") {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>';
         } else {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading"><span>' . $title . '</span></h3></div>';
         }
     }
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }