function portfolio_list($atts, $content = null)
    {
        global $wp_query;
        global $portfolio_project_id;
        global $qode_options_proya;
        $portfolio_qode_like = "on";
        if (isset($qode_options_proya['portfolio_qode_like'])) {
            $portfolio_qode_like = $qode_options_proya['portfolio_qode_like'];
        }
        $args = array("type" => "standard", "box_border" => "", "box_background_color" => "", "box_border_color" => "", "box_border_width" => "", "columns" => "3", "grid_size" => "", "image_size" => "", "order_by" => "date", "order" => "ASC", "number" => "-1", "filter" => "no", "filter_color" => "", "lightbox" => "yes", "category" => "", "selected_projects" => "", "show_load_more" => "yes", "title_tag" => "h5", "portfolio_separator" => "", "text_align" => "");
        extract(shortcode_atts($args, $atts));
        $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
        //get correct heading value. If provided heading isn't valid get the default one
        $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
        $html = "";
        $_type_class = '';
        $_portfolio_space_class = '';
        $_portfolio_masonry_with_space_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
            $_portfolio_space_class = "portfolio_with_space";
        } elseif ($type == "standard" || $type == "masonry_with_space") {
            $_type_class = " standard";
            $_portfolio_space_class = "portfolio_with_space";
            if ($type == "masonry_with_space") {
                $_portfolio_masonry_with_space_class = ' masonry_with_space';
            }
        } elseif ($type == "standard_no_space") {
            $_type_class = " standard_no_space";
            $_portfolio_space_class = "portfolio_no_space";
        } elseif ($type == "hover_text_no_space") {
            $_type_class = " hover_text no_space";
            $_portfolio_space_class = "portfolio_no_space";
        }
        $_portfolio_masonry_with_space_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
            $_portfolio_space_class = "portfolio_with_space portfolio_with_hover_text";
        } elseif ($type == "standard" || $type == "masonry_with_space") {
            $_type_class = " standard";
            $_portfolio_space_class = "portfolio_with_space portfolio_standard";
            if ($type == "masonry_with_space") {
                $_portfolio_masonry_with_space_class = ' masonry_with_space';
            }
        } elseif ($type == "standard_no_space") {
            $_type_class = " standard_no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_standard";
        } elseif ($type == "hover_text_no_space") {
            $_type_class = " hover_text no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_with_hover_text";
        }
        $portfolio_box_style = "";
        $portfolio_description_class = "";
        if ($box_border == "yes" || $box_background_color != "") {
            $portfolio_box_style .= "style=";
            if ($box_border == "yes") {
                $portfolio_box_style .= "border-style:solid;";
                if ($box_border_color != "") {
                    $portfolio_box_style .= "border-color:" . $box_border_color . ";";
                }
                if ($box_border_width != "") {
                    $portfolio_box_style .= "border-width:" . $box_border_width . "px;";
                }
            }
            if ($box_background_color != "") {
                $portfolio_box_style .= "background-color:" . $box_background_color . ";";
            }
            $portfolio_box_style .= "'";
        }
        if ($text_align !== '') {
            $portfolio_description_class .= 'text_align_' . $text_align;
        }
        $portfolio_separator_aignment = "center";
        if ($text_align != "") {
            $portfolio_separator_aignment = $text_align;
        }
        $filter_style = "";
        if ($filter_color != "") {
            $filter_style = " style='";
            $filter_style .= "color:{$filter_color}";
            $filter_style .= "'";
        }
        if ($type != 'masonry') {
            $html .= "<div class='projects_holder_outer v{$columns} {$_portfolio_space_class} {$_portfolio_masonry_with_space_class}'>";
            if ($filter == "yes") {
                if ($type == 'masonry_with_space') {
                    $html .= "<div class='filter_outer'>";
                    $html .= "<div class='filter_holder'>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class='filter' data-filter='*'><span>" . __('All', 'qode') . "</span></li>";
                    if ($category == "") {
                        $args = array('parent' => 0);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    } else {
                        $top_category = get_term_by('slug', $category, 'portfolio_category');
                        $term_id = '';
                        if (isset($top_category->term_id)) {
                            $term_id = $top_category->term_id;
                        }
                        $args = array('parent' => $term_id);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    }
                    foreach ($portfolio_categories as $portfolio_category) {
                        $html .= "<li class='filter' data-filter='.portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                        $args = array('child_of' => $portfolio_category->term_id);
                        $html .= '</li>';
                    }
                    $html .= "</ul></div>";
                    $html .= "</div>";
                } else {
                    $html .= "<div class='filter_outer'>";
                    $html .= "<div class='filter_holder'>\n                            <ul>\n                            <li class='filter' data-filter='all'><span" . $filter_style . ">" . __('All', 'qode') . "</span></li>";
                    if ($category == "") {
                        $args = array('parent' => 0);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    } else {
                        $top_category = get_term_by('slug', $category, 'portfolio_category');
                        $term_id = '';
                        if (isset($top_category->term_id)) {
                            $term_id = $top_category->term_id;
                        }
                        $args = array('parent' => $term_id);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    }
                    foreach ($portfolio_categories as $portfolio_category) {
                        $html .= "<li class='filter' data-filter='portfolio_category_{$portfolio_category->term_id}'><span" . $filter_style . ">{$portfolio_category->name}</span>";
                        $args = array('child_of' => $portfolio_category->term_id);
                        $html .= '</li>';
                    }
                    $html .= "</ul></div>";
                    $html .= "</div>";
                }
            }
            $thumb_size_class = "";
            //get proper image size
            switch ($image_size) {
                case 'landscape':
                    $thumb_size_class = 'portfolio_landscape_image';
                    break;
                case 'portrait':
                    $thumb_size_class = 'portfolio_portrait_image';
                    break;
                case 'square':
                    $thumb_size_class = 'portfolio_square_image';
                    break;
                default:
                    $thumb_size_class = 'portfolio_full_image';
                    break;
            }
            $html .= "<div class='projects_holder clearfix v{$columns}{$_type_class} {$thumb_size_class}'>\n";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $html .= "<article class='mix ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $title = get_the_title();
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    //get proper image size
                    switch ($image_size) {
                        case 'landscape':
                            $thumb_size = 'portfolio-landscape';
                            break;
                        case 'portrait':
                            $thumb_size = 'portfolio-portrait';
                            break;
                        case 'square':
                            $thumb_size = 'portfolio-square';
                            break;
                        default:
                            $thumb_size = 'full';
                            break;
                    }
                    if ($type == "masonry_with_space") {
                        $thumb_size = 'portfolio_masonry_with_space';
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $html .= "'>";
                    $html .= "<div class='image_holder'>";
                    $html .= "<a class='portfolio_link_for_touch' href='" . $portfolio_link . "' target='" . $target . "'>";
                    $html .= "<span class='image'>";
                    $html .= get_the_post_thumbnail(get_the_ID(), $thumb_size);
                    $html .= "</span>";
                    $html .= "</a>";
                    if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                        $html .= "<span class='text_holder'>";
                        $html .= "<span class='text_outer'>";
                        $html .= "<span class='text_inner'>";
                        $html .= "<span class='feature_holder'>";
                        $html .= '<span class="feature_holder_icons">';
                        if ($lightbox == "yes") {
                            $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                        }
                        $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</a>";
                        if ($portfolio_qode_like == "on") {
                            $html .= "<span class='portfolio_like qbutton small white'>";
                            $portfolio_project_id = get_the_ID();
                            if (function_exists('qode_like_portfolio_list')) {
                                $html .= qode_like_portfolio_list();
                            }
                            $html .= "</span>";
                        }
                        $html .= "</span>";
                        $html .= "</span></span></span></span>";
                    } else {
                        if ($type == "hover_text" || $type == "hover_text_no_space") {
                            $html .= "<span class='text_holder'>";
                            $html .= "<span class='text_outer'>";
                            $html .= "<span class='text_inner'>";
                            $html .= '<div class="hover_feature_holder_title"><div class="hover_feature_holder_title_inner">';
                            $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                            if ($portfolio_separator == "yes") {
                                $html .= '<div class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                            }
                            $html .= '<span class="project_category">';
                            $k = 1;
                            foreach ($terms as $term) {
                                $html .= "{$term->name}";
                                if (count($terms) != $k) {
                                    $html .= ', ';
                                }
                                $k++;
                            }
                            $html .= '</span></div></div>';
                            $html .= "<span class='feature_holder'>";
                            $html .= '<span class="feature_holder_icons">';
                            if ($lightbox == "yes") {
                                $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                            }
                            $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</a>";
                            if ($portfolio_qode_like == "on") {
                                $html .= "<span class='portfolio_like qbutton small white'>";
                                $portfolio_project_id = get_the_ID();
                                if (function_exists('qode_like_portfolio_list')) {
                                    $html .= qode_like_portfolio_list();
                                }
                                $html .= "</span>";
                            }
                            $html .= "</span>";
                            $html .= "</span></span></span></span>";
                        }
                    }
                    $html .= "</div>";
                    if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                        $html .= "<div class='portfolio_description " . $portfolio_description_class . "'" . $portfolio_box_style . ">";
                        $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                        if ($portfolio_separator == "yes") {
                            $html .= '<div class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                        }
                        $html .= '<span class="project_category">';
                        $k = 1;
                        foreach ($terms as $term) {
                            $html .= "{$term->name}";
                            if (count($terms) != $k) {
                                $html .= ', ';
                            }
                            $k++;
                        }
                        $html .= '</span>';
                        $html .= '</div>';
                    }
                    $html .= "</article>\n";
                }
                $i = 1;
                while ($i <= $columns) {
                    $i++;
                    if ($columns != 1) {
                        $html .= "<div class='filler'></div>\n";
                    }
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
            <?php 
            }
            $html .= "</div>";
            if (get_next_posts_link()) {
                if ($show_load_more == "yes" || $show_load_more == "") {
                    $html .= '<div class="portfolio_paging"><span rel="' . $wp_query->max_num_pages . '" class="load_more">' . get_next_posts_link(__('Show more', 'qode')) . '</span></div>';
                    $html .= '<div class="portfolio_paging_loading"><a href="javascript: void(0)" class="qbutton">' . __('Loading...', 'qode') . '</a></div>';
                }
            }
            $html .= "</div>";
            wp_reset_query();
        } else {
            if ($filter == "yes") {
                $html .= "<div class='filter_outer'>";
                $html .= "<div class='filter_holder'>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class='filter' data-filter='*'><span>" . __('All', 'qode') . "</span></li>";
                if ($category == "") {
                    $args = array('parent' => 0);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                } else {
                    $top_category = get_term_by('slug', $category, 'portfolio_category');
                    $term_id = '';
                    if (isset($top_category->term_id)) {
                        $term_id = $top_category->term_id;
                    }
                    $args = array('parent' => $term_id);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                }
                foreach ($portfolio_categories as $portfolio_category) {
                    $html .= "<li class='filter' data-filter='.portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                    $args = array('child_of' => $portfolio_category->term_id);
                    $html .= '</li>';
                }
                $html .= "</ul></div>";
                $html .= "</div>";
            }
            $grid_number_of_columns = "gs5";
            if ($grid_size == 4) {
                $grid_number_of_columns = "gs4";
            }
            $html .= "<div class='projects_masonry_holder " . $grid_number_of_columns . "'>";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $masonry_size = "default";
                    $masonry_size = get_post_meta(get_the_ID(), "qode_portfolio_type_masonry_style", true);
                    $image_size = "";
                    if ($masonry_size == "large_width") {
                        $image_size = "portfolio_masonry_wide";
                    } elseif ($masonry_size == "large_height") {
                        $image_size = "portfolio_masonry_tall";
                    } elseif ($masonry_size == "large_width_height") {
                        $image_size = "portfolio_masonry_large";
                    } else {
                        $image_size = "portfolio_masonry_regular";
                    }
                    if ($type == "masonry_with_space") {
                        $image_size = "portfolio_masonry_with_space";
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    $title = get_the_title();
                    $html .= "<article class='portfolio_masonry_item ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $html .= " " . $masonry_size;
                    $html .= "'>";
                    $html .= "<div class='image_holder'>";
                    $html .= "<a class='portfolio_link_for_touch' href='" . $portfolio_link . "' target='" . $target . "'>";
                    $html .= "<span class='image'>";
                    $html .= get_the_post_thumbnail(get_the_ID(), $image_size);
                    $html .= "</span>";
                    $html .= "</a>";
                    $html .= "<span class='text_holder'>";
                    $html .= "<span class='text_outer'>";
                    $html .= "<span class='text_inner'>";
                    $html .= '<div class="hover_feature_holder_title"><div class="hover_feature_holder_title_inner">';
                    $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                    if ($portfolio_separator == "yes") {
                        $html .= '<div class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                    }
                    $html .= '<span class="project_category">';
                    $k = 1;
                    foreach ($terms as $term) {
                        $html .= "{$term->name}";
                        if (count($terms) != $k) {
                            $html .= ', ';
                        }
                        $k++;
                    }
                    $html .= '</span></div></div>';
                    $html .= "<span class='feature_holder'>";
                    $html .= '<span class="feature_holder_icons">';
                    if ($lightbox == "yes") {
                        $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                    }
                    $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</i></a>";
                    if ($portfolio_qode_like == "on") {
                        $html .= "<span class='portfolio_like qbutton small white'>";
                        $portfolio_project_id = get_the_ID();
                        if (function_exists('qode_like_portfolio_list')) {
                            $html .= qode_like_portfolio_list();
                        }
                        $html .= "</span>";
                    }
                    $html .= "</span>";
                    $html .= "</span></span></span></span>";
                    $html .= "</div>";
                    $html .= "</article>";
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
            <?php 
            }
            wp_reset_query();
            $html .= "</div>";
        }
        return $html;
    }
