function lip_display_love_link($content) { global $lip_options, $post; // only show the link when user is logged in and on a singular page if (is_singular()) { // setup the Love It link text if (isset($lip_options['love_it_text']) && $lip_options['love_it_text'] != '') { $link_text = $lip_options['love_it_text']; } else { $link_text = __('Love It', 'love_it'); } // setup the Already Loved This text if (isset($lip_options['already_loved']) && $lip_options['already_loved'] != '') { $already_loved = $lip_options['already_loved']; } else { $already_loved = __('You have loved this', 'love_it'); } $link = lip_love_it_link($post->ID, $link_text, $already_loved, false); // append our "Love It" link to the item content. if (isset($lip_options['post_position']) && $lip_options['post_position'] == 'top') { $content = $link . $content; } else { $content = $content . $link; } } return $content; }
/** * Manually output the link where we want it */ function marketify_li_love_link() { global $post; if (!is_object($post)) { return; } if (class_exists('Love_It_Pro')) { echo lip_love_it_link($post->ID, '', ''); } else { echo li_love_link(); } }
function sf_gallery_share() { $image = wp_get_attachment_url(get_post_thumbnail_id()); $share_text = apply_filters('sf_post_share_text', __("Share this", "swiftframework")); ?> <div class="gallery-share"> <div class="article-divider"></div> <div class="article-share" data-buttontext="<?php echo esc_attr($share_text); ?> " data-image="<?php echo esc_url($image); ?> "></div> <?php if (function_exists('lip_love_it_link')) { lip_love_it_link(get_the_ID(), true, 'text'); } ?> </div> <?php }
function lip_display_love_link($content) { global $lip_options, $post; if (is_singular()) { if (isset($lip_options['love_it_text']) && $lip_options['love_it_text'] != '') { $link_text = $lip_options['love_it_text']; } else { // $link_text = __('Love It', 'love_it'); $link_text = 'Like This'; } if (isset($lip_options['already_loved']) && $lip_options['already_loved'] != '') { $already_loved = $lip_options['already_loved']; } else { $already_loved = __('You have already liked this', 'love_it'); } $link = lip_love_it_link($post->ID, $link_text, $already_loved, false); if (isset($lip_options['post_position']) && $lip_options['post_position'] == 'top') { $content = $link . $content; } else { $content = $content . $link; } } return $content; }
function sf_get_post_item($postID, $blog_type, $show_title = "yes", $show_excerpt = "yes", $show_details = "yes", $excerpt_length = "20", $content_output = "excerpt", $show_read_more = "yes", $fullwidth = "no") { $post_item = $image_id = ""; global $sf_options, $sf_sidebar_config; $single_author = $sf_options['single_author']; $remove_dates = $sf_options['remove_dates']; $post_links_match_thumb = false; if (isset($sf_options['post_links_match_thumb'])) { $post_links_match_thumb = $sf_options['post_links_match_thumb']; } $post_format = get_post_format($postID); if ($post_format == "") { $post_format = 'standard'; } if ($blog_type == "masonry") { $content_output = "excerpt"; } $comments_icon = apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); $link_icon = apply_filters('sf_link_icon', '<i class="ss-link"></i>'); $sticky_icon = apply_filters('sf_sticky_icon', '<i class="ss-bookmark"></i>'); $post_type = get_post_type($postID); $post_title = get_the_title(); $post_author = get_the_author(); $post_date = get_the_date(); $post_date_str = get_the_date('Y-m-d'); $post_categories = get_the_category_list(', '); $post_comments = get_comments_number(); $post_permalink = get_permalink(); $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true); $post_excerpt = ''; if ($content_output == "excerpt") { if ($custom_excerpt != '') { $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length); } else { if ($post_format == "quote") { $post_excerpt = sf_get_the_content_with_formatting(); } else { $post_excerpt = sf_excerpt($excerpt_length); } } } else { $post_excerpt = sf_get_the_content_with_formatting(); } if ($post_format == "chat") { $post_excerpt = sf_content(40); } else { if ($post_format == "audio") { $post_excerpt = do_shortcode(get_the_content()); } else { if ($post_format == "video") { $content = get_the_content(); $content = apply_filters('the_content', $content); $post_excerpt = $content; } else { if ($post_format == "link") { $content = get_the_content(); $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($postID, 'sf_thumbnail_type', true); $download_button = sf_get_post_meta($postID, 'sf_download_button', true); $download_file = sf_get_post_meta($postID, 'sf_download_file', true); $download_text = apply_filters('sf_post_download_text', __("Download", "swiftframework")); $download_shortcode = sf_get_post_meta($postID, 'sf_download_shortcode', true); if ($blog_type == "masonry") { $post_item .= apply_filters('sf_before_masonry_post_thumb', ''); } // THUMBNAIL MEDIA TYPE SETUP $item_figure = ""; if ($thumb_type != "none") { $item_figure .= sf_post_thumbnail($blog_type, $fullwidth); } // DETAILS SETUP $item_details = ""; if ($single_author && !$remove_dates) { $item_details .= '<div class="blog-item-details">' . sprintf(__('In %1$s on <time datetime="%2$s">%3$s</time>', 'swiftframework'), $post_categories, $post_date_str, $post_date) . '</div>'; } else { if (!$remove_dates) { $item_details .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s on <time datetime="%4$s">%5$s</time>', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories, $post_date_str, $post_date) . '</div>'; } else { if (!$single_author) { $item_details .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories) . '</div>'; } } } $mini_details = ""; if ($single_author && !$remove_dates) { $mini_details .= '<div class="mini-item-details">' . sprintf(__('in %1$s / <time datetime="%2$s">%3$s</time> / %4$s comments', 'swiftframework'), $post_categories, $post_date_str, $post_date, $post_comments) . '</div>'; } else { if (!$remove_dates) { $mini_details .= '<div class="mini-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s / <time datetime="%4$s">%5$s</time> / %6$s comments', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories, $post_date_str, $post_date, $post_comments) . '</div>'; } else { if (!$single_author) { $mini_details .= '<div class="mini-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> / %3$s / %4$s comments', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories, $post_comments) . '</div>'; } } } // BOLD STYLING if ($blog_type == "bold") { $post_item .= '<div class="bold-item-wrap">'; if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") { $post_item .= '<h1 itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_title . '</a></h1>'; } else { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt" itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_excerpt . '</a></div>'; } else { if ($post_format == "link") { $post_item .= '<h3 itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_title . '</a></h3>'; } } } if ($show_excerpt == "yes" && $post_format != "quote") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } if ($show_details == "yes") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf(__('<span>In %1$s</span> <time class="date" datetime="%2$s">%3$s</time>', 'swiftframework'), $post_categories, $post_date_str, $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> <span>in %3$s</span> <time class="date" datetime="%4$s">%5$s</time>', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories, $post_date_str, $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> <span>in %3$s</span>', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories) . '</div>'; } } } } $post_item .= '</div>'; } else { if ($blog_type == "masonry") { if ($item_figure != "") { $post_item .= $item_figure; } $post_item .= '<div class="details-wrap">'; $post_item .= '<a ' . $post_permalink_config . '></a>'; if ($post_type == "post") { if ($post_format == "standard") { $post_item .= '<h6>' . __("Article", "swiftframework") . '</h6>'; } else { $post_item .= '<h6>' . $post_format . '</h6>'; } } else { $post_item .= '<h6>' . $post_type . '</h6>'; } if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") { $post_item .= '<h2 itemprop="name headline">' . $post_title . '</h2>'; } else { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt" itemprop="name headline">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<h3 itemprop="name headline">' . $post_title . '</h3>'; } } } if (sf_theme_opts_name() == "sf_atelier_options") { if ($show_details == "yes") { $post_item .= sf_get_post_details($postID); } if ($show_excerpt == "yes" && $post_format != "quote") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } if ($show_read_more == "yes") { if ($download_button) { if ($download_shortcode != "") { $post_item .= do_shortcode($download_shortcode); } else { $post_item .= '<a href="' . wp_get_attachment_url($download_file) . '" class="download-button read-more-button">' . $download_text . '</a>'; } } $post_item .= '<a class="read-more-button" href="' . get_permalink() . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"> <svg version="1.1" class="comments-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="none" class="stroke" stroke="#252525" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M13.958,24H2.021C1.458,24,1,23.541,1,22.975V2.025C1,1.459,1.458,1,2.021,1h25.957C28.542,1,29,1.459,29,2.025v20.949 C29,23.541,28.542,24,27.979,24H21v5L13.958,24z"/> </svg> <span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), false); } $post_item .= '</div>'; } } else { if ($show_excerpt == "yes" && $post_format != "quote") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } if ($show_details == "yes") { $post_item .= sf_get_post_details($postID); $post_item .= '<div class="comments-likes">'; if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area">' . $comments_icon . '<span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link($postID, false); } $post_item .= '</div>'; } } $post_item .= '</div>'; // MINI STYLING } else { if ($blog_type == "mini") { $post_item .= '<div class="mini-blog-item-wrap clearfix">'; if ($post_format == "quote" || $post_format == "link") { $post_item .= '<div class="mini-alt-wrap">'; } else { $post_item .= $item_figure; } $post_item .= '<div class="blog-details-wrap clearfix">'; if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") { $post_item .= '<h3 itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_title . '</a></h3>'; } if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") { if (sf_theme_opts_name() == "sf_atelier_options") { $post_item .= $mini_details; } else { $post_item .= $item_details; } } if ($show_excerpt == "yes") { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<div class="link-excerpt heading-font" itemprop="description">' . $link_icon . $post_excerpt . '</div>'; } else { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } } } if (is_sticky()) { $post_item .= '<div class="sticky-post-icon">' . $sticky_icon . '</div>'; } if ($show_read_more == "yes") { if ($download_button) { if ($download_shortcode != "") { $post_item .= do_shortcode($download_shortcode); } else { $post_item .= '<a href="' . wp_get_attachment_url($download_file) . '" class="download-button read-more-button">' . $download_text . '</a>'; } } $post_item .= '<a class="read-more-button" href="' . get_permalink() . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if ($post_format == "quote" || $post_format == "link") { $post_item .= $item_details; } if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area">' . $comments_icon . '<span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link($postID, false); } $post_item .= '</div>'; } $post_item .= '</div>'; if ($post_format == "quote" || $post_format == "link") { $post_item .= '</div>'; } $post_item .= '</div>'; // STANDARD STYLING } else { if (sf_theme_opts_name() == "sf_atelier_options" && $show_details == "yes" && $blog_type != "timeline") { $post_item .= '<div class="side-details">'; if (!$remove_dates) { $post_date_month = get_the_date('M'); $post_date_day = get_the_date('d'); $post_date_year = get_the_date('Y'); $post_item .= '<div class="side-post-date narrow-date-block" itemprop="datePublished"><span class="month">' . $post_date_month . '</span><span class="day">' . $post_date_day . '</span><span class="year">' . $post_date_year . '</span></div>'; } if (comments_open()) { $post_item .= '<div class="comments-wrapper narrow-date-block"><a href="' . $post_permalink . '#comment-area"> <svg version="1.1" class="comments-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="none" class="stroke" stroke="#252525" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M13.958,24H2.021C1.458,24,1,23.541,1,22.975V2.025C1,1.459,1.458,1,2.021,1h25.957C28.542,1,29,1.459,29,2.025v20.949 C29,23.541,28.542,24,27.979,24H21v5L13.958,24z"/> </svg> <span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), false, '', 'narrow-date-block'); } $post_item .= '</div>'; $post_item .= '<div class="post-content-wrap">'; } if ($show_details == "yes" && $blog_type == "timeline") { $post_item .= '<span class="standard-post-date" itemprop="datePublished">' . $post_date . '</span>'; } $post_item .= $item_figure; if ($item_figure == "") { $post_item .= '<div class="standard-post-content no-thumb clearfix">'; // open standard-post-content } else { $post_item .= '<div class="standard-post-content clearfix">'; // open standard-post-content } if ($show_title == "yes" && $post_format != "link" && $post_format != "quote") { $post_item .= '<h1 itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_title . '</a></h1>'; } if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") { if (sf_theme_opts_name() == "sf_atelier_options") { if (!$single_author) { $post_item .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_categories) . '</div>'; } } else { $post_item .= $item_details; } } if ($show_excerpt == "yes") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<div class="link-excerpt heading-font" itemprop="description">' . $link_icon . $post_excerpt . '</div>'; } } } if (is_sticky()) { $post_item .= '<div class="sticky-post-icon">' . $sticky_icon . '</div>'; } if ($download_button) { if ($download_shortcode != "") { $post_item .= do_shortcode($download_shortcode); } else { $post_item .= '<a href="' . wp_get_attachment_url($download_file) . '" class="download-button read-more-button">' . $download_text . '</a>'; } } if ($show_read_more == "yes" && $post_format != "quote" && $post_format != "link") { $post_item .= '<a class="read-more-button" href="' . get_permalink() . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if ($post_format == "quote" || $post_format == "link") { $post_item .= $item_details; } if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area">' . $comments_icon . '<span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), false); } $post_item .= '</div>'; } $post_item .= '</div>'; // close standard-post-content if (sf_theme_opts_name() == "sf_atelier_options" && $show_details == "yes" && $blog_type != "timeline") { $post_item .= '</div>'; // close post-content-wrap } // $post_item = sf_get_content_view( 'post', 'standard', true ); // return $post_item; } } } return $post_item; }
function sf_get_standard_post($postID, $thumb_type, $fullwidth, $show_title, $show_excerpt, $show_details, $show_read_more, $content_output, $excerpt_length) { global $sf_options; $single_author = $sf_options['single_author']; $remove_dates = $sf_options['remove_dates']; // Get Post Object $post_object = sf_build_post_object($postID, $content_output, $excerpt_length); // Link config $post_links_match_thumb = false; if (isset($sf_options['post_links_match_thumb'])) { $post_links_match_thumb = $sf_options['post_links_match_thumb']; } $post_permalink_config = 'href="' . $post_object['permalink'] . '" class="link-to-post"'; if ($post_links_match_thumb) { $link_config = sf_post_item_link(); $post_permalink_config = $link_config['config']; } // Variable setup $post_item = ""; $comments_icon = apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); $link_icon = apply_filters('sf_link_icon', '<i class="ss-link"></i>'); $sticky_icon = apply_filters('sf_sticky_icon', '<i class="ss-bookmark"></i>'); // THUMBNAIL MEDIA TYPE SETUP $item_figure = ""; if ($thumb_type != "none") { $item_figure .= sf_post_thumbnail("timeline", $fullwidth); } // DETAILS SETUP $item_details = ""; if ($single_author && !$remove_dates) { $item_details .= '<div class="blog-item-details">' . sprintf(__('In %1$s on <time datetime="%2$s">%3$s</time>', 'swiftframework'), $post_object['categories'], $post_object['date_str'], $post_object['date']) . '</div>'; } else { if (!$remove_dates) { $item_details .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s on <time datetime="%4$s">%5$s</time>', 'swiftframework'), $post_object['author'], get_author_posts_url(get_the_author_meta('ID')), $post_object['categories'], $post_object['date_str'], $post_object['date']) . '</div>'; } else { if (!$single_author) { $item_details .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s', 'swiftframework'), $post_object['author'], get_author_posts_url(get_the_author_meta('ID')), $post_object['categories']) . '</div>'; } } } // Open output if (sf_theme_opts_name() == "sf_atelier_options" && $show_details == "yes") { $post_item .= '<div class="side-details">'; if (!$remove_dates) { $post_date_month = get_the_date('M'); $post_date_day = get_the_date('d'); $post_date_year = get_the_date('Y'); $post_item .= '<div class="side-post-date narrow-date-block" itemprop="datePublished"><span class="month">' . $post_date_month . '</span><span class="day">' . $post_date_day . '</span><span class="year">' . $post_date_year . '</span></div>'; } if (comments_open()) { $post_item .= '<div class="comments-wrapper narrow-date-block"><a href="' . $post_object['permalink'] . '#comment-area"> <svg version="1.1" class="comments-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="none" class="stroke" stroke="#252525" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M13.958,24H2.021C1.458,24,1,23.541,1,22.975V2.025C1,1.459,1.458,1,2.021,1h25.957C28.542,1,29,1.459,29,2.025v20.949 C29,23.541,28.542,24,27.979,24H21v5L13.958,24z"/> </svg> <span>' . $post_object['comments'] . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), false, '', 'narrow-date-block'); } $post_item .= '</div>'; $post_item .= '<div class="post-content-wrap">'; } $post_item .= $item_figure; if ($item_figure == "") { $post_item .= '<div class="standard-post-content no-thumb clearfix">'; // open standard-post-content } else { $post_item .= '<div class="standard-post-content clearfix">'; // open standard-post-content } if ($show_title == "yes" && $post_object['format'] != "link" && $post_object['format'] != "quote") { $post_item .= '<h1 itemprop="name headline"><a ' . $post_permalink_config . '>' . $post_object['title'] . '</a></h1>'; } if ($show_details == "yes" && $post_object['format'] != "quote" && $post_object['format'] != "link") { if (sf_theme_opts_name() == "sf_atelier_options") { if (!$single_author) { $post_item .= '<div class="blog-item-details">' . sprintf(__('<span class="author">By <a href="%2$s" rel="author" itemprop="author">%1$s</a></span> in %3$s', 'swiftframework'), $post_object['author'], get_author_posts_url(get_the_author_meta('ID')), $post_object['categories']) . '</div>'; } } else { $post_item .= $item_details; } } if ($show_excerpt == "yes") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_object['excerpt'] . '</div>'; } else { if ($post_object['format'] == "quote") { $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_object['excerpt'] . '</div>'; } else { if ($post_object['format'] == "link") { $post_item .= '<div class="link-excerpt heading-font" itemprop="description">' . $link_icon . $post_object['excerpt'] . '</div>'; } } } if (is_sticky()) { $post_item .= '<div class="sticky-post-icon">' . $sticky_icon . '</div>'; } if ($post_object['download_button']) { if ($post_object['download_shortcode'] != "") { $post_item .= do_shortcode($post_object['download_shortcode']); } else { $post_item .= '<a href="' . wp_get_attachment_url($post_object['download_file']) . '" class="download-button read-more-button">' . $post_object['download_text'] . '</a>'; } } if ($show_read_more == "yes" && $post_object['format'] != "quote" && $post_object['format'] != "link") { $post_item .= '<a class="read-more-button" href="' . $post_object['permalink'] . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if ($post_object['format'] == "quote" || $post_object['format'] == "link") { $post_item .= $item_details; } if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_object['permalink'] . '#comment-area">' . $comments_icon . '<span>' . $post_object['comments'] . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), false); } $post_item .= '</div>'; } $post_item .= '</div>'; // close standard-post-content if (sf_theme_opts_name() == "sf_atelier_options" && $show_details == "yes") { $post_item .= '</div>'; // close post-content-wrap } // Return return $post_item; }
echo $post_permalink; ?> '#comment-area"><?php echo $comments_icon; ?> <span><?php echo $post_comments; ?> </span></a></div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link($post_id, false); } ?> </div> <?php } ?> </div> <?php if ($post_format == "quote" || $post_format == "link") { ?>
function sf_portfolio_social_links() { global $post; $page_title = get_the_title(); $page_permalink = get_the_permalink(); $media_type = $media_image = ''; $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true); if ($use_thumb_content) { $media_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true); $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); } else { $media_type = sf_get_post_meta($post->ID, 'sf_detail_type', true); $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full'); } foreach ($media_image as $detail_image) { $media_image_url = $detail_image['url']; $share_image_url = $media_image_url; break; } if (!$media_image) { $media_image = get_post_thumbnail_id(); $media_image_url = wp_get_attachment_url($media_image, 'full'); $share_image_url = $media_image_url; } ?> <div class="share-links clearfix"> <ul class="bar-styling"> <li class="sf-love"> <div class="comments-likes"> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } ?> </div> </li> <li class="facebook"><a href="http://www.facebook.com/sharer.php?u=<?php echo $page_permalink; ?> " class="product_share_facebook" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=220,width=600');return false;"><i class="fa-facebook"></i></a></li> <li class="twitter"><a href="https://twitter.com/share?url=<?php echo $page_permalink; ?> &text=<?php echo urlencode(get_the_title()); ?> " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=260,width=600');return false;" class="product_share_twitter"><i class="fa-twitter"></i></a></li> <li class="google-plus"><a href="https://plus.google.com/share?url=<?php echo $page_permalink; ?> " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa-google-plus"></i></a></li> <?php if ($share_image_url != "") { ?> <li class="pinterest"><a href="//pinterest.com/pin/create/button/?url=<?php echo $page_permalink; ?> &media=<?php echo $share_image_url; ?> &description=<?php echo $page_title; ?> " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=320,width=600');return false;" class="product_share_pinterest"><i class="fa-pinterest"></i></a></li> <?php } else { ?> <li class="pinterest"><a href="//pinterest.com/pin/create/button/?url=<?php echo $page_permalink; ?> &description=<?php echo $page_title; ?> " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=320,width=600');return false;" class="product_share_pinterest"><i class="fa-pinterest"></i></a></li> <?php } ?> <li class="mail"><a href="mailto:?subject=<?php echo urlencode(get_the_title()); ?> &body=<?php echo strip_tags(get_the_excerpt()); ?> <?php $page_permalink; ?> " class="product_share_email"><i class="ss-mail"></i></a></li> </ul> </div> <?php }
protected function content($atts, $content = null) { $options = get_option('sf_dante_options'); $title = $width = $excerpt_length = $item_class = $offset = $el_class = $output = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_columns' => '3', "item_count" => '4', "category" => '', "offset" => 0, "posts_order" => 'ASC', "excerpt_length" => '20', '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; $args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order); $blog_items = query_posts($args); if ($item_columns == "1") { $item_class = 'col-sm-12'; } else { if ($item_columns == "2") { $item_class = 'col-sm-6'; } else { if ($item_columns == "3") { $item_class = 'col-sm-4'; } else { $item_class = 'col-sm-3'; } } } if (have_posts()) { $items .= '<ul class="recent-posts row clearfix">'; while (have_posts()) { the_post(); $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'); 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'); } $item_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_permalink = get_permalink(); $post_comments = get_comments_number(); $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); } $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); $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full'); $link_config = ""; 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="view"'; $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="view"'; $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 .= '<li itemscope class="recent-post ' . $item_class . ' clearfix">'; $items .= '<figure class="animated-overlay overlay-alt">'; 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_type != "none") { $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>'; $items .= '<figcaption><div class="thumb-info thumb-info-alt">'; $items .= '<i class="' . $item_icon . '"></i>'; $items .= '</div></figcaption>'; } } } $items .= '</figure>'; $items .= '<div class="details-wrap">'; $items .= '<h5><a href="' . $post_permalink . '">' . $item_title . '</a></h5>'; if ($excerpt_length != "0") { $items .= '<div class="excerpt">' . $post_excerpt . '</div>'; } $items .= '</div>'; $items .= '<div class="post-item-details clearfix">'; $items .= '<span class="post-date">' . $post_date . '</span>'; $items .= '<div class="comments-likes">'; if (comments_open()) { $items .= '<a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a> '; } if (function_exists('lip_love_it_link')) { $items .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } $items .= '</div>'; $items .= '</div>'; $items .= '</li>'; } wp_reset_query(); $items .= '</ul>'; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="spb_recent_posts_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper recent-posts-wrap">'; $output .= $title != '' ? "\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); return $output; }
function sf_post_info() { global $post, $sf_options; $author_info = sf_get_post_meta($post->ID, 'sf_author_info', true); $post_date = get_the_date(); $remove_dates = $sf_options['remove_dates']; $author_id = $post->post_author; $author_name = get_the_author_meta('display_name', $author_id); $author_url = get_author_posts_url($author_id); $post_permalink = get_permalink(); $post_comments = get_comments_number(); if (is_singular('directory')) { $author_info = true; } $post_categories = get_the_category_list(', '); ?> <?php if ($author_info) { ?> <div class="post-info clearfix"> <?php } else { ?> <div class="post-info post-info-fw clearfix"> <?php } ?> <?php if ($author_info) { ?> <div class="author-info-wrap clearfix"> <div class="author-avatar"><?php if (function_exists('get_avatar')) { echo get_avatar(get_the_author_meta('ID'), '140'); } ?> </div> <div class="author-bio"> <div class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><h3 class="vcard author"><span itemprop="name" class="fn"><?php echo esc_attr($author_name); ?> </span> </h3></div> <div class="author-bio-text"> <?php the_author_meta('description'); ?> <?php echo sprintf(__('<a href="%2$s" class="author-more-link">More by %1$s <i class="fa-long-arrow-right"></i></a>', 'swiftframework'), $author_name, $author_url); ?> </div> </div> </div> <?php } ?> <div class="post-details-wrap"> <?php echo sf_social_share(); ?> <?php if (has_tag()) { ?> <div class="tags-wrap"> <span class="tags-title"><?php _e("Tags", "swiftframework"); ?> </span> <ul class="wp-tag-cloud"><?php the_tags('<li>', '</li><li>', '</li>'); ?> </ul> </div> <?php } ?> <div class="comments-likes"> <?php if (comments_open()) { ?> <div class="comments-wrapper"> <a href="#comment-area" class="smooth-scroll-link"> <svg version="1.1" class="comments-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="none" class="stroke" stroke="#252525" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M13.958,24H2.021C1.458,24,1,23.541,1,22.975V2.025C1,1.459,1.458,1,2.021,1h25.957C28.542,1,29,1.459,29,2.025v20.949 C29,23.541,28.542,24,27.979,24H21v5L13.958,24z"/> </svg> <span><?php echo $post_comments; ?> </span> </a> </div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { lip_love_it_link(get_the_ID(), true, 'text'); } ?> </div> </div> </div> <?php }
} ?> </li> </ul> </div><!--/guide details--> </div><!--/widget copy--> </div><!-- widget-side--> <div class="widget-side" style="padding-top:1.25em !important;"> <div class="widget-copy"> <div class="guide-details"> <?php if (lip_user_has_loved_post($current_user->ID, $post->ID)) { echo '<a id="likedthis" title="See your other Likes" href="' . $app_url . '/author/' . $current_user->user_login . '" class="likedthis nhline">You like this</a>'; } else { lip_love_it_link(); } // Turn off when working locally - only works hosted echo '<div class="jetpack-guide-single">'; echo sharing_display(); echo '</div>'; ?> <br/><a class="nhline" href="#leavecomment" title="Add Your Comment">Add a Comment</a> </div><!--/ guide details--> </div> </div><!-- widget-side--> <div class="widget-side"> <h5 class="widget-title">Explore More In</h5> <div class="widget-copy"> <div class="guide-details">
function sf_galleries($display_type, $link_type, $fullwidth, $gutters, $columns, $show_title, $show_subtitle, $show_excerpt, $excerpt_length, $item_count, $category, $pagination, $sidebars, $hover_style) { /* OUTPUT VARIABLE ================================================== */ $gallery_items_output = ""; $count = 0; /* CATEGORY SLUG MODIFICATION ================================================== */ if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); /* GALLERIES 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; } $galleries_args = array('post_type' => 'galleries', 'post_status' => 'publish', 'paged' => $paged, 'gallery-category' => $category_slug, 'posts_per_page' => $item_count); $galleries_items = new WP_Query($galleries_args); /* LIST CLASS CONFIG ================================================== */ $list_class = ''; if ($display_type == "masonry" || $display_type == "masonry-gallery") { $list_class .= 'masonry-items filterable-items col-' . $columns . ' row clearfix'; } else { if ($display_type == "gallery") { $list_class .= 'gallery-galleries filterable-items col-' . $columns . ' row clearfix'; } else { $list_class .= 'standard-galleries filterable-items col-' . $columns . ' row clearfix'; } } // Full width if ($fullwidth == "yes") { $list_class .= ' galleries-full-width'; } // Gutters if ($gutters == "no") { $list_class .= ' no-gutters'; } else { $list_class .= ' gutters'; } // Thumb Type if ($hover_style == "default" && function_exists('sf_get_thumb_type')) { $list_class .= ' ' . sf_get_thumb_type(); } else { $list_class .= ' thumbnail-' . $hover_style; } /* ITEMS OUTPUT ================================================== */ global $sf_options; $gallery_items_output .= '<ul class="gallery-items ' . $list_class . '">' . "\n"; while ($galleries_items->have_posts()) { $galleries_items->the_post(); /* META VARIABLES ================================================== */ $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true); $item_title = get_the_title(); $item_subtitle = sf_get_post_meta($post->ID, 'sf_gallery_subtitle', true); $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); } $post_terms = get_the_terms($post->ID, 'gallery-category'); $term_slug = " "; if (!empty($post_terms)) { foreach ($post_terms as $post_term) { $term_slug = $term_slug . $post_term->slug . ' '; } } /* COLUMN VARIABLE CONFIG ================================================== */ $item_class = ""; if ($columns == "1") { $item_class = "col-sm-12 "; } else { if ($columns == "2") { $item_class = "col-sm-6 "; } else { if ($columns == "3") { $item_class = "col-sm-4 "; } else { if ($columns == "4") { $item_class = "col-sm-3 "; } else { if ($columns == "5") { $item_class = "col-sm-sf-5 "; } } } } } /* DISPLAY TYPE CONFIG ================================================== */ if ($display_type == "masonry" || $display_type == "masonry-gallery") { $item_class .= "masonry-item masonry-gallery-item"; } else { if ($display_type == "gallery") { $item_class .= "gallery-item "; } else { $item_class .= "standard "; } } /* LINK TYPE CONFIG ================================================== */ $gallery_id = rand(0, 10000); $item_link = sf_gallery_item_link($link_type, $gallery_id); /* ITEM OUTPUT ================================================== */ $gallery_items_output .= '<li itemscope itemtype="http://schema.org/CreativeWork" data-id="id-' . $count . '" class="clearfix gallery-item ' . $item_class . ' ' . $term_slug . '">' . "\n"; /* THUMBNAIL CONFIG ================================================== */ if ($thumb_type != "none") { $gallery_items_output .= sf_gallery_thumbnail($display_type, $link_type, $columns, $gutters, $count, $gallery_id); } if ($display_type != "gallery" && $display_type != "masonry-gallery") { $gallery_items_output .= '<div class="gallery-item-details">' . "\n"; if ($show_title == "yes") { $gallery_items_output .= '<div class="comments-likes">'; if (function_exists('lip_love_it_link')) { $gallery_items_output .= lip_love_it_link(get_the_ID(), false); } $gallery_items_output .= '</div>'; $gallery_items_output .= '<h3 class="gallery-item-title" itemprop="name headline"><a href="' . get_permalink() . '">' . $item_title . '</a></h3>' . "\n"; } if ($show_subtitle == "yes" && $item_subtitle) { $gallery_items_output .= '<h5 class="gallery-subtitle" itemprop="name alternativeHeadline">' . $item_subtitle . '</h5>' . "\n"; } if ($show_excerpt == "yes") { $gallery_items_output .= '<div class="gallery-item-excerpt" itemprop="description">' . $post_excerpt . '</div>' . "\n"; } $gallery_items_output .= '</div>' . "\n"; } if ($item_link["script"] != "") { $gallery_items_output .= $item_link["script"]; } $gallery_items_output .= '</li>' . "\n"; $count++; } wp_reset_query(); wp_reset_postdata(); $gallery_items_output .= '</ul>' . "\n"; /* PAGINATION OUTPUT ================================================== */ if ($pagination == "yes") { if ($display_type == "masonry" || $display_type == "masonry-gallery") { $gallery_items_output .= '<div class="pagination-wrap masonry-pagination">'; } else { $gallery_items_output .= '<div class="pagination-wrap">'; } $gallery_items_output .= pagenavi($galleries_items); $gallery_items_output .= '</div>'; } /* FUNCTION OUTPUT ================================================== */ return $gallery_items_output; }
function sf_campaign_info() { global $post; $campaign = new ATCF_Campaign($post->ID); $categories = get_the_term_list($post->ID, 'download_category', '', ', ', ''); $author = get_user_by('id', $post->post_author); ?> <div class="author-info-wrap clearfix"> <div class="author-avatar"><?php if (function_exists('get_avatar')) { echo get_avatar(get_the_author_meta('ID'), '140'); } ?> </div> <div class="author-bio"> <div class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><h3><a itemprop="name" href="<?php echo get_author_posts_url($author->ID, $author->user_nicename); ?> "><?php the_author_meta('display_name'); ?> </a> </h3></div> <div class="author-bio-text"> <?php the_author_meta('description'); ?> </div> <?php if ($campaign->contact_email() != "") { ?> <a href="mailto:<?php echo sanitize_email($campaign->contact_email()); ?> " class="sf-button contact-author accent"><?php _e('Contact Author', 'swiftframework'); ?> </a> <?php } ?> </div> </div> <div class="campaign-info post-info clearfix"> <?php if ($categories) { ?> <div class="categories-wrap"><?php _e("Categories:", "swiftframework"); ?> <span class="categories"><?php echo esc_attr($categories); ?> </span></div> <?php } ?> <?php if (has_tag()) { ?> <div class="tags-wrap"><?php _e("Tags:", "swiftframework"); ?> <span class="tags"><?php the_tags(''); ?> </span></div> <?php } ?> <div class="comments-likes"> <?php if (comments_open()) { ?> <div class="comments-wrapper"><a href="#comments" class="smooth-scroll-link"> <?php echo apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); ?> <span><?php comments_number(__('0 Comments', 'swiftframework'), __('1 Comment', 'swiftframework'), __('% Comments', 'swiftframework')); ?> </span></a> </div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { lip_love_it_link(get_the_ID(), true, 'text'); } ?> </div> </div> <?php }
function sf_post_info() { global $post, $sf_options; $author_info = sf_get_post_meta($post->ID, 'sf_author_info', true); $post_date = get_the_date(); $remove_dates = $sf_options['remove_dates']; if (is_singular('directory')) { $author_info = true; } $post_categories = get_the_category_list(', '); ?> <?php if ($author_info) { ?> <div class="author-info-wrap clearfix"> <div class="author-avatar"><?php if (function_exists('get_avatar')) { echo get_avatar(get_the_author_meta('ID'), '140'); } ?> </div> <div class="author-bio"> <div class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><h3 class="vcard author"><span itemprop="name" class="fn"><?php the_author_meta('display_name'); ?> </span> </h3></div> <div class="author-bio-text"> <?php the_author_meta('description'); ?> </div> </div> </div> <?php } ?> <?php if ($author_info) { ?> <div class="post-info clearfix"> <?php } else { ?> <div class="post-info post-info-fw clearfix"> <?php } ?> <?php if (!$remove_dates) { ?> <div class="post-date"><?php echo $post_date; ?> </div> <?php } ?> <?php if ($post_categories) { ?> <div class="categories-wrap"><?php _e("Categories:", "swiftframework"); ?> <span class="categories"><?php echo $post_categories; ?> </span> </div> <?php } ?> <?php if (has_tag()) { ?> <div class="tags-wrap"><?php _e("Tags:", "swiftframework"); ?> <span class="tags"><?php the_tags(''); ?> </span></div> <?php } ?> <div class="comments-likes"> <?php if (comments_open()) { ?> <div class="comments-wrapper"><a href="#comments" class="smooth-scroll-link"><?php echo apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); ?> <span><?php comments_number(__('0 Comments', 'swiftframework'), __('1 Comment', 'swiftframework'), __('% Comments', 'swiftframework')); ?> </span></a> </div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { lip_love_it_link(get_the_ID(), true, 'text'); } ?> </div> </div> <?php }
function sf_portfolio_items($atts) { extract(shortcode_atts(array('title' => '', 'display_type' => '', 'multi_size_ratio' => '', 'fullwidth' => '', 'gutters' => '', 'columns' => '', 'show_title' => '', 'show_subtitle' => '', 'show_excerpt' => '', 'hover_show_excerpt' => '', 'excerpt_length' => '', 'item_count' => '', 'category' => '', 'order' => '', 'order_by' => '', 'portfolio_filter' => '', 'pagination' => '', 'button_enabled' => '', 'hover_style' => '', 'post_type' => 'portfolio', 'el_position' => '', 'width' => '', 'el_class' => ''), $atts)); /* OUTPUT VARIABLE ================================================== */ $portfolio_items_output = $grid_size = ""; $count = 0; /* CATEGORY SLUG MODIFICATION ================================================== */ if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); /* PORTFOLIO 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; } $portfolio_args = array('post_type' => $post_type, 'post_status' => 'publish', 'paged' => $paged, 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'order' => $order, 'orderby' => $order_by); $portfolio_items = new WP_Query($portfolio_args); /* LIST CLASS CONFIG ================================================== */ $list_class = ''; if ($display_type == "masonry" || $display_type == "masonry-gallery") { $list_class .= 'masonry-items filterable-items col-' . $columns . ' row clearfix'; } else { if ($display_type == "gallery") { $list_class .= 'gallery-portfolio filterable-items col-' . $columns . ' row clearfix'; } else { if ($display_type == "multi-size-masonry") { $columns = 3; $list_class .= 'multi-masonry-items filterable-items col-' . $columns . ' row clearfix'; } else { $list_class .= 'standard-portfolio filterable-items col-' . $columns . ' row clearfix'; } } } // Full width if ($fullwidth == "yes") { $list_class .= ' portfolio-full-width'; } // Gutters if ($gutters == "no") { $list_class .= ' no-gutters'; } else { $list_class .= ' gutters'; } // Thumb Type if ($hover_style == "default" && function_exists('sf_get_thumb_type')) { $list_class .= ' ' . sf_get_thumb_type(); } else { $list_class .= ' thumbnail-' . $hover_style; } if ($display_type == "multi-size-masonry") { if ($fullwidth == "yes") { $grid_size = 'col-sm-3'; } else { $grid_size = 'col-sm-4'; } } /* ITEMS OUTPUT ================================================== */ global $sf_options; $portfolio_items_output .= '<ul class="portfolio-items ' . $list_class . '">' . "\n"; if ($display_type == "multi-size-masonry") { $portfolio_items_output .= '<li class="clearfix portfolio-item ' . $grid_size . ' grid-sizer">' . "\n"; } while ($portfolio_items->have_posts()) { $portfolio_items->the_post(); /* META VARIABLES ================================================== */ $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true); $item_title = get_the_title(); $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true); $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); } $taxonomy_name = 'category'; if ($post_type != "post") { $taxonomy_name = $post_type . '-category'; } if ($taxonomy_name == "product-category") { $taxonomy_name = "product_cat"; } $post_terms = get_the_terms($post->ID, $taxonomy_name); $term_slug = " "; if (!empty($post_terms)) { foreach ($post_terms as $post_term) { $term_slug = $term_slug . strtolower($post_term->slug) . ' '; } } /* COLUMN VARIABLE CONFIG ================================================== */ $item_class = ""; if ($columns == "1") { $item_class = "col-sm-12 "; } else { if ($columns == "2") { $item_class = "col-sm-6 "; } else { if ($columns == "3") { $item_class = "col-sm-4 "; } else { if ($columns == "4") { $item_class = "col-sm-3 "; } else { if ($columns == "5") { $item_class = "col-sm-sf-5 "; } } } } } $masonry_thumb_size = sf_get_post_meta(get_the_ID(), 'sf_masonry_thumb_size', true); if ($display_type == "multi-size-masonry") { if ($fullwidth == "yes") { if ($masonry_thumb_size == "") { $masonry_thumb_size = "standard"; } if ($masonry_thumb_size == "wide") { $item_class = 'col-sm-6 size-wide '; } else { if ($masonry_thumb_size == "tall") { $item_class = 'col-sm-3 size-tall '; } else { if ($masonry_thumb_size == "wide-tall") { $item_class = 'col-sm-6 size-wide-tall '; } else { $item_class = 'col-sm-3 size-standard '; } } } } else { if ($masonry_thumb_size == "") { $masonry_thumb_size = "standard"; } if ($masonry_thumb_size == "wide") { $item_class = 'col-sm-8 size-wide '; } else { if ($masonry_thumb_size == "tall") { $item_class = 'col-sm-4 size-tall '; } else { if ($masonry_thumb_size == "wide-tall") { $item_class = 'col-sm-8 size-wide-tall '; } else { $item_class = 'col-sm-4 size-standard '; } } } } } /* DISPLAY TYPE CONFIG ================================================== */ if ($display_type == "masonry" || $display_type == "masonry-gallery") { $item_class .= "masonry-item masonry-gallery-item"; } else { if ($display_type == "gallery") { $item_class .= "gallery-item "; } else { if ($display_type == "multi-size-masonry") { $item_class .= "multi-masonry-item "; } else { $item_class .= "standard "; } } } /* LINK TYPE CONFIG ================================================== */ $item_link = sf_portfolio_item_link(); /* ITEM OUTPUT ================================================== */ $portfolio_items_output .= '<li itemscope itemtype="http://schema.org/CreativeWork" data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' ' . $term_slug . '">' . "\n"; $portfolio_items_output .= apply_filters('sf_before_portfolio_item_thumb', ''); /* THUMBNAIL CONFIG ================================================== */ if ($thumb_type != "none") { $portfolio_items_output .= sf_portfolio_thumbnail($display_type, $masonry_thumb_size, $multi_size_ratio, $columns, $hover_show_excerpt, $excerpt_length, $gutters, $fullwidth); } $portfolio_items_output .= apply_filters('sf_after_portfolio_item_thumb', ''); if ($display_type != "gallery" && $display_type != "masonry-gallery" && $display_type != "multi-size-masonry") { $portfolio_items_output .= '<div class="portfolio-item-details">' . "\n"; if ($show_title == "yes") { $portfolio_items_output .= '<div class="comments-likes">'; if (function_exists('lip_love_it_link')) { $portfolio_items_output .= lip_love_it_link(get_the_ID(), false); } $portfolio_items_output .= '</div>'; $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a ' . $item_link['config'] . '>' . $item_title . '</a></h3>' . "\n"; } if ($show_subtitle == "yes" && $item_subtitle) { $portfolio_items_output .= '<h5 class="portfolio-subtitle" itemprop="name alternativeHeadline">' . $item_subtitle . '</h5>' . "\n"; } if ($show_excerpt == "yes") { $portfolio_items_output .= '<div class="portfolio-item-excerpt" itemprop="description">' . $post_excerpt . '</div>' . "\n"; } $portfolio_items_output .= '</div>' . "\n"; } $portfolio_items_output .= '</li>' . "\n"; $count++; } wp_reset_query(); wp_reset_postdata(); $portfolio_items_output .= '</ul>' . "\n"; /* PAGINATION OUTPUT ================================================== */ if ($pagination == "yes") { if ($display_type == "masonry" || $display_type == "masonry-gallery") { $portfolio_items_output .= '<div class="pagination-wrap masonry-pagination">'; } else { $portfolio_items_output .= '<div class="pagination-wrap">'; } $portfolio_items_output .= pagenavi($portfolio_items); $portfolio_items_output .= '</div>'; } /* FUNCTION OUTPUT ================================================== */ return $portfolio_items_output; }
protected function content($atts, $content = null) { $options = get_option('sf_flexform_options'); $title = $category = $item_class = $excerpt_length = $width = $el_class = $output = $filter = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "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, $carouselID; if ($carouselID == "") { $carouselID = 1; } else { $carouselID++; } $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count); $blog_items = new WP_Query($blog_args); $count = $columns = 0; $sidebar_config = get_post_meta(get_the_ID(), 'sf_sidebar_config', true); 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 .= '<ul id="carousel-' . $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_categories = get_the_category_list(', '); $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); $thumb_video = 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 = get_post_meta($post->ID, 'sf_thumbnail_link_type', true); $thumb_link_url = 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 = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true); 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 = get_post_meta($post->ID, 'sf_custom_excerpt', true); $post_excerpt = ''; if ($custom_excerpt != '') { $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length); } else { $post_excerpt = excerpt($excerpt_length); } if ($thumb_link_type == "link_to_url") { $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"'; $item_icon = "link"; } else { if ($thumb_link_type == "link_to_url_nw") { $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"'; $item_icon = "link"; } else { if ($thumb_link_type == "lightbox_thumb") { $link_config = 'href="' . $thumb_img_url . '" class="view"'; $item_icon = "search"; } 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="view"'; $item_icon = "search"; } else { if ($thumb_link_type == "lightbox_video") { $link_config = 'href="' . $thumb_lightbox_video_url . '" rel="prettyPhoto"'; $item_icon = "facetime-video"; } else { $link_config = 'href="' . $post_permalink . '" class="link-to-post"'; $item_icon = "file-alt"; } } } } } $items .= '<li data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">'; $items .= '<figure>'; // THUMBNAIL MEDIA TYPE SETUP if ($thumb_type == "video") { $video = 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><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></li>"; } $items .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>'; } else { $image = aq_resize($thumb_img_url, 420, 315, true, false); $items .= '<a ' . $link_config . '>'; if ($image) { $items .= '<div class="overlay"><div class="thumb-info">'; $items .= '<i class="icon-' . $item_icon . '"></i>'; $items .= '</div></div>'; $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />'; } $items .= '</a>'; } } $items .= '</figure>'; $items .= '<div class="details-wrap">'; // POST TITLE if ($show_title == "yes") { $items .= '<h4><a href="' . $post_permalink . '">' . $item_title . '</a></h4>'; } // POST EXCERPT if ($excerpt_length != "0" && $show_excerpt == "yes") { $items .= '<div class="excerpt">' . $post_excerpt . '</div>'; } $items .= '</div>'; // POST DETAILS if ($show_details == "yes") { $items .= '<div class="post-item-details clearfix">'; $items .= '<span class="post-date">' . $post_date . '</span>'; $items .= '<div class="comments-likes">'; if (comments_open()) { $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> '; } if (function_exists('lip_love_it_link')) { $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false); } $items .= '</div>'; $items .= '</div>'; } $items .= '</li>'; $count++; } wp_reset_query(); $items .= '</ul>'; $items .= '<a href="#" class="prev"><i class="icon-chevron-left"></i></a><a href="#" class="next"><i class="icon-chevron-right"></i></a>'; $width = wpb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $output .= "\n\t" . '<div class="wpb_posts_carousel_widget wpb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper carousel-wrap">'; if ($title != '') { $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3></div>'; } else { $output .= "\n\t\t\t" . '<div class="heading-wrap"></div>'; } $output .= "\n\t\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); global $include_carousel, $include_isotope; $include_carousel = true; $include_isotope = true; return $output; }
protected function content($atts, $content = null) { $title = $width = $el_class = $output = $items = $item_figure = $el_position = ''; extract(shortcode_atts(array('title' => '', "pagination" => "no", "blog_type" => "standard", "excerpt_length" => '20', "item_count" => '5', "category" => '', '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); // BLOG 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; } $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'category_name' => $category_slug, 'posts_per_page' => $item_count); $blog_items = new WP_Query($blog_args); $list_class = ''; if ($blog_type == "masonry") { $list_class .= 'masonry-items'; } else { if ($blog_type == "mini") { $list_class .= 'mini-items'; } else { $list_class .= 'standard-items'; } } $items .= '<ul class="blog-items ' . $list_class . ' clearfix">'; while ($blog_items->have_posts()) { $blog_items->the_post(); $post_format = get_post_format(); $post_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_categories = get_the_category_list(', '); $post_comments = get_comments_number(); $post_permalink = get_permalink(); $custom_excerpt = get_post_meta($post->ID, 'coope_custom_excerpt', true); $post_excerpt = ''; if ($custom_excerpt != '') { $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length); } else { $post_excerpt = excerpt($excerpt_length); } $sidebar_config = get_post_meta($post->ID, 'coope_sidebar_config', true); $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = ''; if ($blog_type == "mini") { if ($sidebar_config == "no-sidebars") { $thumb_width = 446; $thumb_height = NULL; $video_height = 250; } else { $thumb_width = 290; $thumb_height = NULL; $video_height = 163; } } else { $thumb_width = 640; $thumb_height = NULL; $video_height = 360; $bordered_thumb_width = 408; $bordered_thumb_height = 303; $bordered_video_height = 303; } $thumb_type = get_post_meta($post->ID, 'coope_thumbnail_type', true); $thumb_image = rwmb_meta('coope_thumbnail_image', 'type=image&size=full'); $thumb_video = get_post_meta($post->ID, 'coope_thumbnail_video_url', true); $thumb_gallery = rwmb_meta('coope_thumbnail_gallery', 'type=image&size=blog-image'); $thumb_link_type = get_post_meta($post->ID, 'coope_thumbnail_link_type', true); $thumb_link_url = get_post_meta($post->ID, 'coope_thumbnail_link_url', true); $thumb_lightbox_thumb = rwmb_meta('coope_thumbnail_image', 'type=image&size=large'); $thumb_lightbox_image = rwmb_meta('coope_thumbnail_link_image', 'type=image&size=large'); $thumb_lightbox_video_url = get_post_meta($post->ID, 'coope_thumbnail_link_video_url', true); 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'); // LINK TYPE VARIABLES if ($thumb_link_type == "link_to_url") { $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"'; $item_icon = "link"; } else { if ($thumb_link_type == "link_to_url_nw") { $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"'; $item_icon = "link"; } else { if ($thumb_link_type == "lightbox_thumb") { $link_config = 'href="' . $thumb_img_url . '" class="view"'; $item_icon = "search"; } 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="view"'; $item_icon = "search"; } else { if ($thumb_link_type == "lightbox_video") { $link_config = 'href="' . $thumb_lightbox_video_url . '" class="fancybox-media"'; $item_icon = "facetime-video"; } else { $link_config = 'href="' . $post_permalink . '" class="link-to-post"'; $item_icon = "file"; } } } } } // THUMBNAIL MEDIA TYPE SETUP if ($thumb_type == "none") { $item_figure .= '<div class="spacer"></div>'; } else { $item_figure .= '<figure>'; if ($thumb_type == "video") { $video = video_embed($thumb_video, $thumb_width, $video_height); $item_figure .= $video; } else { if ($thumb_type == "slider") { $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">'; foreach ($thumb_gallery as $image) { $item_figure .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>"; } $item_figure .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>'; } else { if ($thumb_type == "image") { $image = aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); if ($image) { $item_figure .= '<a ' . $link_config . '>'; if ($blog_type == "masonry") { $item_figure .= '<div class="overlay"><div class="thumb-info">'; $item_figure .= '<i class="icon-' . $item_icon . '"></i>'; $item_figure .= '</div></div>'; } $item_figure .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />'; $item_figure .= '</a>'; } } } } $item_figure .= '</figure>'; } // BLOG ITEM OUTPUT $items .= '<li class="blog-item">'; if ($blog_type == "masonry") { $items .= $item_figure; $item_figure = ''; $items .= '<div class="blog-details-wrap">'; $items .= '<h4><a href="' . $post_permalink . '">' . $post_title . '</a></h4>'; $items .= '<div class="blog-item-details clearfix">' . sprintf(__('By <a href="%2$s">%1$s</a> on %3$s in %4$s', 'coope'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date, $post_categories) . '</div>'; $items .= $item_figure; if ($post_format == "quote") { $items .= '<div class="quote-excerpt heading-font">' . get_the_content() . '</div>'; } else { $items .= '<div class="excerpt">' . $post_excerpt . '</div>'; } $items .= '<div class="read-more-bar"><a class="read-more" href="' . $post_permalink . '">' . __("Keep Reading", "coope") . '<i class="icon-chevron-right"></i></a>'; $items .= '<div class="comments-likes">'; if (comments_open()) { $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> '; } if (function_exists('lip_love_it_link')) { $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false); } $items .= '</div></div>'; } else { $items .= '<div class="blog-details-wrap">'; $items .= '<h2><a href="' . $post_permalink . '">' . $post_title . '</a></h2>'; $items .= '<div class="blog-item-details clearfix">' . sprintf(__('By <a href="%2$s">%1$s</a> on %3$s in %4$s', 'coope'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date, $post_categories); $items .= '<div class="comments-likes">'; if (comments_open()) { $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> '; } if (function_exists('lip_love_it_link')) { $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false); } $items .= '</div></div>'; $items .= $item_figure; if ($post_format == "quote") { $items .= '<div class="quote-excerpt heading-font">' . get_the_content() . '</div>'; } else { $items .= '<div class="excerpt">' . $post_excerpt . '</div>'; } $items .= '<a class="read-more" href="' . $post_permalink . '">' . __("Keep Reading", "coope") . '<i class="icon-chevron-right"></i></a>'; } $items .= '</div></li>'; $item_figure = ''; } wp_reset_postdata(); $items .= '</ul>'; // PAGINATION if ($pagination == "yes") { $items .= '<div class="pagination-wrap full-width">'; $items .= pagenavi($blog_items); $items .= '</div>'; } $el_class = $this->getExtraClass($el_class); $width = wpb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="wpb_blog_widget wpb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper blog-wrap">'; $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3></div>' : ''; $output .= "\n\t\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); if ($blog_type == "masonry") { global $include_isotope; $include_isotope = true; } global $has_blog; $has_blog = true; return $output; }
function portfolio_sc($atts, $content = null) { global $rd_data; extract(shortcode_atts(array('heading_size' => '', 'heading_color' => '', 'heading_text' => '', 'port_start' => '8', 'port_click' => '4', 'port_layout' => '1 column', 'port_type' => 'port_type_1', 'port_bg_color' => '', 'port_title_color' => '', 'port_text_color' => '', 'port_button_color' => '', 'port_border_color' => '', 'port_hover_bg_color' => '', 'port_hover_title_color' => '', 'port_hover_text_color' => '', 'port_hover_button_color' => '', 'port_hover_border_color' => '', 'port_thumbnail' => 'thumbnail_type_1', 'filter' => '', 'filter_type' => 'filter_type_1', 'desc_border' => '', 'icon' => '', 'port_navigation' => '', 'nav_bg' => '', 'nav_color' => '', 'nav_border' => '', 'nav_hover_color' => '', 'nav_hover_bg' => '', 'button_bg' => '', 'button_title' => '', 'button_border' => '', 'button_hover_title' => '', 'button_hover_bg' => '', 'desc_bg' => '', 'desc_title' => '', 'desc_cat' => '', 'title_pos' => '', 'filter_text_color' => '', 'filter_background_color' => '', 'selected_filter_bg_color' => '', 'filter_border_color' => '', 'category' => 'all', 'tags' => 'all', 'overlay' => 'rd_hover_white', 'overlay_color' => '', 'overlay_color_2' => ''), $atts)); ob_start(); global $rd_data; $portfolio_rand_class = RandomString(20); $items_on_start = $port_start; $items_per_click = $port_click; $view_type = $port_layout; $tags = $tags; if ($items_on_start < 1) { $items_on_start = 4; } if ($items_per_click < 1) { $items_per_click = 4; } echo '<script>jQuery.noConflict(); var $ = jQuery; </script>'; wp_enqueue_script('js_isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js', array(), false, false); wp_enqueue_script('js_sorting', get_template_directory_uri() . '/js/sorting.js'); if ($port_bg_color == '') { $port_bg_color = $rd_data['rd_content_bg_color']; } if ($port_title_color == '') { $port_title_color = $rd_data['rd_content_heading_color']; } if ($port_text_color == '') { $port_text_color = $rd_data['rd_content_text_color']; } if ($port_button_color == '') { $port_button_color = $rd_data['rd_content_heading_color']; } if ($port_border_color == '') { $port_border_color = $rd_data['rd_content_border_color']; } if ($port_hover_bg_color == '') { $port_hover_bg_color = $rd_data['rd_content_heading_color']; } if ($port_hover_title_color == '') { $port_hover_title_color = $rd_data['rd_content_bg_color']; } if ($port_hover_text_color == '') { $port_hover_text_color = $rd_data['rd_content_text_color']; } if ($port_hover_button_color == '') { $port_hover_button_color = $rd_data['rd_content_hl_color']; } if ($port_hover_border_color == '') { $port_hover_border_color = $rd_data['rd_content_heading_color']; } if ($filter_background_color == '') { $filter_background_color = $rd_data['rd_content_bg_color']; } if ($filter_text_color == '') { $filter_text_color = $rd_data['rd_content_text_color']; } if ($selected_filter_bg_color == '') { $selected_filter_bg_color = $rd_data['rd_content_hl_color']; } if ($filter_border_color == '') { $filter_border_color = $rd_data['rd_content_border_color']; } if ($nav_bg == '') { $nav_bg = $rd_data['rd_content_bg_color']; } if ($nav_color == '') { $nav_color = $rd_data['rd_content_text_color']; } if ($button_hover_bg == '') { $button_hover_bg = $rd_data['rd_content_hl_color']; } if ($nav_hover_color == '') { $nav_hover_color = $rd_data['rd_content_bg_color']; } if ($nav_border == '') { $nav_border = $rd_data['rd_content_border_color']; } if ($button_bg == '') { $button_bg = $rd_data['rd_content_bg_color']; } if ($button_title == '') { $button_title = $rd_data['rd_content_heading_color']; } if ($button_hover_bg == '') { $button_hover_bg = $rd_data['rd_content_hl_color']; } if ($button_hover_title == '') { $button_hover_title = $rd_data['rd_content_bg_color']; } if ($button_border == '') { $button_border = $rd_data['rd_content_border_color']; } //////////////////////////////////////////// //// /// /// Set Portfolio Container /// // /// //////////////////////////////////////// echo '<div id="random' . $portfolio_rand_class . '_port" class="portfolio">'; //////////////////////////////////////////// //// /// /// Filter /// // /// //////////////////////////////////////// /// Type 1 if ($filter_type == 'filter_type_1') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a:hover{background:' . $selected_filter_bg_color . '; border:1px solid ' . $selected_filter_bg_color . '; color:#fff;}'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{border:1px solid ' . $filter_border_color . '}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:' . $filter_background_color . '}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 2 if ($filter_type == 'filter_type_2') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a:hover{color:' . $selected_filter_bg_color . '; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{border:1px solid ' . $filter_border_color . '; border-right:none;}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:' . $filter_background_color . '}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 3 if ($filter_type == 'filter_type_3') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts .is-checked{color:' . $selected_filter_bg_color . ' !important; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options ,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{border:1px solid ' . $filter_border_color . ';}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options{background:' . $filter_background_color . '}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 4 if ($filter_type == 'filter_type_4') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts .is-checked{color:' . $selected_filter_bg_color . ' !important; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{border:1px solid ' . $filter_border_color . ';}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{background:' . $filter_background_color . '}#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:none!important;}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 5 if ($filter_type == 'filter_type_5') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts .is-checked{color:' . $selected_filter_bg_color . ' !important; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{border:1px solid ' . $filter_border_color . ';}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{background:' . $filter_background_color . '}#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:none!important;}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 6 if ($filter_type == 'filter_type_6') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts .is-checked{color:' . $selected_filter_bg_color . ' !important; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{border:1px solid ' . $filter_border_color . ';}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{background:' . $filter_background_color . '}#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:none!important;}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } /// Type 7 if ($filter_type == 'filter_type_7') { $output = '<style>'; if ($selected_filter_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options .selected a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts .is-checked{color:' . $selected_filter_bg_color . ' !important; }'; } if ($filter_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{border:1px solid ' . $filter_border_color . ';}#random' . $portfolio_rand_class . '_port .' . $filter_type . '{border-top:1px solid ' . $filter_border_color . '; border-bottom:double 3px ' . $filter_border_color . ';}'; } if ($filter_background_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a{background:rgba(255,255,255,0);}#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' .portfolio_sorts a{background:' . $filter_background_color . ' !important;}'; } if ($filter_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #options a,#random' . $portfolio_rand_class . '_port .' . $filter_type . ' #sorts{color:' . $filter_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } //////////////////////////////////////////// //// /// /// Set Overlay effect /// // /// //////////////////////////////////////// if ($overlay == 'rd_hover_white' || $overlay == 'rd_hover_whiteic' || $overlay == 'rd_hover_gradient') { echo '<style>#random' . $portfolio_rand_class . '_port .portfolio_desc{ position:absolute; bottom:10%; width:100%; height:40px; padding:0; border:none!important; background:none!important; text-align:center; z-index:3; opacity:0;}#random' . $portfolio_rand_class . '_port .element:hover .portfolio_desc{opacity:1; bottom:50%;}#random' . $portfolio_rand_class . '_port .element:hover .img_link{left:4px; opacity:1;}#random' . $portfolio_rand_class . '_port .element:hover .post_link{right:4px; opacity:1;}'; if ($overlay == 'rd_hover_white') { echo '#random' . $portfolio_rand_class . '_port .element:hover .port_overlay{ background:#fff; opacity:1;}'; } if ($overlay == 'rd_hover_whiteic') { echo '#random' . $portfolio_rand_class . '_port .element:hover .port_overlay{ background:#fff; opacity:1; }#random' . $portfolio_rand_class . '_port .post_link{background:#444;}#random' . $portfolio_rand_class . '_port .post_link:before{color:#fff;}#random' . $portfolio_rand_class . '_port .img_link{border:1px solid #444;}#random' . $portfolio_rand_class . '_port .img_link:before{color:#444;}'; } if ($overlay == 'rd_hover_gradient') { if ($overlay_color_2 == '') { echo '#random' . $portfolio_rand_class . '_port .element:hover .port_overlay,.portfolio_desc:hover .port_overlay{ background:' . $overlay_color . '; opacity:1; }#random' . $portfolio_rand_class . '_port .portfolio_desc h2 a,#random' . $portfolio_rand_class . '_port .portfolio_desc h3{color:#ffffff !important}'; } else { echo '#random' . $portfolio_rand_class . '_port .element:hover .port_overlay,.portfolio_desc:hover .port_overlay{ opacity:1; background: ' . $overlay_color . '; background: -moz-linear-gradient(left, ' . $overlay_color . ' 0%, ' . $overlay_color_2 . ' 100%); background: -webkit-gradient(linear, left top, right top, color-stop(0%,' . $overlay_color . '), color-stop(100%,' . $overlay_color_2 . ')); background: -webkit-linear-gradient(left, ' . $overlay_color . ' 0%,' . $overlay_color_2 . ' 100%); background: -o-linear-gradient(left, ' . $overlay_color . ' 0%,' . $overlay_color_2 . ' 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(left, ' . $overlay_color . ' 0%,' . $overlay_color_2 . ' 100%); background: linear-gradient(to right, ' . $overlay_color . ' 0%,' . $overlay_color_2 . ' 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="' . $overlay_color . '", endColorstr="' . $overlay_color_2 . '",GradientType=1 ); }#random' . $portfolio_rand_class . '_port .portfolio_desc h2 a,#random' . $portfolio_rand_class . '_port .portfolio_desc h3{color:#ffffff !important}'; } } if ($overlay == 'rd_hover_whiteic' || $overlay == 'rd_hover_gradient') { echo '#random' . $portfolio_rand_class . '_port .portfolio_desc{margin-bottom:-55px;}.img_link,.post_link{margin-top:-55px;}</style>'; } else { echo '#random' . $portfolio_rand_class . '_port .portfolio_desc{margin-bottom:-20px;}.img_link,.post_link{display:none;}</style>'; } if ($desc_cat !== '') { echo '<style>#random' . $portfolio_rand_class . '_port .portfolio_desc h3{color:' . $desc_cat . '}</style>'; } } if ($overlay == 'rd_hover_lily' || $overlay == 'rd_hover_goliath' || $overlay == 'rd_hover_steve') { echo '<style>#random' . $portfolio_rand_class . '_port figcaption h2{color:' . $desc_title . ';}#random' . $portfolio_rand_class . '_port figcaption p{color:' . $desc_cat . ';}#random' . $portfolio_rand_class . '_port .ico_link{background:' . $overlay_color . '!important;}</style>'; } if ($overlay == 'rd_hover_sadie') { echo '<style>#random' . $portfolio_rand_class . '_port figcaption h2{color:' . $desc_title . ';}#random' . $portfolio_rand_class . '_port figcaption p{color:' . $desc_cat . ';}#random' . $portfolio_rand_class . '_port figcaption::before{background: -webkit-linear-gradient(top, rgba(72,76,97,0) 0%, ' . $overlay_color . ' 75%); background: linear-gradient(to bottom, rgba(72,76,97,0) 0%, ' . $overlay_color . ' 75%);</style>'; } if ($overlay == 'rd_hover_bubba' || $overlay == 'rd_hover_chico' || $overlay == 'rd_hover_roxy' || $overlay == 'rd_hover_layla') { echo '<style>#random' . $portfolio_rand_class . '_port .ico_link{background:' . $overlay_color . '!important;}</style>'; } if ($overlay == 'rd_hover_trending') { echo '<style>#random' . $portfolio_rand_class . '_port .port_overlay{background:' . $overlay_color . '!important;}</style>'; } //////////////////////////////////////////// //// /// /// Portfolio Desing /// // /// //////////////////////////////////////// if ($port_type == 'port_type_2') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border:1px solid ' . $port_border_color . '; border-bottom:none;}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_4') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border:1px solid ' . $port_border_color . ';}'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .portfolio_desc {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .portfolio_desc a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .portfolio_desc h3{color:' . $port_text_color . '}'; } if ($port_hover_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .filter_img{border:1px solid ' . $port_hover_border_color . ';}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_5') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border:1px solid ' . $port_border_color . '; border-bottom:none;}#random' . $portfolio_rand_class . '_port .port_item_details{border:1px solid ' . $port_border_color . '; border-top:none;}'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details h3{color:' . $port_text_color . '}'; } if ($port_hover_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .filter_img{border:1px solid ' . $port_hover_border_color . '; border-bottom:none;}#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{border:1px solid ' . $port_hover_border_color . '; border-top:none;}'; } if ($port_hover_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{background:' . $port_hover_bg_color . '}'; } if ($port_hover_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details a h2{color:' . $port_hover_title_color . '}'; } if ($port_hover_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details h3{color:' . $port_hover_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_6') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border:1px solid ' . $port_border_color . '; border-top:none;}#random' . $portfolio_rand_class . '_port .port_item_details{border:1px solid ' . $port_border_color . '; border-bottom:none;}'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details h3{color:' . $port_text_color . '}'; } if ($port_hover_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .filter_img{border:1px solid ' . $port_hover_border_color . '; border-top:none;}#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{border:1px solid ' . $port_hover_border_color . '; border-bottom:none;}'; } if ($port_hover_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{background:' . $port_hover_bg_color . '}'; } if ($port_hover_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details a h2{color:' . $port_hover_title_color . '}'; } if ($port_hover_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details h3{color:' . $port_hover_text_color . '}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_7') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border-right:1px solid ' . $port_border_color . ';}#random' . $portfolio_rand_class . '_port .item_details_info{border-top:1px solid ' . $port_border_color . '; border-bottom:1px solid ' . $port_border_color . '; }'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details h3,#random' . $portfolio_rand_class . '_port .port_item_details{color:' . $port_text_color . '}'; } if ($port_button_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .view-portfolio-item{color:' . $port_button_color . '; border:1px solid ' . $port_button_color . '; background:' . $port_bg_color . ';}#random' . $portfolio_rand_class . '_port .view-portfolio-pp{color:' . $port_bg_color . '; border:1px solid ' . $port_title_color . '; background:' . $port_title_color . ';}'; } if ($port_hover_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .filter_img{border-right:1px solid ' . $port_hover_border_color . ';}#random' . $portfolio_rand_class . '_port .element:hover .item_details_info{border-top:1px solid ' . $port_hover_border_color . '; border-bottom:1px solid ' . $port_hover_border_color . '; }'; } if ($port_hover_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details {background:' . $port_hover_bg_color . '}'; } if ($port_hover_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details a h2{color:' . $port_hover_title_color . '}'; } if ($port_hover_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details h3,#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{color:' . $port_hover_text_color . '}'; } if ($port_hover_button_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .view-portfolio-item{color:' . $port_hover_title_color . '; border:1px solid ' . $port_hover_button_color . '; background:' . $port_hover_button_color . ';}#random' . $portfolio_rand_class . '_port .element:hover .view-portfolio-pp{color:' . $port_hover_bg_color . '; border:1px solid ' . $port_hover_title_color . '; background:' . $port_hover_title_color . ';}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_7' || $port_type == 'port_type_8') { $output = '<style>'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border-right:1px solid ' . $port_border_color . ';}#random' . $portfolio_rand_class . '_port .item_details_info{border-top:1px solid ' . $port_border_color . '; border-bottom:1px solid ' . $port_border_color . '; }#random' . $portfolio_rand_class . '_port .port_item_details{border-right:1px solid ' . $port_border_color . '; border-bottom:1px solid ' . $port_border_color . '; }#random' . $portfolio_rand_class . '_port .element:first-child .port_item_details {border-top:1px solid ' . $port_border_color . ';}'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details h3,#random' . $portfolio_rand_class . '_port .port_item_details{color:' . $port_text_color . '}'; } if ($port_button_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .view-portfolio-item{color:' . $port_button_color . '; border:1px solid ' . $port_button_color . '; background:' . $port_bg_color . ';}#random' . $portfolio_rand_class . '_port .view-portfolio-pp{color:' . $port_bg_color . '; border:1px solid ' . $port_title_color . '; background:' . $port_title_color . ';}'; } if ($port_hover_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .filter_img{border-right:1px solid ' . $port_hover_border_color . ';}#random' . $portfolio_rand_class . '_port .element:hover .item_details_info{border-top:1px solid ' . $port_hover_border_color . '; border-bottom:1px solid ' . $port_hover_border_color . '; }'; } if ($port_hover_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details {background:' . $port_hover_bg_color . '}'; } if ($port_hover_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details a h2{color:' . $port_hover_title_color . '}'; } if ($port_hover_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .port_item_details h3,#random' . $portfolio_rand_class . '_port .element:hover .port_item_details{color:' . $port_hover_text_color . '}'; } if ($port_hover_button_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .element:hover .view-portfolio-item{color:' . $port_hover_title_color . '; border:1px solid ' . $port_hover_button_color . '; background:' . $port_hover_button_color . ';}#random' . $portfolio_rand_class . '_port .element:hover .view-portfolio-pp{color:' . $port_hover_bg_color . '; border:1px solid ' . $port_hover_title_color . '; background:' . $port_hover_title_color . ';}'; } if ($port_type == 'port_type_8') { $output .= '#random' . $portfolio_rand_class . '_port .element:nth-child(even) .filter_img{float:right; border-left:1px solid ' . $port_border_color . '; border-right:none!important;}#random' . $portfolio_rand_class . '_port .element:nth-child(even) .port_item_details{float:left; border-left:1px solid ' . $port_border_color . '; border-right:none!important;}#random' . $portfolio_rand_class . '_port .element:hover:nth-child(even) .filter_img{border-left:1px solid ' . $port_hover_border_color . '; border-right:none!important;}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } if ($port_type == 'port_type_9') { $output = '<style>#random' . $portfolio_rand_class . '_port .element{margin-bottom:30px;}'; if ($port_border_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .filter_img{border-right:1px solid ' . $port_border_color . ';}'; } if ($port_bg_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details {background:' . $port_bg_color . '}'; } if ($port_title_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details a h2{color:' . $port_title_color . '}'; } if ($port_text_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .port_item_details h3,#random' . $portfolio_rand_class . '_port .port_item_details{color:' . $port_text_color . '}'; } if ($port_button_color !== '') { $output .= '#random' . $portfolio_rand_class . '_port .view-portfolio-item{color:#ffffff; border:1px solid ' . $port_button_color . '; background:' . $port_button_color . ';}#random' . $portfolio_rand_class . '_port .view-portfolio-pp{color:#ffffff; border:1px solid ' . $port_title_color . '; background:' . $port_title_color . ';}'; } $output .= '</style>'; echo !empty($output) ? $output : ''; } //////////////////////////////////////////// //// /// /// Creating Portfolio /// // /// //////////////////////////////////////// if ($filter !== '') { if ($tags == "all" || $tags == "") { echo ' <div id="portfolio-tags" class="' . $filter_type . '"> <ul class="splitter" id="options">'; if ($filter_type == 'filter_type_2') { echo '<li style="border-right:1px solid ' . $filter_border_color . '">'; } else { echo '<li>'; } rd_showPortCategory(); echo ' </li>'; if ($filter_type == 'filter_type_3' || $filter_type == 'filter_type_4' || $filter_type == 'filter_type_5' || $filter_type == 'filter_type_6' || $filter_type == 'filter_type_7') { ?> <li class="portfolio_sorts"><a>Sort by</a><ul id="sorts" class="button-group"><li data-sort-by="">default</li><li data-sort-by="date">date</li><li data-sort-by="name">name</li></ul></li> <?php } echo '</ul></div>'; } } if ($port_type !== 'port_type_7' && $port_type !== 'port_type_8' && $port_type !== 'port_type_9') { switch ($view_type) { case "1 column": $view_type_class = "columns1"; break; case "2 columns": $view_type_class = "columns2"; break; case "3 columns": $view_type_class = "columns3"; break; case "4 columns": $view_type_class = "columns4"; break; case "5 columns": $view_type_class = "columns5"; break; case "6 columns": $view_type_class = "columns6"; break; } } else { $view_type_class = "columns1"; } //START PORTFOLIO echo '<div class="portfolio_block image-grid ' . $view_type_class . ' ' . $port_type . ' ' . $overlay . ' ' . $port_thumbnail . '" id="list">'; if ($port_navigation == 'classic_nav') { if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } $args = array('posts_per_page' => $port_start, 'post_type' => "Portfolio", 'post_status' => 'publish', 'paged' => $paged); if ($category !== '' && $category !== "all") { $args['tax_query'] = array(array('taxonomy' => 'catportfolio', 'field' => 'slug', 'terms' => $category)); } if ($tags !== '' && $tags !== "all") { $args['tax_query'] = array(array('taxonomy' => 'tagportfolio', 'field' => 'slug', 'terms' => $tags)); } if ($category !== '' && $category !== "all" && $tags !== '' && $tags !== "all") { $args['tax_query'] = array(array('taxonomy' => 'catportfolio', 'field' => 'slug', 'terms' => $category), array('taxonomy' => 'tagportfolio', 'field' => 'slug', 'terms' => $tags)); } $port_query = new WP_Query($args); global $more, $post; $more = 0; while ($port_query->have_posts()) { $port_query->the_post(); if (!isset($echoallterm)) { $echoallterm = ''; $showterm = ''; } $new_term_list = get_the_terms(get_the_id(), "tagportfolio"); if (is_array($new_term_list)) { foreach ($new_term_list as $term) { $tempname = strtr($term->name, array(' ' => '-')); $echoallterm .= strtolower($tempname) . " "; $echoterm = $term->name; } foreach ($new_term_list as $term) { $showterm .= strtolower($term->name) . " "; } } $i = 1; $pf = get_post_format(); $project_url = get_post_meta($post->ID, 'rd_p_url', true); $project_thumb = get_post_meta($post->ID, 'rd_thumb', true); $linkToTheWork = get_permalink(); $target = ""; $current = $port_query->query_vars['paged']; $maxpages = $port_query->max_num_pages; //Generating new items if ($port_thumbnail == 'thumbnail_type_5' || $port_thumbnail == 'thumbnail_type_6') { echo '<div data-category="' . $echoallterm . '" class="' . $echoallterm . ' element rd_' . $project_thumb . '">'; } else { echo '<div data-category="' . $echoallterm . '" class="' . $echoallterm . ' element">'; } if ($port_type == "port_type_6") { echo ' <div class="port_item_details"><a href="' . get_permalink($post->ID) . '"><h2>' . get_the_title() . '</h2></a><h3>' . $showterm . '</h3> <div class="item_details_info"><div class="item_details_date">' . get_the_date() . '</div>' . lip_love_it_link($post_id = null, '', '', $echo = true) . ' </div></div><div class="portfolio_sub_info"><div class="isotope_portfolio_name">' . get_the_title() . '</div><div class="isotope_portfolio_date">' . get_the_date('Y-m-d') . '</div></div>'; } echo ' <div class="filter_img"> <div class="port_thumb_ctn"> <div class="port_overlay"></div> <a ' . $target . ' href="' . $linkToTheWork . '" class="ico_link">'; //Set thumbnail depending on portfolio design if ($port_type == 'port_type_7' || $port_type == 'port_type_8' || $port_type == 'port_type_9') { echo get_the_post_thumbnail(get_the_id(), "portfolio_classic"); } elseif ($port_thumbnail == 'thumbnail_type_1') { echo get_the_post_thumbnail(get_the_id(), "portfolio_tn"); } elseif ($port_thumbnail == 'thumbnail_type_2') { echo get_the_post_thumbnail(get_the_id(), "portfolio_squared"); } elseif ($port_thumbnail == 'thumbnail_type_3') { echo get_the_post_thumbnail(get_the_id(), "portfolio_landscape"); } elseif ($port_thumbnail == 'thumbnail_type_4') { echo get_the_post_thumbnail(get_the_id(), "portfolio_portrait"); } elseif ($port_thumbnail == 'thumbnail_type_5') { if ($project_thumb == 'portfolio_small_squared' || $project_thumb == 'portfolio_squared') { echo get_the_post_thumbnail(get_the_id(), 'portfolio_squared'); } if ($project_thumb == 'portfolio_portrait') { echo get_the_post_thumbnail(get_the_id(), 'portfolio_portrait'); } if ($project_thumb == 'portfolio_landscape') { echo get_the_post_thumbnail(get_the_id(), 'portfolio_landscape'); } } elseif ($port_thumbnail == 'thumbnail_type_6') { if ($project_thumb == 'portfolio_small_squared' || $project_thumb == 'portfolio_squared') { echo get_the_post_thumbnail(get_the_id(), array(960, 600)); } if ($project_thumb == 'portfolio_portrait') { echo get_the_post_thumbnail(get_the_id(), array(480, 600)); } if ($project_thumb == 'portfolio_landscape') { echo get_the_post_thumbnail(get_the_id(), array(960, 300)); } } elseif ($port_thumbnail == 'thumbnail_type_7') { echo get_the_post_thumbnail(get_the_id(), 'full'); } echo ' </a><figcaption><div> <h2>' . get_the_title() . '</h2> <p>' . $showterm . '</p> </div> <a href="' . $linkToTheWork . '">View more</a> </figcaption>'; if ('' != get_the_post_thumbnail()) { $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID), 'full'); echo '<a href="' . $url . '" class="prettyPhoto port_img_link">'; echo "<span class='img_link'>"; echo ''; echo "</span></a><a href='" . get_permalink($post->ID) . "' class='port_post_link'>"; echo "<span class='post_link'><h2 class='fw_port_link'>" . get_the_title() . "</h2><h3 class='fw_port_tag'>" . $showterm . "</h3>"; echo ''; echo "</span></a>"; echo ""; } echo '<div class="portfolio_desc"> <h2><a href="' . $linkToTheWork . '">' . get_the_title() . '</a></h2> <h3>' . $showterm . '</h3> </div> </div><!-- port_thumb_ctn END --> </div><!-- Filter img END -->'; if ($port_type == "port_type_5" || $port_type == "port_type_7" || $port_type == "port_type_8" || $port_type == "port_type_9") { echo ' <div class="port_item_details"><a href="' . get_permalink($post->ID) . '"><h2>' . get_the_title() . '</h2></a><h3>' . $showterm . '</h3> <div class="item_details_info"><div class="item_details_date">' . get_the_date() . '</div>'; if (function_exists('zilla_likes')) { echo do_shortcode('[zilla_likes]'); } echo '</div><div class="port_small_excerpt">'; if ($port_type == "port_type_7" || $port_type == "port_type_8") { echo rd_custom_excerpt('rd_port_excerpt', 'rd_port_more'); } if ($port_type == "port_type_9") { echo rd_custom_excerpt('rd_port_long_excerpt', 'rd_port_more'); } echo '<div class="port_project_buttons">'; if ($project_url !== '') { echo '<a href="' . $project_url . '" target="_blank" class="view-portfolio-pp">' . __('Launch Project', 'thefoxwp') . '</a>'; } echo '<a class="view-portfolio-item" href="' . get_permalink($post->ID) . '">' . __('View More', 'thefoxwp') . '</a></div></div> </div>'; } echo '<div class="portfolio_sub_info"><div class="isotope_portfolio_name">' . get_the_title() . '</div><div class="isotope_portfolio_date">' . get_the_date('Y-m-d') . '</div></div></div><!-- element END -->'; #END Portfolio $i++; unset($echoallterm, $pf); } } echo ' </div><!-- .portfolio_block --> <div class="rd_clear"><!-- ClearFix --></div>'; if ($port_navigation == 'loadmore_nav') { $output = ''; $output .= '<style>#random' . $portfolio_rand_class . '_port .btn_load_more{background:' . $button_bg . '; color:' . $button_title . '; border:1px solid ' . $button_border . ';}#random' . $portfolio_rand_class . '_port .refresh_icn:before{color:' . $button_title . ';}#random' . $portfolio_rand_class . '_port .btn_load_more:hover{background:' . $button_hover_bg . '; color:' . $button_hover_title . '; border:1px solid ' . $button_hover_bg . ';}#random' . $portfolio_rand_class . '_port .btn_load_more:hover .refresh_icn:before{color:' . $button_hover_title . ';}</style>'; $output .= '<div class="load_more_cont"><a class="btn_load_more get_portfolio_works_btn" href="#"><span class="fa-plus refresh_icn"></span>' . __('Load More', 'thefoxwp') . '<span></span></a></div>'; echo !empty($output) ? $output : ''; } if ($port_navigation == 'classic_nav') { echo '<style>#random' . $portfolio_rand_class . '_port .navigation .pagination span,#random' . $portfolio_rand_class . '_port .navigation .pagination a{border:1px solid ' . $nav_border . '; color:' . $nav_color . '; background:' . $nav_bg . ';}#random' . $portfolio_rand_class . '_port .navigation .pagination .current,#random' . $portfolio_rand_class . '_port .navigation .pagination span:hover,#random' . $portfolio_rand_class . '_port .navigation .pagination a:hover{ color:' . $nav_hover_color . ' !important; background:' . $nav_hover_bg . '; border:1px solid ' . $nav_hover_bg . '; }#random' . $portfolio_rand_class . '_port .navigation{border-top:1px solid ' . $nav_border . ';}#random' . $portfolio_rand_class . '_port .pagination_current_position{color:' . $nav_color . ';}</style>'; if (isset($maxpages)) { ?> <div class="navigation"> <?php kriesi_pagination($maxpages); echo "<span class='pagination_current_position'>" . __("Page", "rdesign") . ' ' . $current . "/" . $maxpages . "</span>"; ?> </div> <?php } } echo '</div>'; ?> <script> jQuery.noConflict(); var $ = jQuery; "use strict"; <?php if ($port_navigation !== 'classic_nav') { ?> /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CONFIG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ var html_template = "<?php echo esc_js($port_type); ?> "; var thumbnail = "<?php echo esc_js($port_thumbnail); ?> "; var now_open_works = 0; var first_load = true; /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CONFIG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ function get_portfolio_works (this_obj) { if(typeof(this_obj)=="undefined") {data_option_value="*";} else {var data_option_value = this_obj.attr("data-option-value");} if (first_load == true) { works_per_load = <?php echo esc_js($items_on_start); ?> ; first_load = false; } else { works_per_load = <?php echo esc_js($items_per_click); ?> ; } $.ajax({ type: "POST", url: mixajaxurl, data: "html_template="+html_template+"&now_open_works="+now_open_works+"&action=get_portfolio_works"+"&works_per_load="+works_per_load+"&thumbnail="+thumbnail+"&tags=<?php echo esc_js($tags); ?> &category=<?php echo esc_js($category); ?> ", success: function(result){ if(result.length<1){ $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .load_more_cont").hide("fast"); } now_open_works = now_open_works + works_per_load; var $newItems = $(result); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope( 'insert', $newItems, function() { $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").ready(function(){ $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); //Portfolio $('#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_content').each(function(){ $(this).css('margin-top', Math.floor(-1*($(this).height()/2))+'px'); }); }); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); $(window).trigger('resize'); }); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .optionset li a").each(function() { var filter_class = $(this).attr('data-option-value'); if ($('#random<?php echo esc_js($portfolio_rand_class); ?> _port').find(filter_class).length) { // implies *not* zero $(this).parent('li').show(); }else{ $(this).parent('li').hide(); } }); $('a.prettyPhoto').prettyPhoto(); $(window).trigger('resize'); $(".refresh_icn").removeClass("fa-spin"); $(".refresh_icn").removeClass("fa-refresh"); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); $(".refresh_icn").addClass("fa-plus"); } }); } $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .get_portfolio_works_btn").click(function(){ $(".refresh_icn").removeClass("fa-plus"); $(".refresh_icn").addClass("fa-refresh"); $(".refresh_icn").addClass("fa-spin"); get_portfolio_works(); $(window).trigger('resize'); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); return false; }); /* load at start */ $(window).load(function(){ get_portfolio_works(); $(window).trigger('resize'); $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); <?php } else { ?> $(window).load(function(){ <?php } ?> $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .optionset li a").each(function() { var filter_class = $(this).attr('data-option-value'); if ($('#random<?php echo esc_js($portfolio_rand_class); ?> _port').find(filter_class).length){ // implies *not* zero $(this).parent('li').show(); }else{ $(this).parent('li').hide(); } }); function watchport() { $("#random<?php echo esc_js($portfolio_rand_class); ?> _port .portfolio_block").isotope('layout'); <?php if ($port_type == 'port_type_7' || $port_type == 'port_type_8' || $port_type == 'port_type_9') { ?> <?php } ?> } setInterval(watchport, 100); }); </script> <?php wp_reset_postdata(); $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
function widget($args, $instance) { global $post, $sf_options; extract($args); $remove_dates = $sf_options['remove_dates']; // 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>'); $post_icon = apply_filters('sf_post_icon', '<i class="ss-file"></i>'); $recent_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category_name' => $category_slug)); $thumb_width = apply_filters('sf_widget_posts_thumb_width', 94); $thumb_height = apply_filters('sf_widget_posts_thumb_height', 75); if ($recent_posts->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true); $post_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_categories = get_the_category_list(); $post_comments = get_comments_number(); $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, $thumb_width, $thumb_height, true, false); $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true)); ?> <?php if ($image) { ?> <li class="has-image"> <a href="<?php echo esc_url($post_permalink); ?> " class="recent-post-image"> <img src="<?php echo esc_url($image[0]); ?> " width="<?php echo esc_attr($image[1]); ?> " height="<?php echo esc_attr($image[2]); ?> " alt="<?php echo esc_attr($image_alt); ?> "/> </a> <?php } else { ?> <li> <?php } ?> <div class="recent-post-details"> <a class="recent-post-title" href="<?php echo esc_url($post_permalink); ?> " title="<?php echo esc_attr($post_title); ?> "><?php echo esc_attr($post_title); ?> </a> <?php if (sf_theme_opts_name() == "sf_uplift_options") { echo '<div class="excerpt">' . sf_excerpt(20) . '</div>'; if (!$remove_dates) { echo '<div class="blog-item-details">' . sprintf(__('<time datetime="%1$s">%2$s</time>', 'swiftframework'), get_the_date('Y-m-d'), get_the_date()) . '</div>'; } } else { ?> <span><?php printf(__('By %1$s on %2$s', 'swiftframework'), $post_author, $post_date); ?> </span> <div class="comments-likes"> <?php if (comments_open()) { ?> <div class="comments-wrapper"> <a href="<?php echo esc_url($post_permalink); ?> #comment-area"><?php echo apply_filters('sf_comments_icon', '<i class="ss-chat"></i>'); ?> <span><?php echo esc_attr($post_comments); ?> </span></a> </div> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), false); } ?> </div> <?php } ?> </div> </li> <?php } wp_reset_postdata(); ?> </ul> <?php } ?> <?php echo $after_widget; }
} ?> <div class="blog-item-details clearfix"><?php printf(__('By <a href="%2$s">%1$s</a> on %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date); ?> <div class="comments-likes"> <a href="<?php echo $post_permalink; ?> #comment-area"><i class="icon-comments"<i class="icon-comments"></i><span><?php echo $post_comments; ?> </span></a> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>'); } ?> </div> </div> <?php if ($blog_type != "masonry") { ?> <?php echo $item_figure; ?> <?php } ?> <div class="excerpt"><?php echo $post_excerpt;
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); $count = 0; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $recent_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category_name' => $category_slug)); $options = get_option('sf_dante_options'); $single_author = $options['single_author']; $remove_dates = false; if (isset($options['remove_dates']) && $options['remove_dates'] == 1) { $remove_dates = true; } if ($recent_posts->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); if ($count == $number) { break; } $post_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_categories = get_the_category_list(); $post_comments = get_comments_number(); $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); ?> <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]; ?> " /> <?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> <?php if ($single_author && !$remove_dates) { ?> <span><?php printf(__('%1$s', 'swiftframework'), $post_date); ?> </span> <?php } else { if (!$remove_dates) { ?> <span><?php printf(__('By %1$s on %2$s', 'swiftframework'), $post_author, $post_date); ?> </span> <?php } else { if (!$single_author) { ?> <span><?php printf(__('By %1$s', 'swiftframework'), $post_author); ?> </span> <?php } } } ?> <div class="comments-likes"> <?php if (comments_open()) { ?> <a href="<?php echo $post_permalink; ?> #comment-area"><i class="ss-chat"></i><span><?php echo $post_comments; ?> </span></a> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>'); } ?> </div> </div> </li> <?php $count++; } ?> </ul> <?php wp_reset_query(); } ?> <?php echo $after_widget; }
function sf_get_post_item($postID, $blog_type, $show_title = "yes", $show_excerpt = "yes", $show_details = "yes", $excerpt_length = "20", $content_output = "excerpt", $show_read_more = "no") { $post_item = $thumb_img_url = $image_id = ""; $options = get_option('sf_dante_options'); $single_author = $options['single_author']; $remove_dates = false; if (isset($options['remove_dates']) && $options['remove_dates'] == 1) { $remove_dates = true; } global $post, $sf_sidebar_config; $post_format = get_post_format($postID); if ($post_format == "") { $post_format = 'standard'; } $post_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_categories = get_the_category_list(', '); $post_comments = get_comments_number(); $post_permalink = get_permalink(); $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true); $post_excerpt = ''; if ($content_output == "excerpt") { if ($custom_excerpt != '') { $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length); } else { if ($post_format == "quote") { $post_excerpt = sf_get_the_content_with_formatting(); } else { $post_excerpt = sf_excerpt($excerpt_length); } } } else { $post_excerpt = sf_get_the_content_with_formatting(); } if ($post_format == "chat") { $post_excerpt = sf_content(40); } else { if ($post_format == "audio") { $post_excerpt = do_shortcode(get_the_content()); } else { if ($post_format == "video") { $content = get_the_content(); $content = apply_filters('the_content', $content); $post_excerpt = $content; } else { if ($post_format == "link") { $content = get_the_content(); $content = apply_filters('the_content', $content); $post_excerpt = $content; } } } } $post_item = $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = $gallery_size = ''; if ($blog_type == "mini") { if ($sf_sidebar_config == "no-sidebars") { $thumb_width = 446; $thumb_height = NULL; $video_height = 335; } else { $thumb_width = 370; $thumb_height = NULL; $video_height = 260; } $gallery_size = 'thumb-image'; } else { if ($blog_type == "masonry" || $blog_type == "masonry-fw") { if ($sf_sidebar_config == "both-sidebars" || $blog_type == "masonry-fw") { $item_class = "col-sm-3"; } else { $item_class = "col-sm-4"; } $thumb_width = 480; $thumb_height = NULL; $video_height = 360; $gallery_size = 'thumb-image'; } else { $thumb_width = 970; $thumb_height = NULL; $video_height = 728; $gallery_size = 'blog-image'; } } $thumb_type = sf_get_post_meta($postID, 'sf_thumbnail_type', true); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); $thumb_video = sf_get_post_meta($postID, 'sf_thumbnail_video_url', true); $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=' . $gallery_size); $thumb_link_type = sf_get_post_meta($postID, 'sf_thumbnail_link_type', true); $thumb_link_url = sf_get_post_meta($postID, '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($postID, 'sf_thumbnail_link_video_url', true); $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url); $image_id = 0; foreach ($thumb_image as $detail_image) { $image_id = $detail_image['ID']; $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id($postID); $image_id = $thumb_image; $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full'); $item_figure = $link_config = ""; // LINK TYPE VARIABLES 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"; } } } } } // THUMBNAIL MEDIA TYPE SETUP if ($thumb_type != "none") { $item_figure .= '<figure class="animated-overlay overlay-alt">'; if ($thumb_type == "video") { $video = sf_video_embed($thumb_video, $thumb_width, $video_height); $item_figure .= $video; } else { if ($thumb_type == "slider") { $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">'; foreach ($thumb_gallery as $image) { $item_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>"; } $item_figure .= '</ul></div>'; } else { if ($thumb_img_url == "") { $thumb_image = get_post_thumbnail_id($postID); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); $thumbnail_id = get_post_thumbnail_id($postID); $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true); if ($image) { $item_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />'; $item_figure .= '<a ' . $link_config . '></a>'; $item_figure .= '<figcaption><div class="thumb-info thumb-info-alt">'; $item_figure .= '<i class="' . $item_icon . '"></i>'; $item_figure .= '</div></figcaption>'; } } } $item_figure .= '</figure>'; } // MASONRY STYLING if ($blog_type == "masonry" || $blog_type == "masonry-fw") { $post_item .= '<div class="masonry-item-wrap">'; if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt heading-font entry-title" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<div class="link-excerpt heading-font entry-title" itemprop="description">' . $post_excerpt . '</div>'; } else { $post_item .= $item_figure; } } $post_item .= '<div class="details-wrap clearfix">'; if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") { if ($single_author && $remove_dates) { $post_item .= '<h4 itemprop="name headline" class="entry-title no-details"><a href="' . $post_permalink . '">' . $post_title . '</a></h4>'; } else { $post_item .= '<h4 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h4>'; } } if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>'; } } } } // POST EXCERPT if ($show_excerpt == "yes" && $post_excerpt != "0") { if ($post_format != "quote" && $post_format != "link") { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } } // POST DETAILS if (is_sticky()) { $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>'; } if ($show_read_more == "yes") { $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } $post_item .= '</div>'; } $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>'; $post_item .= '</div>'; $post_item .= '</div>'; // MINI STYLING } else { if ($blog_type == "mini") { $post_item .= '<div class="mini-blog-item-wrap">'; if ($post_format == "quote" || $post_format == "link") { $post_item .= '<div class="mini-alt-wrap">'; } else { $post_item .= $item_figure; } $post_item .= '<div class="blog-details-wrap">'; if ($show_title == "yes" && $post_format != "quote" && $post_format != "link") { $post_item .= '<h3 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h3>'; } if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>'; } } } } if ($show_excerpt == "yes") { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<div class="link-excerpt heading-font" itemprop="description"><i class="ss-link"></i>' . $post_excerpt . '</div>'; } else { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } } } if (is_sticky()) { $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>'; } if ($show_read_more == "yes") { $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if ($post_format == "quote" || $post_format == "link") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>'; } } } } if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } $post_item .= '</div>'; } $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>'; $post_item .= '</div>'; if ($post_format == "quote" || $post_format == "link") { $post_item .= '</div>'; } $post_item .= '</div>'; // STANDARD STYLING } else { if ($show_details == "yes") { $post_item .= '<span class="standard-post-date" itemprop="datePublished">' . $post_date . '</span>'; } $post_item .= $item_figure; if ($item_figure == "") { $post_item .= '<div class="standard-post-content no-thumb clearfix">'; // open standard-post-content } else { $post_item .= '<div class="standard-post-content clearfix">'; // open standard-post-content } if ($show_title && $post_format != "link" && $post_format != "quote") { $post_item .= '<h1 itemprop="name headline" class="entry-title"><a href="' . $post_permalink . '">' . $post_title . '</a></h1>'; } if ($show_details == "yes" && $post_format != "quote" && $post_format != "link") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf('<span class="date updated">%1$s</span>', $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span> on <span class="date updated">%2$s</span>', 'swiftframework'), $post_author, $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details vcard author">' . sprintf(__('By <span itemprop="author" class="fn">%1$s</span>', 'swiftframework'), $post_author) . '</div>'; } } } } if ($show_excerpt == "yes") { if ($post_format == "quote") { $post_item .= '<div class="quote-excerpt heading-font" itemprop="description">' . $post_excerpt . '</div>'; } else { if ($post_format == "link") { $post_item .= '<div class="link-excerpt heading-font" itemprop="description"><i class="ss-link"></i>' . $post_excerpt . '</div>'; } else { $post_item .= '<div class="excerpt" itemprop="description">' . $post_excerpt . '</div>'; } } } if (is_sticky()) { $post_item .= '<div class="sticky-post-icon"><i class="ss-bookmark"></i></div>'; } if ($show_read_more == "yes") { $post_item .= '<a class="read-more-button" href="' . $post_permalink . '">' . __("Read more", "swiftframework") . '</a>'; } if ($show_details == "yes") { $post_item .= '<div class="comments-likes">'; if ($post_format == "quote" || $post_format == "link") { if ($single_author && !$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf(__('%1$s', 'swiftframework'), $post_date) . '</div>'; } else { if (!$remove_dates) { $post_item .= '<div class="blog-item-details">' . sprintf(__('By <a href="%2$s" rel="author" itemprop="author">%1$s</a> on %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date) . '</div>'; } else { if (!$single_author) { $post_item .= '<div class="blog-item-details">' . sprintf(__('By <a href="%2$s" rel="author" itemprop="author">%1$s</a>', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID'))) . '</div>'; } } } } if (comments_open()) { $post_item .= '<div class="comments-wrapper"><a href="' . $post_permalink . '#comment-area"><i class="ss-chat"></i><span>' . $post_comments . '</span></a></div>'; } if (function_exists('lip_love_it_link')) { $post_item .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } $post_item .= '</div>'; } $post_item .= '<meta itemprop="datePublished" content="' . get_the_date('Y-m-d') . '"/>'; $post_item .= '</div>'; // close standard-post-content } } return $post_item; }
function sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars) { /* OUTPUT VARIABLE ================================================== */ $portfolio_items_output = ""; $count = 0; /* CATEGORY SLUG MODIFICATION ================================================== */ if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); /* PORTFOLIO 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; } $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'paged' => $paged, 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'id', 'terms' => array($exclude_categories), 'operator' => 'NOT IN'))); $portfolio_items = new WP_Query($portfolio_args); /* LIST CLASS CONFIG ================================================== */ $list_class = ''; if ($display_type == "masonry" || $display_type == "masonry-gallery") { $list_class .= 'masonry-items filterable-items col-' . $columns . ' row clearfix'; } else { if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $list_class .= 'masonry-items masonry-fw filterable-items col-' . $columns . ' row clearfix'; } else { if ($display_type == "gallery") { $list_class .= 'gallery-portfolio filterable-items col-' . $columns . ' row clearfix'; } else { $list_class .= 'standard-portfolio filterable-items col-' . $columns . ' row clearfix'; } } } /* ITEMS OUTPUT ================================================== */ $options = get_option('sf_dante_options'); $enable_portfolio_gallery = $options['enable_portfolio_gallery']; $portfolio_items_output .= '<ul class="portfolio-items ' . $list_class . '">' . "\n"; while ($portfolio_items->have_posts()) { $portfolio_items->the_post(); /* META VARIABLES ================================================== */ $thumb_image = $thumb_gallery = $video = $item_class = $link_config = ''; $thumb_width = 420; $thumb_height = 315; $video_height = 315; $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full'); $thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true); if ($columns == "2") { $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-twocol'); } else { $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image'); } $thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true); $thumb_link_url = 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 = 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(); $item_subtitle = get_post_meta($post->ID, 'sf_portfolio_subtitle', true); $permalink = get_permalink(); $custom_excerpt = 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); } $post_terms = get_the_terms($post->ID, 'portfolio-category'); $term_slug = " "; if (!empty($post_terms)) { foreach ($post_terms as $post_term) { $term_slug = $term_slug . $post_term->slug . ' '; } } /* COLUMN VARIABLE CONFIG ================================================== */ $item_class = $item_icon = ""; if ($columns == "2") { if ($sidebars == "both-sidebars") { $item_class = "col-sm-3 "; } else { if ($sidebars == "one-sidebar") { $item_class = "col-sm-4 "; } else { $item_class = "col-sm-6 "; $thumb_width = 800; $thumb_height = 600; $video_height = 600; } } } else { if ($columns == "3") { if ($sidebars == "both-sidebars") { $item_class = "col-sm-2 "; } else { if ($sidebars == "one-sidebar") { $item_class = "span-third "; } else { $item_class = "col-sm-4 "; $thumb_width = 600; $thumb_height = 450; $video_height = 450; } } } else { if ($columns == "4") { if ($sidebars == "both-sidebars") { $item_class = "col-sm-3 "; } else { if ($sidebars == "one-sidebar") { $item_class = "col-sm-2 "; } else { $item_class = "col-sm-3 "; } } } } } if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry=fw" || $display_type == "masonry-gallery-fw") { $thumb_height = NULL; } /* DISPLAY TYPE CONFIG ================================================== */ if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $item_class .= "masonry-item masonry-gallery-item"; } else { if ($display_type == "gallery") { $item_class .= "gallery-item "; } else { $item_class .= "standard "; } } /* LINK TYPE CONFIG ================================================== */ 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") { if ($enable_portfolio_gallery) { $link_config = 'href="' . $thumb_img_url . '" class="view" rel="item-gallery"'; } else { $link_config = 'href="' . $thumb_img_url . '" class="view"'; } $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']; } if ($enable_portfolio_gallery) { $link_config = 'href="' . $lightbox_image_url . '" class="view" rel="item-gallery"'; } else { $link_config = 'href="' . $lightbox_image_url . '" class="view"'; } $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="' . $permalink . '" class="link-to-post"'; $item_icon = "ss-navigateright"; } } } } } /* ITEM OUTPUT ================================================== */ $portfolio_items_output .= '<li itemscope itemtype="http://schema.org/CreativeWork" data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' ' . $term_slug . '">' . "\n"; /* THUMBNAIL CONFIG ================================================== */ if ($thumb_type != "none") { if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $portfolio_items_output .= '<figure class="animated-overlay">' . "\n"; } else { $portfolio_items_output .= '<figure class="animated-overlay overlay-alt">' . "\n"; } if ($thumb_type == "video") { $video = sf_video_embed($thumb_video, $thumb_width, $video_height); $portfolio_items_output .= $video; } else { if ($thumb_type == "slider") { $portfolio_items_output .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n"; foreach ($thumb_gallery as $image) { $portfolio_items_output .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n"; } $portfolio_items_output .= '</ul></div>' . "\n"; } else { if ($thumb_type == "image" && $thumb_img_url == "") { $thumb_img_url = "default"; } $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false); if ($image) { $portfolio_items_output .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />' . "\n"; $portfolio_items_output .= '<a ' . $link_config . '></a>'; if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) { $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-extended">'; } else { if ($display_type == "standard" || $display_type == "masonry" || $display_type == "masonry-fw") { $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-alt">'; } else { if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) { $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-excerpt">'; } else { $portfolio_items_output .= '<figcaption><div class="thumb-info">'; } } } if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw") { if ($hover_show_excerpt == "yes") { $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>'; $portfolio_items_output .= '<div itemprop="description">' . $post_excerpt . '</div>'; } else { $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>'; $portfolio_items_output .= '<h5 itemprop="name alternative">' . $item_subtitle . '</h5>'; } } $portfolio_items_output .= '<i class="' . $item_icon . '"></i>'; $portfolio_items_output .= '</div></figcaption>'; } } } $portfolio_items_output .= '</figure>' . "\n"; } if ($display_type != "gallery" && $display_type != "masonry-gallery" && $display_type != "masonry-gallery-fw") { $portfolio_items_output .= '<div class="portfolio-item-details">' . "\n"; $portfolio_items_output .= '<div class="comments-likes">'; if (function_exists('lip_love_it_link')) { $portfolio_items_output .= lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } $portfolio_items_output .= '</div>'; if ($show_title == "yes") { if ($enable_portfolio_gallery) { $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a href="' . $permalink . '" class="link-to-post">' . $item_title . '</a></h3>' . "\n"; } else { $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a ' . $link_config . '>' . $item_title . '</a></h3>' . "\n"; } } if ($show_subtitle == "yes" && $item_subtitle) { $portfolio_items_output .= '<h5 class="portfolio-subtitle" itemprop="alternativeHeadline">' . $item_subtitle . '</h5>' . "\n"; } if ($show_excerpt == "yes") { $portfolio_items_output .= '<div class="portfolio-item-excerpt" itemprop="description">' . $post_excerpt . '</div>' . "\n"; } $portfolio_items_output .= '</div>' . "\n"; } $portfolio_items_output .= '</li>' . "\n"; $count++; } wp_reset_postdata(); $portfolio_items_output .= '</ul>' . "\n"; /* PAGINATION OUTPUT ================================================== */ if ($pagination == "yes") { if ($display_type == "masonry" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") { $portfolio_items_output .= '<div class="pagination-wrap masonry-pagination">'; } else { $portfolio_items_output .= '<div class="pagination-wrap">'; } $portfolio_items_output .= pagenavi($portfolio_items); $portfolio_items_output .= '</div>'; } /* FUNCTION OUTPUT ================================================== */ return $portfolio_items_output; }
function widget($args, $instance) { global $post, $sf_options; extract($args); $remove_dates = $sf_options['remove_dates']; // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $post_id = $instance['post_id']; // Post ID echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if (function_exists('icl_object_id')) { $post_id = icl_object_id($post_id, 'post', true); } $infocus_post = get_post($post_id); ?> <div class="infocus-item"> <?php $post_title = $infocus_post->post_title; $post_permalink = get_post_permalink($infocus_post); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id); $thumb_video = sf_get_post_meta($post_id, 'sf_thumbnail_video_url', true); foreach ($thumb_image as $detail_image) { $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id($post_id); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = sf_aq_resize($thumb_img_url, 300, 225, true, false); $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true)); ?> <figure class="animated-overlay overlay-alt"> <?php if (sf_theme_opts_name() == "sf_atelier_options") { $post_date_month = get_the_date('M'); $post_date_day = get_the_date('d'); ?> <div class="date-overlay narrow-date-block"><span class="month"><?php echo $post_date_month; ?> </span><span class="day"><?php echo $post_date_day; ?> </span></div> <?php } ?> <?php if ($thumb_video != "") { ?> <?php echo sf_video_embed($thumb_video, 300, 200); ?> <?php } else { if ($image) { ?> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " alt="<?php echo $image_alt; ?> "/> <a href="<?php echo $post_permalink; ?> " class="infocus-image"></a> <div class="figcaption-wrap"></div> <figcaption> <div class="thumb-info thumb-info-alt"> <?php echo apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>'); ?> </div> </figcaption> <?php } } ?> </figure> <div class="infocus-title clearfix"> <?php if (sf_theme_opts_name() == "sf_atelier_options") { ?> <h4><a href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h4> <?php } else { if (sf_theme_opts_name() == "sf_uplift_options") { ?> <h5><a href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h5> <?php if (!$remove_dates) { echo '<div class="blog-item-details">' . sprintf(__('<time datetime="%1$s">%2$s</time>', 'swiftframework'), get_the_date('Y-m-d'), get_the_date()) . '</div>'; } ?> <?php } else { ?> <h5><a href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h5> <div class="comments-likes"> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link($post_id, '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } ?> </div> <?php } } ?> </div> </div> <?php echo $after_widget; }
<?php } ?> </div> <div class="share-links curved-bar-styling clearfix"> <div class="share-text"><?php _e("Share this gallery:", "swiftframework"); ?> </div> <ul> <li class="sf-love"> <div class="comments-likes"> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false); } ?> </div> </li> <li class="facebook"><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?> " class="post_share_facebook" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=220,width=600');return false;"><i class="fa-facebook"></i></a></li> <li class="twitter"><a href="https://twitter.com/share?url=<?php the_permalink(); ?> " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=260,width=600');return false;" class="product_share_twitter"><i class="fa-twitter"></i></a></li>
function wm_post_custom_metas($empty, $meta, $args) { //Requirements check if (!in_array($meta, array('likes', 'views'))) { return $empty; } //Helper variables $meta_output = $output = $title = ''; if ('likes' === $meta) { if (function_exists('zilla_likes')) { //ZillaLikes is prioritized as Love It does work 100% only on single post page global $zilla_likes; $meta_output = $zilla_likes->do_likes(); } elseif (function_exists('lip_love_it_link')) { $meta_output = lip_love_it_link(null, __('Like it!', 'mustang'), __('Liked already!', 'mustang'), false); } } elseif ('views' === $meta) { $title = __('Views count', 'mustang'); $meta_output = bawpvc_views_sc(array()); } //Add new meta $replacements = array('{attributes}' => ' title="' . $title . '"', '{class}' => 'entry-' . $meta . ' entry-meta-element', '{content}' => $meta_output); $replacements = apply_filters('wmhook_wm_post_custom_metas_replacements_' . $meta, $replacements); if (isset($args['html_custom'][$meta])) { $output .= strtr($args['html_custom'][$meta], $replacements); } else { $output .= strtr($args['html'], $replacements); } //Output return apply_filters('wmhook_wm_post_custom_metas_output', $empty . $output, $meta); }
function widget($args, $instance) { global $post; extract($args); // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $post_id = $instance['post_id']; // Post ID echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $infocus_post = get_post($post_id); ?> <div class="infocus-item"> <?php $post_title = $infocus_post->post_title; $post_permalink = get_post_permalink($infocus_post); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id); $thumb_video = get_post_meta($post_id, 'sf_thumbnail_video_url', true); foreach ($thumb_image as $detail_image) { $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id($post_id); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = aq_resize($thumb_img_url, 300, 225, true, false); ?> <figure> <?php if ($thumb_video != "") { ?> <?php echo video_embed($thumb_video, 300, 200); ?> <?php } else { if ($image) { ?> <a href="<?php echo $post_permalink; ?> " class="infocus-image"> <div class="overlay"> <div class="thumb-info"> <i class="icon-file-alt"></i> </div> </div> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " /> </a> <?php } } ?> </figure> <div class="infocus-title clearfix"> <h5><a href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h5> <div class="comments-likes"> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link($post_id, '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false); } ?> </div> </div> </div> <?php echo $after_widget; }
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 echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $recent_posts = new WP_Query(array('post_type' => 'post', 'ignore_sticky_posts' => 1, 'posts_per_page' => $number)); if ($recent_posts->have_posts()) { ?> <ul class="recent-posts-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); $post_title = get_the_title(); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_categories = get_the_category_list(); $post_comments = get_comments_number(); $post_permalink = get_permalink(); $thumb_image = get_post_thumbnail_id(); $thumb_img_url = wp_get_attachment_url($thumb_image, 'widget-image'); $image = aq_resize($thumb_img_url, 94, 75, true, false); ?> <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]; ?> " /> <?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> <span><?php printf(__('By <a href="%2$s">%1$s</a> on %3$s', 'swiftframework'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date); ?> </span> <div class="comments-likes"> <?php if (comments_open()) { ?> <a href="<?php echo $post_permalink; ?> #comment-area"><i class="icon-comments"></i><span><?php echo $post_comments; ?> </span></a> <?php } ?> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>'); } ?> </div> </div> </li> <?php wp_reset_query(); } ?> </ul> <?php } ?> <?php echo $after_widget; }