コード例 #1
0
			<?php 
if (mfn_opts_get('portfolio-related') && $aCategories) {
    $related_count = intval(mfn_opts_get('portfolio-related'));
    $related_cols = 'col-' . absint(mfn_opts_get('portfolio-related-columns', 3));
    $args = array('post_type' => 'portfolio', 'tax_query' => array(array('taxonomy' => 'portfolio-types', 'field' => 'term_id', 'terms' => $aCategories)), 'post__not_in' => array(get_the_ID()), 'posts_per_page' => $related_count, 'post_status' => 'publish', 'no_found_rows' => true, 'ignore_sticky_posts' => true);
    $query_related_posts = new WP_Query($args);
    if ($query_related_posts->have_posts()) {
        echo '<div class="section-related-adjustment">';
        echo '<h4>' . $translate['related'] . '</h4>';
        echo '<div class="section-related-ul ' . $related_cols . '">';
        while ($query_related_posts->have_posts()) {
            $query_related_posts->the_post();
            echo '<div class="column post-related ' . implode(' ', get_post_class()) . '">';
            echo '<div class="image_frame scale-with-grid">';
            echo '<div class="image_wrapper">';
            echo mfn_post_thumbnail(get_the_ID(), 'portfolio');
            echo '</div>';
            echo '</div>';
            echo '<div class="date_label">' . get_the_date() . '</div>';
            echo '<div class="desc">';
            echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
            echo '<hr class="hr_color" />';
            echo '<a href="' . get_permalink() . '" class="button button_left button_js"><span class="button_icon"><i class="icon-layout"></i></span><span class="button_label">' . $translate['readmore'] . '</span></a>';
            echo '</div>';
            echo '</div>';
        }
        echo '</div>';
        echo '</div>';
    }
    wp_reset_postdata();
}
コード例 #2
0
 function mfn_content_post($query = false, $style = false, $load_more = false)
 {
     global $wp_query;
     $output = '';
     $translate['published'] = mfn_opts_get('translate') ? mfn_opts_get('translate-published', 'Published by') : __('Published by', 'betheme');
     $translate['at'] = mfn_opts_get('translate') ? mfn_opts_get('translate-at', 'at') : __('at', 'betheme');
     $translate['categories'] = mfn_opts_get('translate') ? mfn_opts_get('translate-categories', 'Categories') : __('Categories', 'betheme');
     $translate['like'] = mfn_opts_get('translate') ? mfn_opts_get('translate-like', 'Do you like it?') : __('Do you like it?', 'betheme');
     $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore', 'Read more') : __('Read more', 'betheme');
     if (!$query) {
         $query = $wp_query;
     }
     if (!$style) {
         if ($_GET && key_exists('mfn-b', $_GET)) {
             $style = $_GET['mfn-b'];
             // demo
         } else {
             $style = mfn_opts_get('blog-layout', 'classic');
         }
     }
     if ($query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             // classes
             $post_class = array('post-item', 'isotope-item', 'clearfix');
             if (!mfn_post_thumbnail(get_the_ID())) {
                 $post_class[] = 'no-img';
             }
             if (post_password_required()) {
                 $post_class[] = 'no-img';
             }
             $post_class[] = 'author-' . mfn_slug(get_the_author_meta('user_login'));
             $post_class = implode(' ', get_post_class($post_class));
             // background color | Style - Masonry Tiles
             $bg_color = get_post_meta(get_the_ID(), 'mfn-post-bg', true);
             if ($bg_color && $style == 'masonry tiles') {
                 $bg_color = 'style="background-color:' . $bg_color . ';"';
             }
             $output .= '<div class="' . $post_class . '" ' . $bg_color . '>';
             // icon | Style == Masonry Tiles
             if ($style == 'masonry tiles') {
                 if (get_post_format() == 'video') {
                     $output .= '<i class="post-format-icon icon-play"></i>';
                 } elseif (get_post_format() == 'quote') {
                     $output .= '<i class="post-format-icon icon-quote"></i>';
                 } elseif (get_post_format() == 'link') {
                     $output .= '<i class="post-format-icon icon-link"></i>';
                 } elseif (get_post_format() == 'audio') {
                     // for future use
                     $output .= '<i class="post-format-icon icon-music-line"></i>';
                 } else {
                     $rev_slider = get_post_meta(get_the_ID(), 'mfn-post-slider', true);
                     $lay_slider = get_post_meta(get_the_ID(), 'mfn-post-slider-layer', true);
                     if ($rev_slider || $lay_slider) {
                         $output .= '<i class="post-format-icon icon-code"></i>';
                     }
                 }
             }
             // date | Style == Timeline
             $output .= '<div class="date_label">' . get_the_date() . '</div>';
             // photo --------------------------------------------------------------------------
             if (!post_password_required()) {
                 if ($style == 'masonry tiles') {
                     // photo | Style != Masonry Tiles
                     $output .= '<div class="post-photo-wrapper scale-with-grid">';
                     $output .= get_the_post_thumbnail(get_the_ID(), 'full', array('class' => 'scale-with-grid', 'itemprop' => 'image'));
                     $output .= '</div>';
                 } else {
                     // photo | Style == *
                     $output .= '<div class="image_frame post-photo-wrapper scale-with-grid">';
                     $output .= '<div class="image_wrapper">';
                     $output .= mfn_post_thumbnail(get_the_ID(), 'blog', $style, $load_more);
                     $output .= '</div>';
                     $output .= '</div>';
                 }
             }
             // desc ---------------------------------------------------------------------------
             $output .= '<div class="post-desc-wrapper">';
             $output .= '<div class="post-desc">';
             // head -------------------------------------
             $output .= '<div class="post-head">';
             // meta -------------------------------------
             if (mfn_opts_get('blog-meta')) {
                 $output .= '<div class="post-meta clearfix">';
                 $output .= '<div class="author-date">';
                 $output .= '<span class="vcard author post-author">';
                 $output .= '<span class="label">' . $translate['published'] . ' </span>';
                 $output .= '<i class="icon-user"></i> ';
                 $output .= '<span class="fn"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author_meta('display_name') . '</a></span>';
                 $output .= '</span> ';
                 $output .= '<span class="date">';
                 $output .= '<span class="label">' . $translate['at'] . ' </span>';
                 $output .= '<i class="icon-clock"></i> ';
                 $output .= '<span class="post-date updated">' . get_the_date() . '</span>';
                 $output .= '</span>';
                 // .post-comments | Style == Masonry Tiles
                 if ($style == 'masonry tiles' && comments_open() && mfn_opts_get('blog-comments')) {
                     $output .= '<div class="post-links">';
                     $output .= '<i class="icon-comment-empty-fa"></i> <a href="' . get_comments_link() . '" class="post-comments">' . get_comments_number() . '</a>';
                     $output .= '</div>';
                 }
                 $output .= '</div>';
                 $output .= '<div class="category">';
                 $output .= '<span class="cat-btn">' . $translate['categories'] . ' <i class="icon-down-dir"></i></span>';
                 $output .= '<div class="cat-wrapper">' . get_the_category_list() . '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
             // .post-footer | Style == Photo
             if ($style == 'photo') {
                 $output .= '<div class="post-footer">';
                 $output .= '<div class="button-love"><span class="love-text">' . $translate['like'] . '</span>' . mfn_love() . '</div>';
                 $output .= '<div class="post-links">';
                 if (comments_open() && mfn_opts_get('blog-comments')) {
                     $output .= '<i class="icon-comment-empty-fa"></i> <a href="' . get_comments_link() . '" class="post-comments">' . get_comments_number() . '</a>';
                 }
                 $output .= '<i class="icon-doc-text"></i> <a href="' . get_permalink() . '" class="post-more">' . $translate['readmore'] . '</a>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
             $output .= '</div>';
             // title -------------------------------------
             $output .= '<div class="post-title">';
             if (get_post_format() == 'quote') {
                 // quote ----------------------------
                 $output .= '<blockquote><a href="' . get_permalink() . '">' . get_the_title() . '</a></blockquote>';
             } elseif (get_post_format() == 'link') {
                 // link ----------------------------
                 $output .= '<i class="icon-link"></i>';
                 $output .= '<div class="link-wrapper">';
                 $output .= '<h4>' . get_the_title() . '</h4>';
                 $link = get_post_meta(get_the_ID(), 'mfn-post-link', true);
                 $output .= '<a target="_blank" href="' . $link . '">' . $link . '</a>';
                 $output .= '</div>';
             } else {
                 // default ----------------------------
                 $output .= '<h2 class="entry-title" itemprop="headline"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
             }
             $output .= '</div>';
             // content -------------------------------------
             $output .= '<div class="post-excerpt">' . get_the_excerpt() . '</div>';
             // .post-footer | Style != Photo, Masonry Tiles
             if (!in_array($style, array('photo', 'masonry tiles'))) {
                 $output .= '<div class="post-footer">';
                 $output .= '<div class="button-love"><span class="love-text">' . $translate['like'] . '</span>' . mfn_love() . '</div>';
                 $output .= '<div class="post-links">';
                 if (comments_open() && mfn_opts_get('blog-comments')) {
                     $output .= '<i class="icon-comment-empty-fa"></i> <a href="' . get_comments_link() . '" class="post-comments">' . get_comments_number() . '</a>';
                 }
                 $output .= '<i class="icon-doc-text"></i> <a href="' . get_permalink() . '" class="post-more">' . $translate['readmore'] . '</a>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
         }
     }
     return $output;
 }
コード例 #3
0
 function mfn_content_portfolio($query = false, $style = false)
 {
     global $wp_query;
     $output = '';
     $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore', 'Read more') : __('Read more', 'betheme');
     $translate['client'] = mfn_opts_get('translate') ? mfn_opts_get('translate-client', 'Client') : __('Client', 'betheme');
     $translate['date'] = mfn_opts_get('translate') ? mfn_opts_get('translate-date', 'Date') : __('Date', 'betheme');
     $translate['website'] = mfn_opts_get('translate') ? mfn_opts_get('translate-website', 'Website') : __('Website', 'betheme');
     $translate['view'] = mfn_opts_get('translate') ? mfn_opts_get('translate-view', 'View website') : __('View website', 'betheme');
     if (!$query) {
         $query = $wp_query;
     }
     if (!$style) {
         if ($_GET && key_exists('mfn-p', $_GET)) {
             $style = $_GET['mfn-p'];
             // demo
         } else {
             $style = mfn_opts_get('portfolio-layout', 'grid');
         }
     }
     if ($query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             $item_class = array();
             $categories = '';
             $terms = get_the_terms(get_the_ID(), 'portfolio-types');
             if (is_array($terms)) {
                 foreach ($terms as $term) {
                     $item_class[] = 'category-' . $term->slug;
                     $categories .= '<a href="' . site_url() . '/portfolio-types/' . $term->slug . '">' . $term->name . '</a>, ';
                 }
                 $categories = substr($categories, 0, -2);
             }
             $item_class[] = get_post_meta(get_the_ID(), 'mfn-post-size', true);
             $item_class[] = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
             $item_class = implode(' ', $item_class);
             // full width sections for list style
             if ($item_bg = get_post_meta(get_the_ID(), 'mfn-post-bg', true)) {
                 $item_bg = 'style="background-image:url(' . $item_bg . ');"';
             }
             $external = mfn_opts_get('portfolio-external');
             $ext_link = get_post_meta(get_the_ID(), 'mfn-post-link', true);
             $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
             // Image Link ---------------------------------------------------------------------
             if (in_array($external, array('disable', 'popup'))) {
                 // disable details & link popup
                 $link_before = '<a class="link" href="' . $large_image_url[0] . '" rel="prettyphoto">';
             } elseif ($external && $ext_link) {
                 // link to project website
                 $link_before = '<a class="link" href="' . $ext_link . '" target="' . $external . '">';
             } else {
                 // link to project details
                 $link_before = '<a class="link" href="' . get_permalink() . '">';
             }
             // Echo ---------------------------------------------------------------------------
             $output .= '<li class="portfolio-item isotope-item ' . $item_class . '">';
             if ($style == 'masonry-hover') {
                 // style: Masonry Hover ---------------------------------------------------
                 $output .= '<div class="masonry-hover-wrapper">';
                 // desc -------------------
                 $bg_color = get_post_meta(get_the_ID(), 'mfn-post-bg-hover', true);
                 if ($bg_color) {
                     $bg_color = 'style="background-color:' . $bg_color . ';"';
                 }
                 $output .= '<div class="hover-desc" ' . $bg_color . '>';
                 $output .= '<div class="desc-inner">';
                 $output .= '<h3 class="entry-title" itemprop="headline">' . $link_before . get_the_title() . '</a></h3>';
                 $output .= '<div class="desc-wrappper">';
                 $output .= get_the_excerpt();
                 $output .= '</div>';
                 $output .= '</div>';
                 if ($external != 'disable') {
                     $output .= '<div class="links-wrappper clearfix">';
                     if (!in_array($external, array('_self', '_blank'))) {
                         $output .= '<a class="zoom" href="' . $large_image_url[0] . '" rel="prettyphoto"><i class="icon-search"></i></a>';
                     }
                     if ($ext_link) {
                         $output .= '<a class="external" target="_blank" href="' . $ext_link . '" ><i class="icon-forward"></i></a>';
                     }
                     if (!$external) {
                         $output .= $link_before . '<i class="icon-link"></i></a>';
                     }
                     $output .= '</div>';
                 }
                 $output .= '</div>';
                 // photo ------------------
                 $output .= '<div class="image-wrapper scale-with-grid">';
                 $output .= $link_before;
                 $output .= get_the_post_thumbnail(get_the_ID(), 'blog-vertical', array('class' => 'scale-with-grid', 'itemprop' => 'image'));
                 $output .= '</a>';
                 $output .= '</div>';
                 $output .= '</div>';
             } else {
                 // style: All -------------------------------------------------------------
                 $output .= '<div class="portfolio-item-fw-bg" ' . $item_bg . '>';
                 $output .= '<div class="portfolio-item-fw-wrapper">';
                 // style: List | Desc ---------------------------------------------
                 $output .= '<div class="list_style_header">';
                 $output .= '<h3 class="entry-title" itemprop="headline">' . $link_before . get_the_title() . '</a></h3>';
                 $output .= '<div class="links_wrapper">';
                 $output .= '<a href="#" class="button button_js portfolio_prev_js"><span class="button_icon"><i class="icon-up-open"></i></span></a>';
                 $output .= '<a href="#" class="button button_js portfolio_next_js"><span class="button_icon"><i class="icon-down-open"></i></span></a>';
                 $output .= '<a href="' . get_permalink() . '" class="button button_left button_theme button_js"><span class="button_icon"><i class="icon-link"></i></span><span class="button_label">' . $translate['readmore'] . '</span></a>';
                 $output .= '</div>';
                 $output .= '</div>';
                 // style: All | Photo ---------------------------------------------
                 $output .= '<div class="image_frame scale-with-grid">';
                 $output .= '<div class="image_wrapper">';
                 $output .= mfn_post_thumbnail(get_the_ID(), 'portfolio', $style);
                 $output .= '</div>';
                 $output .= '</div>';
                 // style: All | Desc ----------------------------------------------
                 $output .= '<div class="desc">';
                 $output .= '<div class="title_wrapper">';
                 $output .= '<h5 class="entry-title" itemprop="headline">' . $link_before . get_the_title() . '</a></h5>';
                 $output .= '<div class="button-love">' . mfn_love() . '</div>';
                 $output .= '</div>';
                 $output .= '<div class="details-wrapper">';
                 $output .= '<dl>';
                 if ($client = get_post_meta(get_the_ID(), 'mfn-post-client', true)) {
                     $output .= '<dt>' . $translate['client'] . '</dt>';
                     $output .= '<dd>' . $client . '</dd>';
                 }
                 $output .= '<dt>' . $translate['date'] . '</dt>';
                 $output .= '<dd>' . get_the_date() . '</dd>';
                 if ($link = get_post_meta(get_the_ID(), 'mfn-post-link', true)) {
                     $output .= '<dt>' . $translate['website'] . '</dt>';
                     $output .= '<dd><a target="_blank" href="' . $link . '"><i class="icon-forward"></i>' . $translate['view'] . '</a></dd>';
                 }
                 $output .= '</dl>';
                 $output .= '</div>';
                 $output .= '<div class="desc-wrapper">';
                 $output .= get_the_excerpt();
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
             $output .= '</li>';
         }
     }
     return $output;
 }
コード例 #4
0
 function mfn_content_post($query = false, $layout = false)
 {
     global $wp_query;
     $output = '';
     $translate['published'] = mfn_opts_get('translate') ? mfn_opts_get('translate-published', 'Published by') : __('Published by', 'betheme');
     $translate['at'] = mfn_opts_get('translate') ? mfn_opts_get('translate-at', 'at') : __('at', 'betheme');
     $translate['categories'] = mfn_opts_get('translate') ? mfn_opts_get('translate-categories', 'Categories') : __('Categories', 'betheme');
     $translate['like'] = mfn_opts_get('translate') ? mfn_opts_get('translate-like', 'Do you like it?') : __('Do you like it?', 'betheme');
     $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore', 'Read more') : __('Read more', 'betheme');
     if (!$query) {
         $query = $wp_query;
     }
     if ($query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             $post_class = array('post-item', 'isotope-item', 'clearfix');
             if (!mfn_post_thumbnail(get_the_ID())) {
                 $post_class[] = 'no-img';
             }
             if (post_password_required()) {
                 $post_class[] = 'no-img';
             }
             $post_class[] = 'author-' . get_the_author_meta('user_login');
             $post_class = implode(' ', get_post_class($post_class));
             $output .= '<div class="' . $post_class . '">';
             $output .= '<div class="date_label">' . get_the_date() . '</div>';
             // style: timeline
             // photo --------------------------------------------------------------------------
             if (!post_password_required()) {
                 $output .= '<div class="image_frame post-photo-wrapper scale-with-grid">';
                 $output .= '<div class="image_wrapper">';
                 $output .= mfn_post_thumbnail(get_the_ID());
                 $output .= '</div>';
                 $output .= '</div>';
             }
             // desc ---------------------------------------------------------------------------
             $output .= '<div class="post-desc-wrapper">';
             $output .= '<div class="post-desc">';
             // meta -------------------------------------
             if (mfn_opts_get('blog-meta')) {
                 $output .= '<div class="post-meta clearfix">';
                 $output .= '<div class="author-date">';
                 $output .= '<span class="author"><span>' . $translate['published'] . ' </span><i class="icon-user"></i> <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author_meta('display_name') . '</a></span> ';
                 $output .= '<span class="date"><span>' . $translate['at'] . ' </span><i class="icon-clock"></i> ' . get_the_date() . '</span>';
                 $output .= '</div>';
                 $output .= '<div class="category">';
                 $output .= '<span class="cat-btn">' . $translate['categories'] . ' <i class="icon-down-dir"></i></span>';
                 $output .= '<div class="cat-wrapper">' . get_the_category_list() . '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
             // title -------------------------------------
             $output .= '<div class="post-title">';
             if (get_post_format() == 'quote') {
                 // quote ----------------------------
                 $output .= '<blockquote><a href="' . get_permalink() . '">' . get_the_title() . '</a></blockquote>';
             } elseif (get_post_format() == 'link') {
                 // link ----------------------------
                 $output .= '<i class="icon-link"></i>';
                 $output .= '<div class="link-wrapper">';
                 $output .= '<h4>' . get_the_title() . '</h4>';
                 $link = get_post_meta(get_the_ID(), 'mfn-post-link', true);
                 $output .= '<a target="_blank" href="' . $link . '">' . $link . '</a>';
                 $output .= '</div>';
             } else {
                 // default ----------------------------
                 $output .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
             }
             $output .= '</div>';
             // content -------------------------------------
             $output .= '<div class="post-excerpt">' . get_the_excerpt() . '</div>';
             // footer -------------------------------------
             $output .= '<div class="post-footer">';
             $output .= '<div class="button-love"><span class="love-text">' . $translate['like'] . '</span>' . mfn_love() . '</div>';
             $output .= '<div class="post-links">';
             if (comments_open()) {
                 $output .= '<i class="icon-comment-empty-fa"></i> <a href="' . get_comments_link() . '" class="post-comments">' . get_comments_number() . '</a>';
             }
             $output .= '<i class="icon-doc-text"></i> <a href="' . get_permalink() . '" class="post-more">' . $translate['readmore'] . '</a>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
         }
     }
     return $output;
 }
コード例 #5
0
 function sc_portfolio_slider($attr, $content = null)
 {
     extract(shortcode_atts(array('count' => '5', 'category' => '', 'category_multi' => '', 'orderby' => 'date', 'order' => 'DESC', 'arrows' => ''), $attr));
     $class = '';
     if ($arrows) {
         $class .= ' arrows arrows_' . $arrows;
     }
     $args = array('post_type' => 'portfolio', 'posts_per_page' => intval($count), 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1);
     // categories
     if ($category_multi) {
         $args['portfolio-types'] = trim($category_multi);
     } elseif ($category) {
         $args['portfolio-types'] = $category;
     }
     $query = new WP_Query();
     $query->query($args);
     if ($query->have_posts()) {
         $output = '<div class="portfolio_slider ' . $class . '">';
         $output .= '<a class="slider_nav slider_prev themebg" href="#"><i class="icon-left-open-big"></i></a>';
         $output .= '<a class="slider_nav slider_next themebg" href="#"><i class="icon-right-open-big"></i></a>';
         $output .= '<ul class="portfolio_slider_ul">';
         while ($query->have_posts()) {
             $query->the_post();
             $output .= '<li>';
             $output .= '<div class="image_frame scale-with-grid">';
             $output .= '<div class="image_wrapper">';
             $output .= mfn_post_thumbnail(get_the_ID(), 'portfolio');
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</li>';
         }
         $output .= '</ul>';
         $output .= '</div>' . "\n";
     }
     wp_reset_query();
     return $output;
 }
コード例 #6
0
ファイル: content-single.php プロジェクト: chowy1026/jenny
         $query_related_posts->the_post();
         $classes_rel = '';
         if (!mfn_post_thumbnail(get_the_ID())) {
             $classes_rel .= 'no-img';
         }
         echo '<div class="column one-third post-related ' . implode(' ', get_post_class($classes_rel)) . '">';
         if (get_post_format() == 'quote') {
             echo '<blockquote>';
             echo '<a href="' . get_permalink() . '">';
             the_title();
             echo '</a>';
             echo '</blockquote>';
         } else {
             echo '<div class="image_frame scale-with-grid">';
             echo '<div class="image_wrapper">';
             echo mfn_post_thumbnail(get_the_ID());
             echo '</div>';
             echo '</div>';
         }
         echo '<div class="date_label">' . get_the_date() . '</div>';
         echo '<div class="desc">';
         if (get_post_format() != 'quote') {
             echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
         }
         echo '<hr class="hr_color" />';
         echo '<a href="' . get_permalink() . '" class="button button_left button_js"><span class="button_icon"><i class="icon-layout"></i></span><span class="button_label">' . $translate['readmore'] . '</span></a>';
         echo '</div>';
         echo '</div>';
     }
     echo '</div>';
 }