Beispiel #2
0
    function portfolio_list($atts, $content = null)
    {
        global $wp_query;
        global $portfolio_project_id;
        global $qode_options_proya;
        $portfolio_qode_like = "on";
        if (isset($qode_options_proya['portfolio_qode_like'])) {
            $portfolio_qode_like = $qode_options_proya['portfolio_qode_like'];
        }
        $args = array("type" => "standard", "spacing" => "", "hover_type_standard" => "default", "hover_type_text_on_hover_image" => "default", "hover_type_text_before_hover" => "default", "hover_type_masonry" => "default", "box_border" => "", "box_background_color" => "", "box_border_color" => "", "box_border_width" => "", "columns" => "3", "portfolio_loading_type" => "", "portfolio_loading_type_masonry" => "", "grid_size" => "", "image_size" => "", "overlay_background_color" => "", "order_by" => "date", "order" => "ASC", "number" => "-1", "filter" => "no", "filter_color" => "", "lightbox" => "yes", "view_button" => "yes", "category" => "", "selected_projects" => "", "show_load_more" => "yes", "show_title" => "", "title_tag" => "h5", "title_color" => "", "title_font_size" => "", "show_categories" => "", "category_color" => "", "portfolio_separator" => "", "separator_color" => "", "text_align" => "");
        extract(shortcode_atts($args, $atts));
        $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
        //get correct heading value. If provided heading isn't valid get the default one
        $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
        $html = "";
        $_type_class = '';
        $_portfolio_space_class = '';
        $_portfolio_masonry_with_space_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
            $_portfolio_space_class = "portfolio_with_space";
        } elseif ($type == "standard" || $type == "masonry_with_space") {
            $_type_class = " standard";
            $_portfolio_space_class = "portfolio_with_space";
            if ($type == "masonry_with_space") {
                $_portfolio_masonry_with_space_class = ' masonry_with_space';
            }
        } elseif ($type == "standard_no_space") {
            $_type_class = " standard_no_space";
            $_portfolio_space_class = "portfolio_no_space";
        } elseif ($type == "hover_text_no_space") {
            $_type_class = " hover_text no_space";
            $_portfolio_space_class = "portfolio_no_space";
        }
        $_portfolio_masonry_with_space_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
            $_portfolio_space_class = "portfolio_with_space portfolio_with_hover_text";
        } elseif ($type == "standard" || $type == "masonry_with_space" || $type == "masonry_with_space_without_description") {
            $_type_class = " standard";
            $_portfolio_space_class = "portfolio_with_space portfolio_standard";
            if ($type == "masonry_with_space" || $type == "masonry_with_space_without_description") {
                $_portfolio_masonry_with_space_class = ' masonry_with_space';
                if ($type == "masonry_with_space_without_description") {
                    $_portfolio_masonry_with_space_class .= ' masonry_with_space_only_image';
                }
            }
        } elseif ($type == "standard_no_space") {
            $_type_class = " standard_no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_standard";
        } elseif ($type == "hover_text_no_space") {
            $_type_class = " hover_text no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_with_hover_text";
        }
        $article_style = "";
        if (($type == "masonry_with_space" || $type == 'masonry_with_space_without_description') && $spacing !== '') {
            $article_style .= "padding: 0 " . intval($spacing) / 2 . "px;";
            $article_style .= "margin-bottom: " . $spacing . "px !important;";
        }
        $article_style = "style='" . $article_style . "'";
        $portfolio_box_style = "";
        $portfolio_description_class = "";
        if ($box_border == "yes" || $box_background_color != "") {
            $portfolio_box_style .= "style=";
            if ($box_border == "yes") {
                $portfolio_box_style .= "border-style:solid;";
                if ($box_border_color != "") {
                    $portfolio_box_style .= "border-color:" . $box_border_color . ";";
                }
                if ($box_border_width != "") {
                    $portfolio_box_style .= "border-width:" . $box_border_width . "px;";
                }
            }
            if ($box_background_color != "") {
                $portfolio_box_style .= "background-color:" . $box_background_color . ";";
            }
            $portfolio_box_style .= "'";
        }
        if ($text_align !== '') {
            $portfolio_description_class .= 'text_align_' . $text_align;
        }
        $portfolio_separator_aignment = "center";
        if ($text_align != "") {
            $portfolio_separator_aignment = $text_align;
        }
        // adding portfolio loading
        $portfolio_loading_class = '';
        if ($portfolio_loading_type !== '' && !in_array($type, array('masonry_with_space', 'masonry', 'masonry_with_space_without_description'))) {
            $portfolio_loading_class = $portfolio_loading_type;
        } elseif ($portfolio_loading_type_masonry !== '') {
            $portfolio_loading_class = $portfolio_loading_type_masonry;
        }
        $filter_style = "";
        if ($filter_color != "") {
            $filter_style = " style='";
            $filter_style .= "color:{$filter_color}";
            $filter_style .= "'";
        }
        // adding hover type
        $hover_type = "";
        if ($type == 'standard' || $type == 'standard_no_space' || $type == 'masonry_with_space') {
            $hover_type = $hover_type_standard;
        }
        if ($type == 'hover_text' || $type == 'hover_text_no_space' || $type == 'masonry_with_space_without_description') {
            $hover_type = $hover_type_text_on_hover_image;
        }
        if ($type == 'masonry') {
            $hover_type = $hover_type_masonry;
        }
        $overlay_styles = array();
        if ($hover_type !== 'default' && $overlay_background_color !== '') {
            $overlay_styles[] = 'background-color: ' . $overlay_background_color;
        }
        $title_styles = array();
        if ($title_color !== '') {
            $title_styles[] = 'color: ' . $title_color;
        }
        if ($title_font_size !== '') {
            $title_styles[] = 'font-size: ' . $title_font_size . 'px';
        }
        $category_styles = array();
        if ($category_color !== '') {
            $category_styles[] = 'color: ' . $category_color;
        }
        $separator_styles = array();
        if ($separator_color !== '') {
            $separator_styles[] = 'background-color: ' . $separator_color;
        }
        if ($columns == "") {
            $columns = '3';
        }
        $show_description_box = $show_title == 'no' && $show_categories == 'no' ? false : true;
        if ($type != 'masonry') {
            $html .= "<div class='projects_holder_outer v{$columns} {$_portfolio_space_class} {$_portfolio_masonry_with_space_class}'>";
            if ($filter == "yes") {
                if ($type == 'masonry_with_space' || $type == 'masonry_with_space_without_description') {
                    $html .= "<div class='filter_outer'>";
                    $html .= "<div class='filter_holder'>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class='filter' data-filter='*'><span>" . __('All', 'qode') . "</span></li>";
                    if ($category == "") {
                        $args = array('parent' => 0);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    } else {
                        $top_category = get_term_by('slug', $category, 'portfolio_category');
                        $term_id = '';
                        if (isset($top_category->term_id)) {
                            $term_id = $top_category->term_id;
                        }
                        $args = array('parent' => $term_id);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    }
                    foreach ($portfolio_categories as $portfolio_category) {
                        $html .= "<li class='filter' data-filter='.portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                        $args = array('child_of' => $portfolio_category->term_id);
                        $html .= '</li>';
                    }
                    $html .= "</ul></div>";
                    $html .= "</div>";
                } else {
                    $html .= "<div class='filter_outer'>";
                    $html .= "<div class='filter_holder'>\n                            <ul>\n                            <li class='filter' data-filter='all'><span" . $filter_style . ">" . __('All', 'qode') . "</span></li>";
                    if ($category == "") {
                        $args = array('parent' => 0);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    } else {
                        $top_category = get_term_by('slug', $category, 'portfolio_category');
                        $term_id = '';
                        if (isset($top_category->term_id)) {
                            $term_id = $top_category->term_id;
                        }
                        $args = array('parent' => $term_id);
                        $portfolio_categories = get_terms('portfolio_category', $args);
                    }
                    foreach ($portfolio_categories as $portfolio_category) {
                        $html .= "<li class='filter' data-filter='portfolio_category_{$portfolio_category->term_id}'><span" . $filter_style . ">{$portfolio_category->name}</span>";
                        $args = array('child_of' => $portfolio_category->term_id);
                        $html .= '</li>';
                    }
                    $html .= "</ul></div>";
                    $html .= "</div>";
                }
            }
            $thumb_size_class = "";
            //get proper image size
            switch ($image_size) {
                case 'landscape':
                    $thumb_size_class = 'portfolio_landscape_image';
                    break;
                case 'portrait':
                    $thumb_size_class = 'portfolio_portrait_image';
                    break;
                case 'square':
                    $thumb_size_class = 'portfolio_square_image';
                    break;
                default:
                    $thumb_size_class = 'portfolio_full_image';
                    break;
            }
            $html .= "<div class='projects_holder portfolio_main_holder clearfix v{$columns}{$_type_class} {$thumb_size_class} {$portfolio_loading_class}'>\n";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $html .= "<article class='mix ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $title = get_the_title();
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    //get proper image size
                    switch ($image_size) {
                        case 'landscape':
                            $thumb_size = 'portfolio-landscape';
                            break;
                        case 'portrait':
                            $thumb_size = 'portfolio-portrait';
                            break;
                        case 'square':
                            $thumb_size = 'portfolio-square';
                            break;
                        default:
                            $thumb_size = 'full';
                            break;
                    }
                    if ($type == "masonry_with_space" || $type == "masonry_with_space_without_description") {
                        $thumb_size = 'portfolio_masonry_with_space';
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $html .= "' ";
                    $html .= $article_style;
                    $html .= ">";
                    if ($hover_type == 'default') {
                        $html .= "<div class='image_holder'>";
                        $html .= "<a class='portfolio_link_for_touch' href='" . $portfolio_link . "' target='" . $target . "'>";
                        $html .= "<span class='image'>";
                        $html .= get_the_post_thumbnail(get_the_ID(), $thumb_size);
                        $html .= "</span>";
                        $html .= "</a>";
                        if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                            $html .= "<span class='text_holder'>";
                            $html .= "<span class='text_outer'>";
                            $html .= "<span class='text_inner'>";
                            $html .= "<span class='feature_holder'>";
                            if ($lightbox == "yes" || $portfolio_qode_like == "on" || $view_button !== "no") {
                                $html .= '<span class="feature_holder_icons">';
                                if ($lightbox == "yes") {
                                    $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                                }
                                if ($view_button !== "no") {
                                    $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</a>";
                                }
                                if ($portfolio_qode_like == "on") {
                                    $html .= "<span class='portfolio_like qbutton small white'>";
                                    $portfolio_project_id = get_the_ID();
                                    if (function_exists('qode_like_portfolio_list')) {
                                        $html .= qode_like_portfolio_list();
                                    }
                                    $html .= "</span>";
                                }
                                $html .= "</span>";
                            }
                            $html .= "</span></span></span></span>";
                        } else {
                            if ($type == "hover_text" || $type == "hover_text_no_space" || ($type = 'masonry_with_space_without_description')) {
                                $html .= "<span class='text_holder'>";
                                $html .= "<span class='text_outer'>";
                                $html .= "<span class='text_inner'>";
                                $html .= '<div class="hover_feature_holder_title"><div class="hover_feature_holder_title_inner">';
                                if ($show_title !== 'no') {
                                    $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . ' target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                                }
                                if ($portfolio_separator == "yes") {
                                    $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                                }
                                if ($show_categories !== 'no') {
                                    $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>';
                                    $k = 1;
                                    foreach ($terms as $term) {
                                        $html .= "{$term->name}";
                                        if (count($terms) != $k) {
                                            $html .= ', ';
                                        }
                                        $k++;
                                    }
                                    $html .= '</span>';
                                }
                                $html .= '</div></div>';
                                $html .= "<span class='feature_holder'>";
                                if ($lightbox == "yes" || $portfolio_qode_like == "on" || $view_button !== "no") {
                                    $html .= '<span class="feature_holder_icons">';
                                    if ($lightbox == "yes") {
                                        $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                                    }
                                    if ($view_button !== "no") {
                                        $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</a>";
                                    }
                                    if ($portfolio_qode_like == "on") {
                                        $html .= "<span class='portfolio_like qbutton small white'>";
                                        $portfolio_project_id = get_the_ID();
                                        if (function_exists('qode_like_portfolio_list')) {
                                            $html .= qode_like_portfolio_list();
                                        }
                                        $html .= "</span>";
                                    }
                                    $html .= "</span>";
                                }
                                $html .= "</span></span></span></span>";
                            }
                        }
                        $html .= "</div>";
                        if (($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") && $show_description_box) {
                            $html .= "<div class='portfolio_description " . $portfolio_description_class . "'" . $portfolio_box_style . ">";
                            if ($show_title !== 'no') {
                                $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . ' target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                            }
                            if ($portfolio_separator == "yes") {
                                $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                            }
                            if ($show_categories !== 'no') {
                                $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>';
                                $k = 1;
                                foreach ($terms as $term) {
                                    $html .= "{$term->name}";
                                    if (count($terms) != $k) {
                                        $html .= ', ';
                                    }
                                    $k++;
                                }
                                $html .= '</span>';
                            }
                            $html .= '</div>';
                        }
                    } else {
                        $category_html = "";
                        $k = 1;
                        foreach ($terms as $term) {
                            $category_html .= "{$term->name}";
                            if (count($terms) != $k) {
                                $category_html .= ' / ';
                            }
                            $k++;
                        }
                        $show_icons = "yes";
                        // disable icons on this hover type
                        if ($hover_type == 'cursor_change_hover' || $hover_type == 'thin_plus_only' || $hover_type == 'split_up') {
                            $show_icons = "no";
                        }
                        $disable_link = 'no';
                        // disable link if icons are shown for these hover type
                        if (($hover_type == 'subtle_vertical_hover' || $hover_type == 'image_subtle_rotate_zoom_hover' || $hover_type == 'image_text_zoom_hover') && $show_icons == 'yes') {
                            $disable_link = "yes";
                        }
                        $html .= '<div class="item_holder ' . $hover_type . '">';
                        switch ($hover_type) {
                            case 'subtle_vertical_hover':
                            case 'image_subtle_rotate_zoom_hover':
                            case 'image_text_zoom_hover':
                            case 'thin_plus_only':
                            case 'cursor_change_hover':
                                $html .= '<div class="text_holder">';
                                $html .= '<div class="text_holder_outer">';
                                $html .= '<div class="text_holder_inner">';
                                if ($hover_type == 'thin_plus_only') {
                                    $html .= '<span class="thin_plus_only_icon">+</span>';
                                } elseif (in_array($type, array('hover_text', 'hover_text_no_space', 'masonry_with_space_without_description'))) {
                                    if ($show_title !== 'no') {
                                        $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . '>' . get_the_title() . '</a></' . $title_tag . '>';
                                    }
                                    if ($portfolio_separator == "yes") {
                                        $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                                    }
                                    if ($show_categories !== 'no') {
                                        $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>' . $category_html . '</span>';
                                    }
                                }
                                if ($show_icons == 'yes') {
                                    $html .= '<div class="icons_holder">';
                                    if ($lightbox == "yes") {
                                        $html .= '<a class="portfolio_lightbox" title="' . $title . '" href="' . $large_image . '" data-rel="prettyPhoto[' . $slug_list_ . ']" rel="prettyPhoto[' . $slug_list_ . ']"></a>';
                                    }
                                    if ($portfolio_qode_like == "on" && function_exists('qode_like_portfolio_list')) {
                                        $html .= qode_like_portfolio_list('icon');
                                    }
                                    if ($view_button !== "no") {
                                        $html .= '<a class="preview" title="' . __('Go to Project', 'qode') . '" href="' . $portfolio_link . '" data-type="portfolio_list" target="' . $target . '" ></a>';
                                    }
                                    $html .= '</div>';
                                    // icons_holder
                                }
                                $html .= '</div>';
                                // text_holder_inner
                                $html .= '</div>';
                                // text_holder_outer
                                $html .= '</div>';
                                // text_holder
                                break;
                            case 'slow_zoom':
                            case 'split_up':
                                if (in_array($type, array('hover_text', 'hover_text_no_space', 'masonry_with_space_without_description'))) {
                                    $html .= '<div class="text_holder">';
                                    $html .= '<div class="text_holder_outer">';
                                    $html .= '<div class="text_holder_inner">';
                                    if ($show_title !== 'no') {
                                        $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . '>' . get_the_title() . '</a></' . $title_tag . '>';
                                    }
                                    if ($portfolio_separator == "yes") {
                                        $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                                    }
                                    if ($show_categories !== 'no') {
                                        $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>' . $category_html . '</span>';
                                    }
                                    $html .= '</div>';
                                    //text_holder_inner
                                    $html .= '</div>';
                                    // text_holder_outer
                                    $html .= '</div>';
                                    // text_holder
                                }
                                if ($show_icons == 'yes') {
                                    $html .= '<div class="icons_holder">';
                                    if ($lightbox == "yes") {
                                        $html .= '<a class="portfolio_lightbox" title="' . $title . '" href="' . $large_image . '" data-rel="prettyPhoto[' . $slug_list_ . ']" rel="prettyPhoto[' . $slug_list_ . ']"></a>';
                                    }
                                    if ($portfolio_qode_like == "on" && function_exists('qode_like_portfolio_list')) {
                                        $html .= qode_like_portfolio_list('icon');
                                    }
                                    if ($view_button !== "no") {
                                        $html .= '<a class="preview" title="Go to Project" href="' . $portfolio_link . '" data-type="portfolio_list" target="' . $target . '" ></a>';
                                    }
                                    $html .= '</div>';
                                    // icons_holder
                                }
                                break;
                        }
                        if ($disable_link == 'no') {
                            $html .= '<a class="portfolio_link_class" title="' . $title . '" href="' . $portfolio_link . '"></a>';
                        }
                        $html .= '<div ' . qode_get_inline_style($overlay_styles) . ' class="portfolio_shader"></div>';
                        $html .= '<div class="image_holder">';
                        $html .= '<span class="image">';
                        $html .= get_the_post_thumbnail(get_the_ID(), $thumb_size);
                        $html .= '</span>';
                        $html .= '</div>';
                        // close image_holder
                        $html .= '</div>';
                        // close item_holder
                        // portfolio description start
                        if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                            $html .= "<div class='portfolio_description " . $portfolio_description_class . "' " . $portfolio_box_style . ">";
                            if ($show_title !== 'no') {
                                $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" target="' . $target . '" ' . qode_get_inline_style($title_styles) . '>' . get_the_title() . '</a></' . $title_tag . '>';
                            }
                            if ($portfolio_separator == "yes") {
                                $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                            }
                            if ($show_categories !== 'no') {
                                $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>' . $category_html . '</span>';
                            }
                            $html .= '</div>';
                            // close portfolio_description
                        }
                    }
                    $html .= "</article>\n";
                }
                $i = 1;
                while ($i <= $columns) {
                    $i++;
                    if ($columns != 1) {
                        $html .= "<div class='filler'></div>\n";
                    }
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
            <?php 
            }
            $html .= "</div>";
            if (get_next_posts_link()) {
                if ($show_load_more == "yes" || $show_load_more == "") {
                    $html .= '<div class="portfolio_paging"><span rel="' . $wp_query->max_num_pages . '" class="load_more">' . get_next_posts_link(__('Show more', 'qode')) . '</span></div>';
                    $html .= '<div class="portfolio_paging_loading"><a href="javascript: void(0)" class="qbutton">' . __('Loading...', 'qode') . '</a></div>';
                }
            }
            $html .= "</div>";
            wp_reset_query();
        } else {
            if ($filter == "yes") {
                $html .= "<div class='filter_outer'>";
                $html .= "<div class='filter_holder'>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class='filter' data-filter='*'><span>" . __('All', 'qode') . "</span></li>";
                if ($category == "") {
                    $args = array('parent' => 0);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                } else {
                    $top_category = get_term_by('slug', $category, 'portfolio_category');
                    $term_id = '';
                    if (isset($top_category->term_id)) {
                        $term_id = $top_category->term_id;
                    }
                    $args = array('parent' => $term_id);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                }
                foreach ($portfolio_categories as $portfolio_category) {
                    $html .= "<li class='filter' data-filter='.portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                    $args = array('child_of' => $portfolio_category->term_id);
                    $html .= '</li>';
                }
                $html .= "</ul></div>";
                $html .= "</div>";
            }
            $grid_number_of_columns = "gs5";
            if ($grid_size == 4) {
                $grid_number_of_columns = "gs4";
            }
            $html .= "<div class='projects_masonry_holder portfolio_main_holder " . $grid_number_of_columns . " " . $portfolio_loading_class . "'>";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $masonry_size = "default";
                    $masonry_size = get_post_meta(get_the_ID(), "qode_portfolio_type_masonry_style", true);
                    $image_size = "";
                    if ($masonry_size == "large_width") {
                        $image_size = "portfolio_masonry_wide";
                    } elseif ($masonry_size == "large_height") {
                        $image_size = "portfolio_masonry_tall";
                    } elseif ($masonry_size == "large_width_height") {
                        $image_size = "portfolio_masonry_large";
                    } else {
                        $image_size = "portfolio_masonry_regular";
                    }
                    if ($type == "masonry_with_space") {
                        $image_size = "portfolio_masonry_with_space";
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    $title = get_the_title();
                    $html .= "<article class='portfolio_masonry_item ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $html .= " " . $masonry_size;
                    $html .= "'>";
                    if ($hover_type == 'default') {
                        $html .= "<div class='image_holder'>";
                        $html .= "<a class='portfolio_link_for_touch' href='" . $portfolio_link . "' target='" . $target . "'>";
                        $html .= "<span class='image'>";
                        $html .= get_the_post_thumbnail(get_the_ID(), $image_size);
                        $html .= "</span>";
                        $html .= "</a>";
                        $html .= "<span class='text_holder'>";
                        $html .= "<span class='text_outer'>";
                        $html .= "<span class='text_inner'>";
                        $html .= '<div class="hover_feature_holder_title"><div class="hover_feature_holder_title_inner">';
                        if ($show_title !== 'no') {
                            $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . ' target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                        }
                        if ($portfolio_separator == "yes") {
                            $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                        }
                        if ($show_categories !== 'no') {
                            $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>';
                            $k = 1;
                            foreach ($terms as $term) {
                                $html .= "{$term->name}";
                                if (count($terms) != $k) {
                                    $html .= ', ';
                                }
                                $k++;
                            }
                            $html .= '</span>';
                        }
                        $html .= '</div></div>';
                        if ($lightbox == "yes" || $portfolio_qode_like == "on" || $view_button !== "no") {
                            $html .= "<span class='feature_holder'>";
                            $html .= '<span class="feature_holder_icons">';
                            if ($lightbox == "yes") {
                                $html .= "<a class='lightbox qbutton small white' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'>" . __('zoom', 'qode') . "</a>";
                            }
                            if ($view_button !== "no") {
                                $html .= "<a class='preview qbutton small white' href='" . $portfolio_link . "' target='" . $target . "'>" . __('view', 'qode') . "</i></a>";
                            }
                            if ($portfolio_qode_like == "on") {
                                $html .= "<span class='portfolio_like qbutton small white'>";
                                $portfolio_project_id = get_the_ID();
                                if (function_exists('qode_like_portfolio_list')) {
                                    $html .= qode_like_portfolio_list();
                                }
                                $html .= "</span>";
                            }
                            $html .= "</span>";
                            $html .= "</span>";
                        }
                        $html .= "</span></span></span>";
                        $html .= "</div>";
                    } else {
                        $category_html = "";
                        $k = 1;
                        foreach ($terms as $term) {
                            $category_html .= "{$term->name}";
                            if (count($terms) != $k) {
                                $category_html .= ' / ';
                            }
                            $k++;
                        }
                        $show_icons = "yes";
                        // disable icons on this hover type
                        if ($hover_type == 'cursor_change_hover' || $hover_type == 'thin_plus_only' || $hover_type == 'split_up') {
                            $show_icons = "no";
                        }
                        $disable_link = 'no';
                        // disable link if icons are shown for these hover type
                        if (($hover_type == 'subtle_vertical_hover' || $hover_type == 'image_subtle_rotate_zoom_hover' || $hover_type == 'image_text_zoom_hover') && $show_icons == 'yes') {
                            $disable_link = "yes";
                        }
                        $html .= '<div class="item_holder ' . $hover_type . '">';
                        switch ($hover_type) {
                            case 'subtle_vertical_hover':
                            case 'image_subtle_rotate_zoom_hover':
                            case 'cursor_change_hover':
                            case 'image_text_zoom_hover':
                            case 'thin_plus_only':
                                if ($show_icons == 'yes' || $hover_type == 'thin_plus_only' || ($hover_type = 'cursor_change_hover')) {
                                    $html .= '<div class="text_holder">';
                                    $html .= '<div class="text_holder_outer">';
                                    $html .= '<div class="text_holder_inner">';
                                    if ($hover_type == 'thin_plus_only') {
                                        $html .= '<span class="thin_plus_only_icon">+</span>';
                                    } else {
                                        if ($show_title !== 'no') {
                                            $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . '>' . get_the_title() . '</a></' . $title_tag . '>';
                                        }
                                        if ($portfolio_separator == "yes") {
                                            $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                                        }
                                        if ($show_categories !== 'no') {
                                            $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>' . $category_html . '</span>';
                                        }
                                        if ($show_icons == 'yes') {
                                            $html .= '<div class="icons_holder">';
                                            if ($lightbox == "yes") {
                                                $html .= '<a class="portfolio_lightbox" title="' . $title . '" href="' . $large_image . '" data-rel="prettyPhoto[' . $slug_list_ . ']" rel="prettyPhoto[' . $slug_list_ . ']"></a>';
                                            }
                                            if ($portfolio_qode_like == "on" && function_exists('qode_like_portfolio_list')) {
                                                $html .= qode_like_portfolio_list('icon');
                                            }
                                            if ($view_button !== "no") {
                                                $html .= '<a class="preview" title="Go to Project" href="' . $portfolio_link . '" data-type="portfolio_list" target="' . $target . '" ></a>';
                                            }
                                            $html .= '</div>';
                                            // icons_holder
                                        }
                                    }
                                    $html .= '</div>';
                                    // text_holder_inner
                                    $html .= '</div>';
                                    // text_holder_outer
                                    $html .= '</div>';
                                    // text_holder
                                }
                                break;
                            case 'slow_zoom':
                            case 'split_up':
                                $html .= '<div class="text_holder">';
                                $html .= '<div class="text_holder_outer">';
                                $html .= '<div class="text_holder_inner">';
                                if ($show_title !== 'no') {
                                    $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . $portfolio_link . '" ' . qode_get_inline_style($title_styles) . '>' . get_the_title() . '</a></' . $title_tag . '>';
                                }
                                if ($portfolio_separator == "yes") {
                                    $html .= '<div ' . qode_get_inline_style($separator_styles) . ' class="portfolio_separator separator  small ' . $portfolio_separator_aignment . '"></div>';
                                }
                                if ($show_categories !== 'no') {
                                    $html .= '<span class="project_category" ' . qode_get_inline_style($category_styles) . '>' . $category_html . '</span>';
                                }
                                $html .= '</div>';
                                //text_holder_inner
                                $html .= '</div>';
                                // text_holder_outer
                                $html .= '</div>';
                                // text_holder
                                if ($show_icons == "yes") {
                                    $html .= '<div class="icons_holder">';
                                    if ($lightbox == "yes") {
                                        $html .= '<a class="portfolio_lightbox" title="' . $title . '" href="' . $large_image . '" data-rel="prettyPhoto[' . $slug_list_ . ']" rel="prettyPhoto[' . $slug_list_ . ']"></a>';
                                    }
                                    if ($portfolio_qode_like == "on" && function_exists('qode_like_portfolio_list')) {
                                        $html .= qode_like_portfolio_list('icon');
                                    }
                                    if ($view_button !== "no") {
                                        $html .= '<a class="preview" title="Preview" href="' . $portfolio_link . '" data-type="portfolio_list" target="' . $target . '" ></a>';
                                    }
                                    $html .= '</div>';
                                    // icons_holder
                                }
                                break;
                        }
                        if ($disable_link == 'no') {
                            $html .= '<a class="portfolio_link_class" title="' . $title . '" href="' . $portfolio_link . '"></a>';
                        }
                        $html .= '<div ' . qode_get_inline_style($overlay_styles) . ' class="portfolio_shader"></div>';
                        $html .= '<div class="image_holder">';
                        $html .= '<span class="image">';
                        $html .= get_the_post_thumbnail(get_the_ID(), $image_size);
                        $html .= '</span>';
                        $html .= '</div>';
                        // close text_holder
                        $html .= '</div>';
                        // close item_holder
                    }
                    $html .= "</article>";
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
            <?php 
            }
            wp_reset_query();
            $html .= "</div>";
        }
        return $html;
    }
    function portfolio_list($atts, $content = null)
    {
        global $wp_query;
        global $portfolio_project_id;
        $html = "";
        extract(shortcode_atts(array("type" => "standard", "columns" => "3", "order_by" => "menu_order", "order" => "ASC", "number" => "-1", "filter" => 'no', "lightbox" => 'yes', "category" => "", "selected_projects" => "", "show_load_more" => "yes"), $atts));
        $html .= "<div class='projects_holder_outer'>";
        if ($filter == "yes" && $category == "" && $selected_projects == "") {
            $html .= "<div class='filter_holder'><ul><li class='filter' data-filter='all'><span>" . __('All', 'qode') . "</span></li>";
            if ($category == "") {
                $args = array('parent' => 0);
                $portfolio_categories = get_terms('portfolio_category', $args);
            } else {
                $top_category = get_term_by('slug', $category, 'portfolio_category');
                $term_id = '';
                if (isset($top_category->term_id)) {
                    $term_id = $top_category->term_id;
                }
                $args = array('parent' => $term_id);
                $portfolio_categories = get_terms('portfolio_category', $args);
            }
            foreach ($portfolio_categories as $portfolio_category) {
                $html .= "<li class='filter' data-filter='{$portfolio_category->slug}'><span>{$portfolio_category->name}</span>";
                $args = array('child_of' => $portfolio_category->term_id);
                $html .= '</li>';
            }
            $html .= "</ul></div>";
        }
        $_type_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
        }
        $html .= "<div class='projects_holder clearfix v{$columns}{$_type_class}'>\n";
        if (get_query_var('paged')) {
            $paged = get_query_var('paged');
        } elseif (get_query_var('page')) {
            $paged = get_query_var('page');
        } else {
            $paged = 1;
        }
        if ($category == "") {
            $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
        } else {
            $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
        }
        $project_ids = null;
        if ($selected_projects != "") {
            $project_ids = explode(",", $selected_projects);
            $args['post__in'] = $project_ids;
        }
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                $html .= "<article class='mix ";
                foreach ($terms as $term) {
                    $html .= "{$term->slug} ";
                }
                $title = get_the_title();
                $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'single-post-thumbnail');
                //original size
                $large_image = $featured_image_array[0];
                $slug_list_ = "pretty_photo_gallery";
                $html .= "'>";
                $html .= "<div class='image_holder'>";
                $html .= "<span class='image'>";
                $html .= get_the_post_thumbnail(get_the_ID(), 'full');
                $html .= "</span>";
                $html .= "<span class='text_holder'>";
                $html .= "<span class='text_outer'>";
                $html .= "<span class='text_inner'>";
                if ($type == "hover_text") {
                    $html .= '<h5><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>';
                    $html .= '<h6>';
                    $k = 1;
                    foreach ($terms as $term) {
                        $html .= "{$term->name}";
                        if (count($terms) != $k) {
                            $html .= ', ';
                        }
                        $k++;
                    }
                    $html .= '</h6>';
                }
                if ($lightbox == "yes") {
                    $html .= "<a class='lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'><span></span></a>";
                }
                $html .= "<a class='preview' href='" . get_permalink() . "'><span></span></a>";
                if ($type == "hover_text") {
                    $html .= "<span class='portfolio_like'>";
                    $portfolio_project_id = get_the_ID();
                    if (function_exists('qode_like_portfolio_list')) {
                        $html .= qode_like_portfolio_list();
                    }
                    $html .= "</span>";
                }
                $html .= "</span>";
                $html .= "</span>";
                $html .= "</span>";
                $html .= "</div>";
                if ($type != "hover_text") {
                    $html .= "<div class='portfolio_description'>";
                    $html .= '<h5><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>';
                    $html .= '<h6>';
                    $k = 1;
                    foreach ($terms as $term) {
                        $html .= "{$term->name}";
                        if (count($terms) != $k) {
                            $html .= ', ';
                        }
                        $k++;
                    }
                    $html .= '</h6>';
                    $html .= "<div class='portfolio_like'>";
                    $portfolio_project_id = get_the_ID();
                    if (function_exists('qode_like_portfolio_list')) {
                        $html .= qode_like_portfolio_list();
                    }
                    $html .= "</div>";
                    $html .= "</div>";
                }
                $html .= "</article>\n";
            }
            $i = 1;
            while ($i <= $columns) {
                $i++;
                if ($columns != 1) {
                    $html .= "<div class='filler'></div>\n";
                }
            }
        } else {
            ?>
	<p><?php 
            _e('Sorry, no posts matched your criteria.', 'qode');
            ?>
</p>
	<?php 
        }
        $html .= "</div>";
        if (get_next_posts_link()) {
            if ($show_load_more == "yes" || $show_load_more == "") {
                $html .= '<div class="portfolio_paging"><span rel="' . $wp_query->max_num_pages . '" class="load_more">' . get_next_posts_link(__('Load More', 'qode')) . '</span></div>';
            }
        }
        $html .= "</div>";
        wp_reset_query();
        return $html;
    }
 function portfolio_slider($atts, $content = null)
 {
     global $qode_options;
     $portfolio_qode_like = "on";
     if (isset($qode_options['portfolio_qode_like'])) {
         $portfolio_qode_like = $qode_options['portfolio_qode_like'];
     }
     $args = array("order_by" => "menu_order", "order" => "ASC", "number" => "-1", "category" => "", "selected_projects" => "", "disable_link" => "no", "lightbox" => "yes", "show_like" => "yes", "title_tag" => "h5", "image_size" => "portfolio-square", "enable_navigation" => "");
     extract(shortcode_atts($args, $atts));
     $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
     //get correct heading value. If provided heading isn't valid get the default one
     $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
     $portfolio_list_hide_category = false;
     if (isset($qode_options['portfolio_list_hide_category']) && $qode_options['portfolio_list_hide_category'] == "yes") {
         $portfolio_list_hide_category = true;
     }
     $html = "";
     $lightbox_slug = 'portfolio_slider_' . rand();
     $html .= "<div class='portfolio_slider_holder clearfix'><div class='portfolio_slider'><ul class='portfolio_slides'>";
     if ($category == "") {
         $q = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number);
     } else {
         $q = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number);
     }
     $project_ids = null;
     if ($selected_projects != "") {
         $project_ids = explode(",", $selected_projects);
         $q['post__in'] = $project_ids;
     }
     query_posts($q);
     if (have_posts()) {
         $postCount = 0;
         while (have_posts()) {
             the_post();
             $title = get_the_title();
             $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
             //get proper image size
             switch ($image_size) {
                 case 'landscape':
                     $thumb_size = 'portfolio-landscape';
                     break;
                 case 'portrait':
                     $thumb_size = 'portfolio-portrait';
                     break;
                 case 'square':
                     $thumb_size = 'portfolio-square';
                     break;
                 case 'full':
                     $thumb_size = 'full';
                     break;
                 default:
                     $thumb_size = 'portfolio-default';
                     break;
             }
             $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), $thumb_size);
             if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                 $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
             } else {
                 $large_image = $featured_image_array[0];
             }
             $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
             $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
             $target = $custom_portfolio_link != "" ? '_blank' : '_self';
             $html .= "<li class='item'>";
             $html .= "<div class='image_holder'>";
             $html .= "<span class='image'>";
             $html .= "<img src='" . $large_image . "' alt='" . $title . "'>";
             $html .= "</span>";
             /* close span.image */
             if ($disable_link != "yes") {
                 $html .= "<a class='portfolio_link_class' href='" . $portfolio_link . "' target='" . $target . "'></a>";
             }
             $html .= '<div class="portfolio_shader"></div>';
             $html .= '<div class="text_holder">';
             if (!$portfolio_list_hide_category) {
                 $html .= '<span class="project_category">';
                 $html .= '<span>' . __('In ', 'qode') . '</span>';
                 $k = 1;
                 foreach ($terms as $term) {
                     $html .= "{$term->name}";
                     if (count($terms) != $k) {
                         $html .= '/ ';
                     }
                     $k++;
                 }
                 $html .= '</span>';
             }
             $html .= '<' . $title_tag . ' class="portfolio_title">' . get_the_title() . '</' . $title_tag . '>';
             $html .= "</div>";
             $html .= '<div class="icons_holder"><div class="icons_holder_inner">';
             if ($lightbox == "yes") {
                 $html .= "<a class='portfolio_lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $lightbox_slug . "]'></a>";
             }
             if ($portfolio_qode_like == "on" && $show_like == "yes") {
                 if (function_exists('qode_like_portfolio_list')) {
                     $html .= qode_like_portfolio_list(get_the_ID());
                 }
             }
             $html .= "</div></div>";
             $html .= "</div>";
             /* close div.image_holder */
             $html .= "</li>";
             $postCount++;
         }
     } else {
         $html .= __('Sorry, no posts matched your criteria.', 'qode');
     }
     wp_reset_query();
     $html .= "</ul>";
     if ($enable_navigation) {
         $html .= '<ul class="caroufredsel-direction-nav"><li><a id="caroufredsel-prev" class="caroufredsel-prev" href="#"><span class="arrow_carrot-left"></span></a></li><li><a class="caroufredsel-next" id="caroufredsel-next" href="#"><span class="arrow_carrot-right"></span></a></li></ul>';
     }
     $html .= "</div></div>";
     return $html;
 }
