本文整理汇总了PHP中pagenavi函数的典型用法代码示例。如果您正苦于以下问题:PHP pagenavi函数的具体用法?PHP pagenavi怎么用?PHP pagenavi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pagenavi函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $output = $tax_terms = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'category' => '', 'pagination' => 'no', '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);
// CLIENTS QUERY SETUP
global $post, $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'paged' => $paged, 'clients-category' => $category_slug, 'posts_per_page' => $item_count);
$clients_items = new WP_Query($client_args);
$items .= '<ul class="clients-items clearfix">';
$client_width = 124;
$client_height = 124;
// CLIENTS LOOP
while ($clients_items->have_posts()) {
$clients_items->the_post();
$client_image = get_post_thumbnail_id();
$client_img_url = wp_get_attachment_url($client_image, 'full');
$client_link_url = get_post_meta($post->ID, 'sf_client_link', true);
$items .= '<li class="clearfix client-item">';
$items .= '<figure>';
$image = aq_resize($client_img_url, $client_width, $client_height, true, false);
if ($image) {
if ($client_link_url) {
$items .= '<a href="' . $client_link_url . '" target="_blank"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a>';
} else {
$items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />';
}
}
$items .= '</figure>';
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($clients_items);
$items .= '</div>';
}
// PAGE BUILDER OUPUT
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="wpb_clients_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper clients-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading wpb_text_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);
return $output;
}
示例2: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $output = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', "item_count" => '12', "category" => '', 'pagination' => '', '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;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$team_args = array('post_type' => 'team', 'post_status' => 'publish', 'paged' => $paged, 'team-category' => $category_slug, 'posts_per_page' => $item_count, 'ignore_sticky_posts' => 1);
$team_members = new WP_Query($team_args);
$count = 0;
$items .= '<ul class="team-members clearfix">';
while ($team_members->have_posts()) {
$team_members->the_post();
$member_name = get_the_title();
$member_position = get_post_meta($post->ID, 'sf_team_member_position', true);
$member_image = get_post_thumbnail_id();
$member_page_link = get_permalink();
$items .= '<li data-id="id-' . $count . '" class="clearfix team-member four columns">';
$img_url = wp_get_attachment_url($member_image, 'full');
$image = aq_resize($img_url, 220, 298, true, false);
$items .= '<figure>';
if ($image) {
$items .= '<a href="' . $member_page_link . '"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $member_name . '" /></a>';
}
$items .= '</figure>';
$items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
$items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
$items .= '<a class="read-more" href="' . $member_page_link . '">' . __("Find out more", "swiftframework") . '<i class="icon-chevron-right"></i></a>';
$items .= '</li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap full-width">';
$items .= pagenavi($team_members);
$items .= '</div>';
}
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="team_list_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="wpb_heading">' . $title . '</h3>' : '';
$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);
return $output;
}
示例3: content
public function content($atts, $content = null)
{
$title = $order = $items = $el_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => '', 'pagination' => 'no', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
$output = '';
// CATEGORY SLUG MODIFICATION
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
// JOBS QUERY SETUP
global $post, $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$jobs_args = array('orderby' => $order, 'post_type' => 'jobs', 'post_status' => 'publish', 'paged' => $paged, 'jobs-category' => $category_slug, 'posts_per_page' => $item_count);
$jobs = new WP_Query($jobs_args);
$items .= '<ul class="jobs clearfix">';
// PORTFOLIO LOOP
while ($jobs->have_posts()) {
$jobs->the_post();
$job_title = get_the_title();
$job_text = get_the_content();
$items .= '<li class="job">';
$items .= '<h3>' . $job_title . '</h3>';
$items .= '<div class="job-text">' . do_shortcode($job_text) . '</div>';
$items .= '</li>';
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($jobs);
$items .= '</div>';
}
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper jobs-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading wpb_text_heading"><span>' . $title . '</span></h3></div>' : '';
$output .= "\n\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);
return $output;
}
示例4: content
//.........这里部分代码省略.........
$image_width = 540;
$image_height = 540;
$item_class = 'col-sm-6';
} else {
if ($item_columns == "3") {
$image_width = 360;
$image_height = 360;
$item_class = 'col-sm-4';
} else {
$item_class = 'col-sm-3';
}
}
}
$items .= '<ul class="team-members row clearfix">';
while ($team_members->have_posts()) {
$team_members->the_post();
$member_name = get_the_title();
$member_position = sf_get_post_meta($post->ID, 'sf_team_member_position', true);
$member_bio = get_the_content();
$custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
if ($custom_excerpt != "") {
$member_bio = sf_custom_excerpt($custom_excerpt, 1000);
}
$member_email = sf_get_post_meta($post->ID, 'sf_team_member_email', true);
$member_phone = sf_get_post_meta($post->ID, 'sf_team_member_phone_number', true);
$member_twitter = sf_get_post_meta($post->ID, 'sf_team_member_twitter', true);
$member_facebook = sf_get_post_meta($post->ID, 'sf_team_member_facebook', true);
$member_linkedin = sf_get_post_meta($post->ID, 'sf_team_member_linkedin', true);
$member_google_plus = sf_get_post_meta($post->ID, 'sf_team_member_google_plus', true);
$member_skype = sf_get_post_meta($post->ID, 'sf_team_member_skype', true);
$member_instagram = sf_get_post_meta($post->ID, 'sf_team_member_instagram', true);
$member_dribbble = sf_get_post_meta($post->ID, 'sf_team_member_dribbble', true);
$member_xing = sf_get_post_meta($post->ID, 'sf_team_member_xing', true);
$member_image = get_post_thumbnail_id();
$member_link = get_permalink();
$items .= '<li itemscope data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">';
$img_url = wp_get_attachment_url($member_image, 'full');
$image = sf_aq_resize($img_url, $image_width, $image_height, true, false);
$items .= '<figure class="gallery-style">';
if ($image) {
$items .= '<a href="' . get_permalink() . '"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" /></a>';
}
$items .= '<figcaption>';
$items .= '<h5 class="team-member-name">' . $member_name . '</h5>';
$items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble || $member_xing != "") {
$items .= '<ul class="social-icons">';
if ($member_twitter) {
$items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>';
}
if ($member_facebook) {
$items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>';
}
if ($member_linkedin) {
$items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>';
}
if ($member_google_plus) {
$items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>';
}
if ($member_skype) {
$items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>';
}
if ($member_instagram) {
$items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>';
}
if ($member_dribbble) {
$items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>';
}
if ($member_xing) {
$items .= '<li class="xing"><a href="' . $member_xing . '" target="_blank"><i class="fa-xing"></i><i class="fa-xing"></i></a></li>';
}
$items .= '</ul>';
}
$items .= '</figcaption>';
$items .= '</figure>';
$items .= '</li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($team_members);
$items .= '</div>';
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="team_list_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper">';
$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);
global $sf_include_isotope, $sf_has_team;
$sf_include_isotope = true;
$sf_has_team = true;
return $output;
}
示例5: pagenavi
<?php
if ($pagination == "infinite-scroll") {
global $sf_include_infscroll;
$sf_include_infscroll = true;
$pagination_output .= '<div class="pagination-wrap hidden">';
$pagination_output .= pagenavi($wp_query);
$pagination_output .= '</div>';
} else {
if ($pagination == "load-more") {
global $sf_include_infscroll;
$sf_include_infscroll = true;
$pagination_output .= '<a href="#" class="load-more-btn">' . __('Load More', 'swiftframework') . '</a>';
$pagination_output .= '<div class="pagination-wrap load-more hidden">';
$pagination_output .= pagenavi($wp_query);
$pagination_output .= '</div>';
} else {
if ($pagination == "standard") {
if ($blog_type == "masonry") {
$pagination_output .= '<div class="pagination-wrap masonry-pagination">';
} else {
$pagination_output .= '<div class="pagination-wrap">';
}
$pagination_output .= pagenavi($wp_query);
$pagination_output .= '</div>';
}
}
}
echo $pagination_output;
?>
</div>
示例6: content
//.........这里部分代码省略.........
} else {
if ($width == "2/3") {
$columns = 4;
$item_size_class = 'span2';
} else {
if ($width == "3/4") {
$columns = 3;
$item_size_class = 'span3';
} else {
if ($column_width != "") {
if ($column_width == "1/3") {
$columns = 2;
} else {
if ($column_width == "1/2") {
$columns = 3;
} else {
if ($column_width == "3/4") {
$columns = 4;
} else {
$columns = 6;
}
}
}
} else {
$columns = 6;
}
}
}
}
}
}
$auto = false;
if ($carousel_auto == "yes") {
$auto = true;
}
if ($carousel == "yes" || $carousel == "") {
$items .= '<div class="carousel-wrap">';
$items .= '<div id="carousel-' . $sf_carouselID . '" class="clients carousel-items clearfix" data-columns="' . $columns . '" data-auto="' . $auto . '">';
} else {
$items .= '<div class="carousel-grid row">';
}
$client_width = apply_filters('sf_clients_image_width', 200);
$client_height = apply_filters('sf_clients_image_height', 200);
// CLIENTS LOOP
while ($clients_items->have_posts()) {
$clients_items->the_post();
$client_image = get_post_thumbnail_id();
$client_img_url = wp_get_attachment_url($client_image, 'full');
$client_link_url = sf_get_post_meta($post->ID, 'sf_client_link', true);
$client_link_same_window = sf_get_post_meta($post->ID, 'sf_client_link_same_window', true);
$image_alt = esc_attr(sf_get_post_meta($client_image, '_wp_attachment_image_alt', true));
$target = "_blank";
$items .= '<div class="clearfix carousel-item client-item ' . $item_size_class . '">';
$items .= '<figure>';
$image = sf_aq_resize($client_img_url, $client_width, $client_height, true, false);
if ($image) {
if ($client_link_url) {
if ($client_link_same_window) {
$target = "_self";
}
$items .= '<a href="' . $client_link_url . '" target="' . $target . '"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></a>';
} else {
$items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />';
}
}
$items .= '</figure>';
$items .= '</div>';
}
wp_reset_postdata();
if ($carousel == "yes" || $carousel == "") {
$items .= '</div>';
$items .= '<a href="#" class="carousel-prev"><i class="ss-navigateleft"></i></a><a href="#" class="carousel-next"><i class="ss-navigateright"></i></a>';
$options = get_option('sf_dante_options');
if ($options['enable_swipe_indicators']) {
$items .= '<div class="sf-swipe-indicator"></div>';
}
$items .= '</div>';
} else {
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($clients_items);
$items .= '</div>';
}
}
// PAGE BUILDER OUPUT
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_clients_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper clients-wrap carousel-wrap alt-nav">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading spb-text-heading"><span>' . $title . '</span></h3>' : '';
$output .= "\n\t\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
global $sf_include_carousel;
$sf_include_carousel = true;
return $output;
}
示例7: sf_blog_items
//.........这里部分代码省略.........
$item_class = "col-sm-6";
} else {
if ($columns == "1") {
$item_class = "col-sm-12";
}
}
}
}
}
} else {
$item_class = "col-sm-12";
}
}
}
$taxonomy_name = 'category';
if ($post_type != "post") {
$taxonomy_name = $post_type . '-category';
}
$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 . $post_term->slug . ' ';
}
}
/* BLOG ITEM OUTPUT
================================================== */
$blog_items_output .= '<li itemscope itemtype="http://schema.org/BlogPosting" class="blog-item ' . $item_class . ' ' . $term_slug . ' ' . implode(' ', get_post_class()) . '" id="' . get_the_ID() . '" data-date="' . get_the_time('U') . '">';
$blog_items_output .= sf_get_post_item($post->ID, $blog_type, $show_title, $show_excerpt, $show_details, $excerpt_length, $content_output, $show_read_more, $fullwidth);
$blog_items_output .= '</li>';
}
wp_reset_query();
wp_reset_postdata();
$blog_items_output .= '</ul>';
/* SOCIAL INTEGRATION
================================================== */
if ($social_integration == "yes" && $pagination == "none") {
$tweet_count = $instagram_count = floor($item_count / 4);
$item_count = $item_count - $tweet_count - $instagram_count;
if ($instagram_id == "") {
$tweet_count = $tweet_count * 2;
} else {
if ($twitter_username == "") {
$instagram_count = $instagram_count * 2;
}
}
if ($insta_item_count != "") {
$instagram_count = $insta_item_count;
}
if ($tweet_item_count != "") {
$tweet_count = $tweet_item_count;
}
/* TWEETS
================================================== */
if ($twitter_username != "") {
if ($fullwidth == "yes") {
$blog_items_output .= '<ul class="blog-tweets">' . sf_get_tweets($twitter_username, $tweet_count, 'blog-fw', $item_class) . '</ul>';
} else {
$blog_items_output .= '<ul class="blog-tweets">' . sf_get_tweets($twitter_username, $tweet_count, 'blog', $item_class) . '</ul>';
}
}
/* INSTAGRAMS
================================================== */
if ($instagram_id != "" && $instagram_token != "") {
$blog_items_output .= '<ul class="blog-instagrams" data-title="' . __("Instagram", "swiftframework") . '" data-count="' . $instagram_count . '" data-userid="' . $instagram_id . '" data-token="' . $instagram_token . '" data-itemclass="' . $item_class . '"></ul>';
}
}
/* PAGINATION OUTPUT
================================================== */
if ($pagination == "infinite-scroll") {
global $sf_include_infscroll;
$sf_include_infscroll = true;
$blog_items_output .= '<div class="pagination-wrap hidden">';
$blog_items_output .= pagenavi($blog_items);
$blog_items_output .= '</div>';
} else {
if ($pagination == "load-more") {
global $sf_include_infscroll;
$sf_include_infscroll = true;
$blog_items_output .= '<a href="#" class="load-more-btn">' . __('Load More', 'swiftframework') . '</a>';
$blog_items_output .= '<div class="pagination-wrap load-more hidden">';
$blog_items_output .= pagenavi($blog_items);
$blog_items_output .= '</div>';
} else {
if ($pagination == "standard") {
if ($blog_type == "masonry") {
$blog_items_output .= '<div class="pagination-wrap masonry-pagination">';
} else {
$blog_items_output .= '<div class="pagination-wrap">';
}
$blog_items_output .= pagenavi($blog_items);
$blog_items_output .= '</div>';
}
}
}
$blog_items_output .= '</div>';
/* FUNCTION OUTPUT
================================================== */
return $blog_items_output;
}
示例8: content
//.........这里部分代码省略.........
} 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="' . $permalink . '" class="link-to-post"';
$item_icon = "file";
}
}
}
}
}
$items .= '<li data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' columns' . $term_slug . '">';
$items .= '<figure>';
// THUMBNAIL MEDIA TYPE SETUP
if ($thumb_type == "video") {
if ($display_type == "bordered" || $display_type == "bordered_gallery") {
$video = video_embed($thumb_video, $bordered_thumb_width, $bordered_video_height);
} else {
$video = video_embed($thumb_video, $thumb_width, $video_height);
}
$items .= $video;
} else {
if ($thumb_type == "slider") {
$items .= '<div class="flexslider thumb-slider"><ul class="slides">';
foreach ($thumb_gallery as $image) {
$items .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>";
}
$items .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>';
} else {
if ($display_type == "bordered" || $display_type == "bordered_gallery") {
$image = aq_resize($thumb_img_url, $bordered_thumb_width, $bordered_thumb_height, true, false);
} else {
$image = aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
}
if ($image) {
$items .= '<a ' . $link_config . '>';
$items .= '<div class="overlay"><div class="thumb-info">';
if ($display_type == "gallery" || $display_type == "bordered_gallery") {
$items .= '<h4>' . $item_title . '</h4>';
$items .= '<i class="icon-' . $item_icon . ' small-icon"></i>';
} else {
$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>';
// ITEM INFO SETUP
if ($display_type != "gallery" && $display_type != "bordered_gallery") {
$items .= '<div class="portfolio-item-details">';
if ($show_title == "yes") {
$items .= '<h4 class="portfolio-item-title"><a ' . $link_config . '>' . $item_title . '</a></h4>';
}
if ($show_client == "yes" && $item_client) {
$items .= '<span class="portfolio-client-title">' . $item_client . '</span>';
}
if ($show_excerpt == "yes") {
$items .= '<div class="portfolio-item-excerpt">' . $post_excerpt . '</div>';
}
$items .= '</div>';
}
$items .= '</li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap full-width">';
$items .= pagenavi($portfolio_items);
$items .= '</div>';
}
// PAGE BUILDER OUPUT
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="wpb_portfolio_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper portfolio-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h2 class="wpb_heading">' . $title . '</h2></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_isotope;
global $has_portfolio;
$include_isotope = true;
$has_portfolio = true;
return $output;
}
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:101,代码来源:portfolio+(Kristian+Klamar's+conflicted+copy+2013-03-25).php
示例9: sf_portfolio_items
//.........这里部分代码省略.........
/* 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;
}
示例10: sf_blog_items
function sf_blog_items($blog_type, $masonry_effect_type, $show_title, $show_excerpt, $show_details, $excerpt_length, $content_output, $show_read_more, $item_count, $category, $exclude_categories, $pagination, $sidebar_config, $width, $offset, $posts_order)
{
$blog_items_output = "";
$options = get_option('sf_dante_options');
$filter_wrap_bg = $options['filter_wrap_bg'];
global $sf_sidebar_config;
$sf_sidebar_config = $sidebar_config;
/* 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');
$offset = $offset + $item_count * ($paged - 1);
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
$offset = $offset + $item_count * ($paged - 1);
} else {
$paged = 1;
}
$blog_args = array();
$category_array = explode(",", $category_slug);
if (isset($category_array) && $category_array[0] != "") {
$blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order, 'tax_query' => array(array('taxonomy' => 'category', 'field' => 'slug', 'terms' => $category_array)));
} else {
$blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
}
$blog_items = new WP_Query($blog_args);
/* LIST CLASS CONFIG
================================================== */
$list_class = $wrap_class = '';
if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
$list_class .= 'masonry-items first-load grid ' . $masonry_effect_type;
} else {
if ($blog_type == "mini") {
$list_class .= 'mini-items';
} else {
$list_class .= 'standard-items';
if ($sidebar_config == "no-sidebars") {
$wrap_class .= 'col-sm-8 col-sm-offset-2';
}
}
}
/* BLOG ITEMS OUTPUT
================================================== */
$blog_items_output .= '<div class="blog-items-wrap blog-' . $blog_type . ' ' . $wrap_class . '">';
if ($blog_type == "standard") {
$blog_items_output .= '<div class="timeline"></div>';
}
if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
$blog_items_output .= '<ul class="blog-items row ' . $list_class . ' clearfix" id="blogGrid">';
} else {
$blog_items_output .= '<ul class="blog-items row ' . $list_class . ' clearfix">';
}
while ($blog_items->have_posts()) {
$blog_items->the_post();
$post_format = get_post_format($post->ID);
if ($post_format == "") {
$post_format = 'standard';
}
if ($blog_type == "mini") {
$item_class = "col-sm-12";
} else {
if ($blog_type == "masonry") {
if ($sidebar_config == "both-sidebars") {
$item_class = "col-sm-3";
} else {
$item_class = "col-sm-4";
}
} else {
if ($blog_type == "masonry-fw") {
$item_class = "col-sm-3";
} else {
$item_class = $width;
}
}
}
/* BLOG ITEM OUTPUT
================================================== */
$blog_items_output .= '<li itemscope itemtype="http://schema.org/BlogPosting" class="blog-item ' . $item_class . ' ' . implode(' ', get_post_class()) . '" id="' . get_the_ID() . '">';
$blog_items_output .= sf_get_post_item($post->ID, $blog_type, $show_title, $show_excerpt, $show_details, $excerpt_length, $content_output, $show_read_more);
$blog_items_output .= '</li>';
}
wp_reset_postdata();
$blog_items_output .= '</ul>';
/* PAGINATION OUTPUT
================================================== */
if ($pagination == "infinite-scroll") {
global $sf_include_infscroll;
$sf_include_infscroll = true;
$blog_items_output .= '<div class="pagination-wrap inf-scroll-pagination hidden">';
$blog_items_output .= pagenavi($blog_items);
//.........这里部分代码省略.........
示例11: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $carousel = $item_class = $output = $tax_terms = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'item_columns' => '4', 'category' => '', 'carousel' => 'no', 'carousel_columns' => '', 'pagination' => 'no', '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);
// CLIENTS QUERY SETUP
global $post, $wp_query, $sf_carouselID;
if ($sf_carouselID == "") {
$sf_carouselID = 1;
} else {
$sf_carouselID++;
}
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$client_args = array('post_type' => 'clients', 'post_status' => 'publish', 'paged' => $paged, 'clients-category' => $category_slug, 'posts_per_page' => $item_count);
$clients_items = new WP_Query($client_args);
global $column_width;
$client_width = 300;
$client_height = 300;
if ($item_columns == "5") {
$item_class = 'col-sm-sf-5';
} else {
if ($item_columns == "4") {
$item_class = 'col-sm-3';
} else {
if ($item_columns == "3") {
$item_class = 'col-sm-4';
$client_width = 400;
$client_height = 400;
}
}
}
if ($item_columns == "2") {
$item_class = 'col-sm-6';
$client_width = 600;
$client_height = 600;
}
if ($carousel == "yes") {
$items .= '<div id="carousel-' . $sf_carouselID . '" class="clients-items carousel-items clearfix" data-columns="' . $item_columns . '">';
} else {
$items .= '<div class="clients-items row clearfix">';
}
// CLIENTS LOOP
while ($clients_items->have_posts()) {
$clients_items->the_post();
$client_image = get_post_thumbnail_id();
$client_img_url = wp_get_attachment_url($client_image, 'full');
$client_link_url = sf_get_post_meta($post->ID, 'sf_client_link', true);
$image_alt = esc_attr(sf_get_post_meta($client_image, '_wp_attachment_image_alt', true));
if ($carousel == "yes") {
$items .= '<div class="clearfix carousel-item">';
} else {
$items .= '<div class="' . $item_class . ' client-item clearfix">';
}
$items .= '<figure>';
$image = sf_aq_resize($client_img_url, $client_width, $client_height, true, false);
if ($image) {
if ($client_link_url) {
$items .= '<a href="' . $client_link_url . '" target="_blank"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></a>';
} else {
$items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />';
}
}
$items .= '</figure>';
$items .= '</div>';
}
wp_reset_query();
wp_reset_postdata();
$items .= '</div>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($clients_items);
$items .= '</div>';
}
// PAGE BUILDER OUPUT
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_clients_widget clients-wrap carousel-asset spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
$output .= "\n\t\t" . '<div class="title-wrap clearfix">';
if ($title != '') {
$output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
}
if ($carousel == "yes") {
$output .= spb_carousel_arrows();
}
$output .= '</div>';
$output .= "\n\t\t" . $items;
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
global $sf_include_carousel;
$sf_include_carousel = true;
//.........这里部分代码省略.........
示例12: content
//.........这里部分代码省略.........
$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;
}
示例13: sf_galleries
//.........这里部分代码省略.........
$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;
}
示例14: content
//.........这里部分代码省略.........
$sidebar_config = "no-sidebars";
}
if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
$item_class = 'span2';
} else {
if ($sidebar_config == "both-sidebars") {
$item_class = 'span-bs-quarter';
} else {
$item_class = 'span3';
}
}
$items .= '<ul class="team-members row clearfix">';
while ($team_members->have_posts()) {
$team_members->the_post();
$member_name = get_the_title();
$member_position = get_post_meta($post->ID, 'sf_team_member_position', true);
$member_bio = get_the_content_with_formatting();
$member_email = get_post_meta($post->ID, 'sf_team_member_email', true);
$member_phone = get_post_meta($post->ID, 'sf_team_member_phone_number', true);
$member_twitter = get_post_meta($post->ID, 'sf_team_member_twitter', true);
$member_facebook = get_post_meta($post->ID, 'sf_team_member_facebook', true);
$member_linkedin = get_post_meta($post->ID, 'sf_team_member_linkedin', true);
$member_google_plus = get_post_meta($post->ID, 'sf_team_member_google_plus', true);
$member_skype = get_post_meta($post->ID, 'sf_team_member_skype', true);
$member_instagram = get_post_meta($post->ID, 'sf_team_member_instagram', true);
$member_dribbble = get_post_meta($post->ID, 'sf_team_member_dribbble', true);
$member_image = get_post_thumbnail_id();
$items .= '<li data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">';
$img_url = wp_get_attachment_url($member_image, 'full');
$image = aq_resize($img_url, 270, 270, true, false);
$items .= '<figure>';
if ($image) {
$items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />';
}
$items .= '</figure>';
$items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
$items .= '<h4 class="team-member-position">' . $member_position . '</h4>';
$items .= '<div class="team-member-details-wrap">';
$items .= '<div class="team-member-bio">' . do_shortcode($member_bio) . '</div>';
if ($member_email || $member_phone) {
$items .= '<ul class="member-contact">';
if ($member_email) {
$items .= '<li><span>E:</span> <a href="mailto:' . $member_email . '">' . $member_email . '</a></li>';
}
if ($member_phone) {
$items .= '<li><span>P:</span>' . $member_phone . '</li>';
}
$items .= '</ul>';
}
if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble) {
$items .= '<ul class="social-icons ' . $social_icon_type . ' small">';
if ($member_twitter) {
$items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank">Twitter</a></li>';
}
if ($member_facebook) {
$items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank">Facebook</a></li>';
}
if ($member_linkedin) {
$items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank">LinkedIn</a></li>';
}
if ($member_google_plus) {
$items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank">Google+</a></li>';
}
if ($member_skype) {
$items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank">Skype</a></li>';
}
if ($member_instagram) {
$items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank">Instagram</a></li>';
}
if ($member_dribbble) {
$items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank">Dribbble</a></li>';
}
$items .= '</ul>';
}
$items .= '</li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
// PAGINATION
if ($pagination == "yes") {
$items .= '<div class="pagination-wrap">';
$items .= pagenavi($team_members);
$items .= '</div>';
}
$el_class = $this->getExtraClass($el_class);
$width = wpb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="team_list_widget wpb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="wpb_heading"><span>' . $title . '</span></h3>' : '';
$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_isotope;
global $has_team;
$include_isotope = true;
$has_team = true;
return $output;
}
示例15: sf_portfolio_items
//.........这里部分代码省略.........
}
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;
}