コード例 #7
0
ファイル: content-portfolio.php プロジェクト: chowy1026/jenny
 function mfn_content_portfolio($query = false, $style = false)
 {
     global $wp_query;
     $output = '';
     $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore', 'Read more') : __('Read more', 'betheme');
     if (!$query) {
         $query = $wp_query;
     }
     if (!$style) {
         if ($_GET && key_exists('mfn-p', $_GET)) {
             $style = $_GET['mfn-p'];
             // demo
         } else {
             $style = mfn_opts_get('portfolio-layout', 'grid');
         }
     }
     if ($query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             $item_class = array();
             $categories = '';
             $terms = get_the_terms(get_the_ID(), 'portfolio-types');
             if (is_array($terms)) {
                 foreach ($terms as $term) {
                     $item_class[] = 'category-' . $term->slug;
                     $categories .= '<a href="' . site_url() . '/portfolio-types/' . $term->slug . '">' . $term->name . '</a>, ';
                 }
                 $categories = substr($categories, 0, -2);
             }
             $item_class[] = get_post_meta(get_the_ID(), 'mfn-post-size', true);
             $item_class = implode(' ', $item_class);
             // full width sections for list style
             if ($item_bg = get_post_meta(get_the_ID(), 'mfn-post-bg', true)) {
                 $item_bg = 'style="background-image:url(' . $item_bg . ');"';
             }
             $external = mfn_opts_get('portfolio-external');
             $ext_link = get_post_meta(get_the_ID(), 'mfn-post-link', true);
             $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
             if ($external == 'popup') {
                 // link to popup image
                 $title_link = '<a href="' . $large_image_url[0] . '" rel="prettyphoto">' . get_the_title() . '</a>';
             } elseif ($external == 'disable') {
                 // disable details
                 $title_link = get_the_title();
             } elseif ($external && $ext_link) {
                 // link to project website
                 $title_link = '<a href="' . $ext_link . '" target="_blank">' . get_the_title() . '</a>';
             } else {
                 // link to project details
                 $title_link = '<a href="' . get_permalink() . '">' . get_the_title() . '</a>';
             }
             $output .= '<li class="portfolio-item isotope-item ' . $item_class . '">';
             $output .= '<div class="portfolio-item-fw-bg" ' . $item_bg . '>';
             $output .= '<div class="portfolio-item-fw-wrapper">';
             // desc --------------------------------------------------------------------------
             $output .= '<div class="list_style_header">';
             $output .= '<h3 class="entry-title" itemprop="headline">' . $title_link . '</h3>';
             $output .= '<div class="links_wrapper">';
             $output .= '<a href="#" class="button button_js portfolio_prev_js"><span class="button_icon"><i class="icon-up-open"></i></span></a>';
             $output .= '<a href="#" class="button button_js portfolio_next_js"><span class="button_icon"><i class="icon-down-open"></i></span></a>';
             $output .= '<a href="' . get_permalink() . '" class="button button_left button_theme button_js"><span class="button_icon"><i class="icon-link"></i></span><span class="button_label">' . $translate['readmore'] . '</span></a>';
             $output .= '</div>';
             $output .= '</div>';
             // photo --------------------------------------------------------------------------
             $output .= '<div class="image_frame scale-with-grid">';
             $output .= '<div class="image_wrapper">';
             $output .= mfn_post_thumbnail(get_the_ID(), 'portfolio', $style);
             $output .= '</div>';
             $output .= '</div>';
             // desc --------------------------------------------------------------------------
             $output .= '<div class="desc">';
             $output .= '<div class="title_wrapper">';
             $output .= '<h5 class="entry-title" itemprop="headline">' . $title_link . '</h5>';
             $output .= '<div class="button-love">' . mfn_love() . '</div>';
             $output .= '</div>';
             $output .= '<div class="details-wrapper">';
             $output .= '<dl>';
             if ($client = get_post_meta(get_the_ID(), 'mfn-post-client', true)) {
                 $output .= '<dt>Client</dt>';
                 $output .= '<dd>' . $client . '</dd>';
             }
             $output .= '<dt>Date</dt>';
             $output .= '<dd>' . get_the_date() . '</dd>';
             if ($link = get_post_meta(get_the_ID(), 'mfn-post-link', true)) {
                 $output .= '<dt>Website</dt>';
                 $output .= '<dd><a target="_blank" href="' . $link . '"><i class="icon-forward"></i>View website</a></dd>';
             }
             $output .= '</dl>';
             $output .= '</div>';
             $output .= '<div class="desc-wrapper">';
             $output .= get_the_excerpt();
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '</li>';
         }
     }
     return $output;
 }