Beispiel #5
0
    function portfolio_list($atts, $content = null)
    {
        global $wp_query;
        global $portfolio_project_id;
        global $qode_options_river;
        $portfolio_qode_like = "on";
        if (isset($qode_options_river['portfolio_qode_like'])) {
            $portfolio_qode_like = $qode_options_river['portfolio_qode_like'];
        }
        $args = array("type" => "standard", "columns" => "3", "order_by" => "menu_order", "order" => "ASC", "number" => "-1", "filter" => "no", "lightbox" => "yes", "category" => "", "selected_projects" => "", "show_load_more" => "yes", "title_tag" => "h4");
        extract(shortcode_atts($args, $atts));
        $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
        //get correct heading value. If provided heading isn't valid get the default one
        $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
        $html = "";
        $html .= "<div class='projects_holder_outer v{$columns}'>";
        if ($filter == "yes") {
            $html .= "<div class='filter_outer'><div class='filter_holder'>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\n\t\t\t\t\t\t<li class='filter' data-filter='all'><span>" . __('All', 'qode') . "</span></li>";
            if ($category == "") {
                $args = array('parent' => 0);
                $portfolio_categories = get_terms('portfolio_category', $args);
            } else {
                $top_category = get_term_by('slug', $category, 'portfolio_category');
                $term_id = '';
                if (isset($top_category->term_id)) {
                    $term_id = $top_category->term_id;
                }
                $args = array('parent' => $term_id);
                $portfolio_categories = get_terms('portfolio_category', $args);
            }
            foreach ($portfolio_categories as $portfolio_category) {
                $html .= "<li class='filter' data-filter='{$portfolio_category->slug}'><span>{$portfolio_category->name}</span>";
                $args = array('child_of' => $portfolio_category->term_id);
                $html .= '</li>';
            }
            $html .= "</ul></div></div>";
        }
        $_type_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
        } elseif ($type == "circle") {
            $_type_class = " circle";
        }
        $html .= "<div class='projects_holder clearfix v{$columns}{$_type_class}'>\n";
        if (get_query_var('paged')) {
            $paged = get_query_var('paged');
        } elseif (get_query_var('page')) {
            $paged = get_query_var('page');
        } else {
            $paged = 1;
        }
        if ($category == "") {
            $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
        } else {
            $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
        }
        $project_ids = null;
        if ($selected_projects != "") {
            $project_ids = explode(",", $selected_projects);
            $args['post__in'] = $project_ids;
        }
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                $html .= "<article class='mix ";
                foreach ($terms as $term) {
                    $html .= "{$term->slug} ";
                }
                $title = get_the_title();
                $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'single-post-thumbnail');
                //original size
                $large_image = $featured_image_array[0];
                $slug_list_ = "pretty_photo_gallery";
                $html .= "'>";
                $html .= "<div class='image_holder'>";
                $html .= "<span class='image'>";
                if ($type == "circle") {
                    $html .= "<span class='circle_hover'></span>";
                    $html .= get_the_post_thumbnail(get_the_ID(), 'portfolio-square');
                } else {
                    $html .= get_the_post_thumbnail(get_the_ID(), 'full');
                }
                $html .= "</span>";
                $html .= "<span class='text_holder'>";
                $html .= "<span class='text_outer'>";
                $html .= "<span class='text_inner'><span class='feature_holder'>";
                if ($type != "standard") {
                    $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></' . $title_tag . '>';
                    $html .= '<h6 class="project_category">';
                    $k = 1;
                    foreach ($terms as $term) {
                        $html .= "{$term->name}";
                        if (count($terms) != $k) {
                            $html .= ', ';
                        }
                        $k++;
                    }
                    $html .= '</h6>';
                }
                $html .= '<span class="feature_holder_icons">';
                if ($lightbox == "yes") {
                    $html .= "";
                }
                $html .= "<a class='preview' href='http://tickets.tickethub.co/ResultsGeneral.aspx?stype=0&kwds=" . get_the_title() . "'><i class='icon-ticket icon-2x'></i></a><a class='preview' href='" . get_permalink() . "'><i class='icon-link icon-2x'></i></a>";
                if ($type != "standard") {
                    if ($portfolio_qode_like == "on") {
                        $html .= "<span class='portfolio_like'>";
                        $portfolio_project_id = get_the_ID();
                        if (function_exists('qode_like_portfolio_list')) {
                            $html .= qode_like_portfolio_list();
                        }
                        $html .= "</span>";
                    }
                }
                $html .= "</span></span></span>";
                $html .= "</span>";
                $html .= "</span>";
                $html .= "</div>";
                if ($type == "standard") {
                    $html .= "<div class='portfolio_description'>";
                    $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></' . $title_tag . '>';
                    $html .= '<span class="project_category">';
                    $k = 1;
                    foreach ($terms as $term) {
                        $html .= "{$term->name}";
                        if (count($terms) != $k) {
                            $html .= ', ';
                        }
                        $k++;
                    }
                    $html .= '</span>';
                    if ($portfolio_qode_like == "on") {
                        $html .= "<div class='portfolio_like'>";
                        $portfolio_project_id = get_the_ID();
                        if (function_exists('qode_like_portfolio_list')) {
                            $html .= qode_like_portfolio_list();
                        }
                        $html .= "</div>";
                    }
                    $html .= "</div>";
                }
                $html .= "</article>\n";
            }
            $i = 1;
            while ($i <= $columns) {
                $i++;
                if ($columns != 1) {
                    $html .= "<div class='filler'></div>\n";
                }
            }
        } else {
            ?>
            	<p><?php 
            _e('Sorry, no posts matched your criteria.', 'qode');
            ?>
</p>
        <?php 
        }
        $html .= "</div>";
        if (get_next_posts_link()) {
            if ($show_load_more == "yes" || $show_load_more == "") {
                $html .= '<div class="portfolio_paging"><span rel="' . $wp_query->max_num_pages . '" class="load_more">' . get_next_posts_link(__('SHOW MORE', 'qode')) . '</span></div>';
            }
        }
        $html .= "</div>";
        wp_reset_query();
        return $html;
    }
Beispiel #6
0
    function portfolio_list($atts, $content = null)
    {
        global $wp_query;
        global $qode_options;
        $portfolio_qode_like = "on";
        if (isset($qode_options['portfolio_qode_like'])) {
            $portfolio_qode_like = $qode_options['portfolio_qode_like'];
        }
        $portfolio_list_hide_category = false;
        if (isset($qode_options['portfolio_list_hide_category']) && $qode_options['portfolio_list_hide_category'] == "yes") {
            $portfolio_list_hide_category = true;
        }
        $portfolio_filter_class = "";
        if (isset($qode_options['portfolio_filter_disable_separator']) && !empty($qode_options['portfolio_filter_disable_separator'])) {
            if ($qode_options['portfolio_filter_disable_separator'] == "yes") {
                $portfolio_filter_class = "without_separator";
            } else {
                $portfolio_filter_class = "";
            }
        }
        $args = array("type" => "standard", "hover_type" => "default_hover", "box_border" => "", "box_background_color" => "", "box_border_color" => "", "box_border_width" => "", "columns" => "3", "image_size" => "", "order_by" => "date", "order" => "ASC", "number" => "-1", "filter" => "no", "filter_order_by" => "name", "disable_filter_title" => "no", "filter_align" => "left_align", "disable_link" => "no", "lightbox" => "yes", "show_like" => "yes", "category" => "", "selected_projects" => "", "show_load_more" => "yes", "title_tag" => "h4", "title_font_size" => "", "text_align" => "");
        extract(shortcode_atts($args, $atts));
        $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
        //get correct heading value. If provided heading isn't valid get the default one
        $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
        $html = "";
        $_type_class = '';
        $_portfolio_space_class = '';
        $_portfolio_masonry_with_space_class = '';
        if ($type == "hover_text") {
            $_type_class = " hover_text";
            $_portfolio_space_class = "portfolio_with_space portfolio_with_hover_text";
        } elseif ($type == "standard" || $type == "masonry_with_space") {
            $_type_class = " standard";
            $_portfolio_space_class = "portfolio_with_space portfolio_standard";
            if ($type == "masonry_with_space") {
                $_portfolio_masonry_with_space_class = ' masonry_with_space';
            }
        } elseif ($type == "standard_no_space") {
            $_type_class = " standard_no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_standard";
        } elseif ($type == "hover_text_no_space") {
            $_type_class = " hover_text no_space";
            $_portfolio_space_class = "portfolio_no_space portfolio_with_hover_text";
        }
        $portfolio_box_style = "";
        $portfolio_description_class = "";
        if ($box_border == "yes" || $box_background_color != "") {
            $portfolio_box_style .= "style=";
            if ($box_border == "yes") {
                $portfolio_box_style .= "border-style:solid;";
                if ($box_border_color != "") {
                    $portfolio_box_style .= "border-color:" . $box_border_color . ";";
                }
                if ($box_border_width != "") {
                    $portfolio_box_style .= "border-width:" . $box_border_width . "px;";
                } else {
                    $portfolio_box_style .= "border-width: 1px;";
                }
            }
            if ($box_background_color != "") {
                $portfolio_box_style .= "background-color:" . $box_background_color . ";";
            }
            $portfolio_box_style .= "'";
            $portfolio_description_class .= 'with_padding';
            $_portfolio_space_class = ' with_description_background';
        }
        if ($text_align !== '') {
            $portfolio_description_class .= ' text_align_' . $text_align;
        }
        if ($type != 'masonry') {
            $html .= "<div class='projects_holder_outer v{$columns} {$_portfolio_space_class} {$_portfolio_masonry_with_space_class}'>";
            if ($filter == "yes") {
                $html .= "<div class='filter_outer filter_portfolio " . $filter_align . "'>";
                $html .= "<div class='filter_holder " . $portfolio_filter_class . "'><ul>";
                if ($disable_filter_title != "yes") {
                    $html .= "<li class='filter_title'><span>" . __('Sort Portfolio:', 'edgt_cpt') . "</span></li>";
                }
                if ($type == 'masonry_with_space' || $type == 'masonry_with_space_without_description') {
                    $html .= "<li class='filter' data-filter='*'><span>" . __('All', 'edgt_cpt') . "</span></li>";
                } else {
                    $html .= "<li class='parent_menu filter' data-filter='all'><span>" . __('All', 'edgt_cpt') . "</span></li>";
                }
                if ($category == "") {
                    $args = array('parent' => 0, 'orderby' => $filter_order_by);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                } else {
                    $top_category = get_term_by('slug', $category, 'portfolio_category');
                    $term_id = '';
                    if (isset($top_category->term_id)) {
                        $term_id = $top_category->term_id;
                    }
                    $args = array('parent' => $term_id, 'orderby' => $filter_order_by);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                }
                foreach ($portfolio_categories as $portfolio_category) {
                    if ($type == 'masonry_with_space' || $type == 'masonry_with_space_without_description') {
                        $html .= "<li class='filter' data-filter='portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                        //$html .= "<li><span>$portfolio_category->name</span>";
                    } else {
                        $args = array('child_of' => $portfolio_category->term_id);
                        $portfolio_categories_child = get_terms('portfolio_category', $args);
                        $subcatnum = count($portfolio_categories_child);
                        $subcats = array();
                        if ($subcatnum > 1) {
                            foreach ($portfolio_categories_child as $portfolio_category_child) {
                                array_push($subcats, 'portfolio_category_' . $portfolio_category_child->term_id);
                                $subcatresults = implode(' ', $subcats);
                            }
                        } else {
                            $subcatresults = 'portfolio_category_' . $portfolio_category_child->term_id;
                        }
                        $html .= "<li class='parent_menu filter' data-filter='{$subcatresults}'><span>{$portfolio_category->name}</span>";
                    }
                    $html .= "<ul class='child'>";
                    foreach ($portfolio_categories_child as $portfolio_category_child) {
                        $html .= "<li class='filter' data-filter='portfolio_category_{$portfolio_category_child->term_id}'><span>{$portfolio_category_child->name}</span></li>";
                    }
                    $html .= "</ul></li>";
                }
                $html .= "</ul></div></div><div id='filterSelect'></div>";
            }
            $thumb_size_class = "";
            //get proper image size
            switch ($image_size) {
                case 'landscape':
                    $thumb_size_class = 'portfolio_landscape_image';
                    break;
                case 'portrait':
                    $thumb_size_class = 'portfolio_portrait_image';
                    break;
                case 'square':
                    $thumb_size_class = 'portfolio_square_image';
                    break;
                case 'full':
                    $thumb_size_class = 'portfolio_full_image';
                    break;
                default:
                    $thumb_size_class = 'portfolio_default_image';
                    break;
            }
            $html .= "<div class='projects_holder clearfix v{$columns}{$_type_class} {$thumb_size_class}'>n";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $html .= "<article class='mix ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $title = get_the_title();
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    //get proper image size
                    switch ($image_size) {
                        case 'landscape':
                            $thumb_size = 'portfolio-landscape';
                            break;
                        case 'portrait':
                            $thumb_size = 'portfolio-portrait';
                            break;
                        case 'square':
                            $thumb_size = 'portfolio-square';
                            break;
                        case 'full':
                            $thumb_size = 'full';
                            break;
                        default:
                            $thumb_size = 'portfolio-default';
                            break;
                    }
                    if ($type == "masonry_with_space") {
                        $thumb_size = 'portfolio_masonry_with_space';
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $html .= "'>";
                    $html .= "<div class='image_holder " . $hover_type . "'>";
                    $html .= "<span class='image'>";
                    $html .= get_the_post_thumbnail(get_the_ID(), $thumb_size);
                    $html .= "</span>";
                    if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                        if ($disable_link != "yes") {
                            $html .= "<a class='portfolio_link_class' href='" . $portfolio_link . "' target='" . $target . "'></a>";
                        }
                        $html .= '<div class="portfolio_shader"></div>';
                        $html .= '<div class="icons_holder"><div class="icons_holder_inner">';
                        if ($lightbox == "yes") {
                            $html .= "<a class='portfolio_lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'></a>";
                        }
                        if ($portfolio_qode_like == "on" && $show_like == "yes") {
                            if (function_exists('qode_like_portfolio_list')) {
                                $html .= qode_like_portfolio_list(get_the_ID());
                            }
                        }
                        $html .= "</div></div>";
                    } else {
                        if ($type == "hover_text" || $type == "hover_text_no_space") {
                            if ($disable_link != "yes") {
                                $html .= "<a class='portfolio_link_class' href='" . $portfolio_link . "' target='" . $target . "'></a>";
                            }
                            $html .= '<div class="portfolio_shader"></div>';
                            $html .= '<div class="text_holder">';
                            if ($hover_type == "elegant_hover") {
                                $html .= '<div class="text_holder_inner"><div class="text_holder_inner2">';
                            }
                            if ($hover_type == "default_hover" && !$portfolio_list_hide_category) {
                                $html .= '<span class="project_category">';
                                $html .= '<span>' . get_field('artist_name') . '</span></span>';
                            }
                            $title_style = '';
                            if ($title_font_size != "") {
                                $title_style = 'style="font-size: ' . $title_font_size . 'px;"';
                            }
                            $html .= '<' . $title_tag . ' class="portfolio_title" ' . $title_style . '>' . get_the_title() . '</' . $title_tag . '>';
                            if ($hover_type != "default_hover" && !$portfolio_list_hide_category) {
                                $html .= '<span class="project_category">';
                                $html .= '<span>' . __('In ', 'qode') . '</span>';
                                $k = 1;
                                foreach ($terms as $term) {
                                    $html .= "{$term->name}";
                                    if (count($terms) != $k) {
                                        $html .= ' / ';
                                    }
                                    $k++;
                                }
                                $html .= '</span>';
                            }
                            if ($hover_type == "elegant_hover") {
                                $html .= '</div></div>';
                            }
                            $html .= "</div>";
                            if ($hover_type != "elegant_hover") {
                                $html .= '<div class="icons_holder"><div class="icons_holder_inner">';
                                if ($lightbox == "yes") {
                                    $html .= "<a class='portfolio_lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'></a>";
                                }
                                if ($portfolio_qode_like == "on" && $show_like == "yes") {
                                    if (function_exists('qode_like_portfolio_list')) {
                                        $html .= qode_like_portfolio_list(get_the_ID());
                                    }
                                }
                                $html .= "</div></div>";
                            }
                        }
                    }
                    $html .= "</div>";
                    if ($type == "standard" || $type == "standard_no_space" || $type == "masonry_with_space") {
                        $html .= "<div class='portfolio_description " . $portfolio_description_class . "'" . $portfolio_box_style . ">";
                        $title_style = '';
                        if ($title_font_size != "") {
                            $title_style = 'style="font-size: ' . $title_font_size . 'px;"';
                        }
                        if ($disable_link != "yes") {
                            $html .= '<' . $title_tag . ' class="portfolio_title" ' . $title_style . '><a href="' . $portfolio_link . '" target="' . $target . '">' . get_the_title() . '</a></' . $title_tag . '>';
                        } else {
                            $html .= '<' . $title_tag . ' class="portfolio_title" ' . $title_style . '>' . get_the_title() . '</' . $title_tag . '>';
                        }
                        if (!$portfolio_list_hide_category) {
                            $html .= '<span class="project_category">';
                            $html .= '<span>' . __('In ', 'qode') . '</span>';
                            $k = 1;
                            foreach ($terms as $term) {
                                $html .= "{$term->name}";
                                if (count($terms) != $k) {
                                    $html .= ', ';
                                }
                                $k++;
                            }
                            $html .= '</span>';
                        }
                        $html .= '</div>';
                    }
                    $html .= "</article>n";
                }
                $i = 1;
                while ($i <= $columns) {
                    $i++;
                    if ($columns != 1) {
                        $html .= "<div class='filler'></div>n";
                    }
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
            <?php 
            }
            $html .= "</div>";
            if (get_next_posts_link()) {
                if ($show_load_more == "yes" || $show_load_more == "") {
                    $html .= '<div class="portfolio_paging"><span rel="' . $wp_query->max_num_pages . '" class="load_more">' . get_next_posts_link(__('Show more', 'qode')) . '</span></div>';
                    $html .= '<div class="portfolio_paging_loading"><a href="javascript: void(0)" class="qbutton">' . __('Loading...', 'qode') . '</a></div>';
                }
            }
            $html .= "</div>";
            wp_reset_query();
        } else {
            if ($filter == "yes") {
                $html .= "<div class='filter_outer " . $filter_align . "'>";
                $html .= "<div class='filter_holder " . $portfolio_filter_class . "'><ul>";
                if ($disable_filter_title != "yes") {
                    $html .= "<li class='filter_title'><span>" . __('Sort Portfolio:', 'qode') . "</span></li>";
                }
                $html .= "<li class='filter' data-filter='*'><span>" . __('All', 'qode') . "</span></li>";
                if ($category == "") {
                    $args = array('parent' => 0, 'orderby' => $filter_order_by);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                } else {
                    $top_category = get_term_by('slug', $category, 'portfolio_category');
                    $term_id = '';
                    if (isset($top_category->term_id)) {
                        $term_id = $top_category->term_id;
                    }
                    $args = array('parent' => $term_id, 'orderby' => $filter_order_by);
                    $portfolio_categories = get_terms('portfolio_category', $args);
                }
                foreach ($portfolio_categories as $portfolio_category) {
                    $html .= "<li class='filter' data-filter='.portfolio_category_{$portfolio_category->term_id}'><span>{$portfolio_category->name}</span>";
                    $args = array('child_of' => $portfolio_category->term_id);
                    $html .= '</li>';
                }
                $html .= "</ul></div>";
                $html .= "</div>";
            }
            $html .= "<div class='projects_masonry_holder'>";
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            if ($category == "") {
                $args = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            } else {
                $args = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number, 'paged' => $paged);
            }
            $project_ids = null;
            if ($selected_projects != "") {
                $project_ids = explode(",", $selected_projects);
                $args['post__in'] = $project_ids;
            }
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
                    $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                    //original size
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true) != "") {
                        $large_image = get_post_meta(get_the_ID(), 'qode_portfolio-lightbox-link', true);
                    } else {
                        $large_image = $featured_image_array[0];
                    }
                    $custom_portfolio_link = get_post_meta(get_the_ID(), 'qode_portfolio-external-link', true);
                    $portfolio_link = $custom_portfolio_link != "" ? $custom_portfolio_link : get_permalink();
                    if (get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true) != "") {
                        $custom_portfolio_link_target = get_post_meta(get_the_ID(), 'qode_portfolio-external-link-target', true);
                    } else {
                        $custom_portfolio_link_target = '_blank';
                    }
                    $target = $custom_portfolio_link != "" ? $custom_portfolio_link_target : '_self';
                    $masonry_size = "default";
                    $masonry_size = get_post_meta(get_the_ID(), "qode_portfolio_type_masonry_style", true);
                    $image_size = "";
                    if ($masonry_size == "large_width") {
                        $image_size = "portfolio_masonry_wide";
                    } elseif ($masonry_size == "large_height") {
                        $image_size = "portfolio_masonry_tall";
                    } elseif ($masonry_size == "large_width_height") {
                        $image_size = "portfolio_masonry_large";
                    } else {
                        $image_size = "portfolio_masonry_regular";
                    }
                    if ($type == "masonry_with_space") {
                        $image_size = "portfolio_masonry_with_space";
                    }
                    $slug_list_ = "pretty_photo_gallery";
                    $title = get_the_title();
                    $html .= "<article class='portfolio_masonry_item ";
                    foreach ($terms as $term) {
                        $html .= "portfolio_category_{$term->term_id} ";
                    }
                    $html .= " " . $masonry_size;
                    $html .= "'>";
                    $html .= "<div class='image_holder " . $hover_type . "'>";
                    $html .= "<span class='image'>";
                    $html .= get_the_post_thumbnail(get_the_ID(), $image_size);
                    $html .= "</span>";
                    //close span.image
                    if ($disable_link != "yes") {
                        $html .= "<a class='portfolio_link_class' href='" . $portfolio_link . "' target='" . $target . "'></a>";
                    }
                    $html .= '<div class="portfolio_shader"></div>';
                    $html .= '<div class="text_holder">';
                    if ($hover_type == "elegant_hover") {
                        $html .= '<div class="text_holder_inner"><div class="text_holder_inner2">';
                    }
                    if ($hover_type == "default_hover" && !$portfolio_list_hide_category) {
                        $html .= '<span class="project_category">';
                        $html .= '<span>' . __('In ', 'qode') . '</span>';
                        $k = 1;
                        foreach ($terms as $term) {
                            $html .= "{$term->name}";
                            if (count($terms) != $k) {
                                $html .= ' / ';
                            }
                            $k++;
                        }
                        $html .= '</span>';
                    }
                    $title_style = '';
                    if ($title_font_size != "") {
                        $title_style = 'style="font-size: ' . $title_font_size . 'px;"';
                    }
                    $html .= '<' . $title_tag . ' class="portfolio_title" ' . $title_style . '>' . get_the_title() . '</' . $title_tag . '>';
                    if ($hover_type != "default_hover" && !$portfolio_list_hide_category) {
                        $html .= '<span class="project_category">';
                        $html .= '<span>' . __('In ', 'qode') . '</span>';
                        $k = 1;
                        foreach ($terms as $term) {
                            $html .= "{$term->name}";
                            if (count($terms) != $k) {
                                $html .= ' / ';
                            }
                            $k++;
                        }
                        $html .= '</span>';
                    }
                    if ($hover_type == "elegant_hover") {
                        $html .= '</div></div>';
                    }
                    $html .= "</div>";
                    if ($hover_type != "elegant_hover") {
                        $html .= '<div class="icons_holder"><div class="icons_holder_inner">';
                        if ($lightbox == "yes") {
                            $html .= "<a class='portfolio_lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'></a>";
                        }
                        if ($portfolio_qode_like == "on" && $show_like == "yes") {
                            if (function_exists('qode_like_portfolio_list')) {
                                $html .= qode_like_portfolio_list(get_the_ID());
                            }
                        }
                        $html .= "</div></div>";
                    }
                    $html .= "</div>";
                    //close div.image_holder
                    $html .= "</article>";
                }
            } else {
                ?>
                <p><?php 
                _e('Sorry, no posts matched your criteria.', 'qode');
                ?>
</p>
                <?php 
            }
            wp_reset_query();
            $html .= "</div>";
        }
        return $html;
    }
Beispiel #7
0
 function portfolio_slider($atts, $content = null)
 {
     global $portfolio_project_id;
     global $qode_options_theme13;
     $portfolio_qode_like = "on";
     if (isset($qode_options_theme13['portfolio_qode_like'])) {
         $portfolio_qode_like = $qode_options_theme13['portfolio_qode_like'];
     }
     $args = array("order_by" => "menu_order", "order" => "ASC", "number" => "-1", "category" => "", "selected_projects" => "", "lightbox" => "", "title_tag" => "h5");
     extract(shortcode_atts($args, $atts));
     $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
     //get correct heading value. If provided heading isn't valid get the default one
     $title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
     $html = "";
     $html .= "<div class='portfolio_slider_holder clearfix'><div class='portfolio_slider'><ul class='portfolio_slides'>";
     if ($category == "") {
         $q = array('post_type' => 'portfolio_page', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number);
     } else {
         $q = array('post_type' => 'portfolio_page', 'portfolio_category' => $category, 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number);
     }
     $project_ids = null;
     if ($selected_projects != "") {
         $project_ids = explode(",", $selected_projects);
         $q['post__in'] = $project_ids;
     }
     query_posts($q);
     if (have_posts()) {
         $postCount = 0;
         while (have_posts()) {
             the_post();
             $title = get_the_title();
             $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category');
             $featured_image_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium');
             $large_image = $featured_image_array[0];
             $html .= "<li>";
             $html .= "<div class='image_holder'>";
             $html .= "<span class='image'><span class='image_pixel_hover'></span><a href='" . get_permalink() . "'>";
             $html .= "<img src='" . $large_image . "' alt='" . $title . "'>";
             $html .= "</a></span>";
             $html .= "<div class='hover_feature_holder'>";
             $html .= '<span class="hover_feature_holder_icons"><span class="hover_feature_holder_icons_inner">';
             if ($lightbox == "yes") {
                 $html .= "<a class='lightbox' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[portfolio_slider]'><i class='fa fa-search fa-2x'></i></a>";
             }
             $html .= "<a class='preview' href='" . get_permalink() . "'><i class='fa fa-link fa-2x'></i></a>";
             if ($portfolio_qode_like == "on") {
                 $html .= "<span class='portfolio_like'>";
                 $portfolio_project_id = get_the_ID();
                 if (function_exists('qode_like_portfolio_list')) {
                     $html .= qode_like_portfolio_list();
                 }
                 $html .= "</span>";
             }
             $html .= "</span></span>";
             $html .= '<div class="hover_feature_holder_outer"><div class="hover_feature_holder_inner">';
             $html .= '<' . $title_tag . ' class="portfolio_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></' . $title_tag . '>';
             $html .= '<span class="separator"></span>';
             $html .= '<span class="project_category">';
             $k = 1;
             foreach ($terms as $term) {
                 $html .= "{$term->name}";
                 if (count($terms) != $k) {
                     $html .= ', ';
                 }
                 $k++;
             }
             $html .= '</span></div></div>';
             $html .= "</div>";
             $html .= "</div>";
             $html .= "</li>";
             $postCount++;
         }
     } else {
         $html .= __('Sorry, no posts matched your criteria.', 'qode');
     }
     wp_reset_query();
     $html .= "</ul></div></div>";
     return $html;
 }