Ejemplo n.º 1
0
 function gdlr_get_page_list_item($settings)
 {
     if (function_exists('gdlr_include_portfolio_scirpt')) {
         gdlr_include_portfolio_scirpt();
     }
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
     $settings['title'] = empty($settings['title']) ? '' : $settings['title'];
     $settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
     $settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
     $ret .= gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type']));
     $ret .= '<div class="portfolio-item-wrapper type-' . $settings['page-style'] . '" ' . $item_id . $margin_style . '>';
     // query section
     $args = array('post_type' => 'page', 'suppress_filters' => false);
     $args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
     $args['orderby'] = 'menu_order';
     $args['order'] = 'asc';
     $args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
     if (!empty($settings['category'])) {
         $args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'page_category', 'field' => 'slug'));
     }
     $query = new WP_Query($args);
     // print item section
     $settings['item-size'] = str_replace('1/', '', $settings['item-size']);
     $ret .= '<div class="portfolio-item-holder">';
     if ($settings['page-style'] == 'classic') {
         $ret .= gdlr_get_classic_page_list($query, $settings['item-size'], $settings['thumbnail-size'], $settings['page-layout']);
     } else {
         if ($settings['page-style'] == 'modern') {
             $ret .= gdlr_get_modern_page_list($query, $settings['item-size'], $settings['thumbnail-size'], $settings['page-layout']);
         }
     }
     $ret .= '<div class="clear"></div>';
     $ret .= '</div>';
     if ($settings['pagination'] == 'enable') {
         $ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
     }
     $ret .= '</div>';
     // portfolio-item-wrapper
     return $ret;
 }
 function gdlr_print_portfolio_item($settings = array())
 {
     gdlr_include_portfolio_scirpt();
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
     $settings['title'] = empty($settings['title']) ? '' : $settings['title'];
     $settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
     $settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
     $right_text = '';
     $right_text_class = '';
     $carousel = false;
     $settings['right-text'] = empty($settings['right-text']) ? '' : $settings['right-text'];
     $settings['right-text-link'] = empty($settings['right-text-link']) ? '' : $settings['right-text-link'];
     if (!empty($settings['right-text-link']) && !empty($settings['right-text'])) {
         $right_text_class = 'gdlr-right-text ';
         $right_text .= '<a class="gdlr-right-text-link" href="' . $settings['right-text-link'] . '" >' . $settings['right-text'] . '</a>';
     }
     if ($settings['portfolio-layout'] == 'carousel') {
         $carousel = true;
         $right_text_class .= 'gdlr-nav-container ';
     }
     $ret = gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type'], 'carousel' => $carousel, 'additional_class' => $right_text_class, 'additional_html' => $right_text));
     $ret .= '<div class="portfolio-item-wrapper type-' . $settings['portfolio-style'] . '" ';
     $ret .= $item_id . $margin_style . ' data-ajax="' . AJAX_URL . '" >';
     // query posts section
     $args = array('post_type' => 'portfolio', 'suppress_filters' => false);
     $args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
     $args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
     $args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
     $args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
     if (!empty($settings['category']) || !empty($settings['tag']) && $settings['portfolio-filter'] == 'disable') {
         $args['tax_query'] = array('relation' => 'OR');
         if (!empty($settings['category'])) {
             array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'portfolio_category', 'field' => 'slug'));
         }
         if (!empty($settings['tag']) && $settings['portfolio-filter'] == 'disable') {
             array_push($args['tax_query'], array('terms' => explode(',', $settings['tag']), 'taxonomy' => 'portfolio_tag', 'field' => 'slug'));
         }
     }
     $query = new WP_Query($args);
     // create the portfolio filter
     $settings['portfolio-size'] = str_replace('1/', '', $settings['portfolio-size']);
     if ($settings['portfolio-filter'] == 'enable') {
         // ajax infomation
         $ret .= '<div class="gdlr-ajax-info" data-num-fetch="' . $args['posts_per_page'] . '" ';
         $ret .= 'data-orderby="' . $args['orderby'] . '" data-order="' . $args['order'] . '" ';
         $ret .= 'data-thumbnail-size="' . $settings['thumbnail-size'] . '" data-port-style="' . $settings['portfolio-style'] . '" ';
         $ret .= 'data-port-size="' . $settings['portfolio-size'] . '" data-port-layout="' . $settings['portfolio-layout'] . '" ';
         $ret .= 'data-ajax="' . admin_url('admin-ajax.php') . '" data-category="' . $settings['category'] . '" ></div>';
         // category filter
         if (empty($settings['category'])) {
             $parent = array('gdlr-all' => __('All', 'gdlr-portfolio'));
             $settigns['category-id'] = '';
         } else {
             $term = get_term_by('slug', $settings['category'], 'portfolio_category');
             $parent = array($settings['category'] => $term->name);
             $settings['category-id'] = $term->term_id;
         }
         $filters = $parent + gdlr_get_term_list('portfolio_category', $settings['category-id']);
         $filter_active = 'active';
         $ret .= '<div class="portfolio-item-filter">';
         foreach ($filters as $filter_id => $filter) {
             $filter_id = $filter_id == 'gdlr-all' ? '' : $filter_id;
             $ret .= '<a class="' . $filter_active . '" href="#" ';
             $ret .= 'data-category="' . $filter_id . '" ><span class="sep">/</span>' . $filter . '</a>';
             $filter_active = '';
         }
         $ret .= '</div>';
     }
     $no_space = strpos($settings['portfolio-style'], 'no-space') > 0 ? 'gdlr-item-no-space' : '';
     $no_space .= ' gdlr-portfolio-column-' . $settings['portfolio-size'];
     $ret .= '<div class="portfolio-item-holder ' . $no_space . '">';
     if ($settings['portfolio-style'] == 'classic-portfolio' || $settings['portfolio-style'] == 'classic-portfolio-no-space') {
         $ret .= gdlr_get_classic_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']);
     } else {
         if ($settings['portfolio-style'] == 'modern-portfolio' || $settings['portfolio-style'] == 'modern-portfolio-no-space') {
             $ret .= gdlr_get_modern_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']);
         }
     }
     $ret .= '<div class="clear"></div>';
     $ret .= '</div>';
     // create pagination
     if ($settings['portfolio-filter'] == 'enable' && $settings['pagination'] == 'enable') {
         $ret .= gdlr_get_ajax_pagination($query->max_num_pages, $args['paged']);
     } else {
         if ($settings['pagination'] == 'enable') {
             $ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
         }
     }
     $ret .= '</div>';
     // portfolio-item-wrapper
     return $ret;
 }
Ejemplo n.º 3
0
$gdlr_sidebar = gdlr_get_sidebar_class($gdlr_sidebar);
?>
	<div class="with-sidebar-wrapper">
		<div class="with-sidebar-container container">
			<div class="with-sidebar-left <?php 
echo esc_attr($gdlr_sidebar['outer']);
?>
 columns">
				<div class="with-sidebar-content <?php 
echo esc_attr($gdlr_sidebar['center']);
?>
 gdlr-item-start-content columns">
					<?php 
if (is_tax('portfolio_category') || is_tax('portfolio_tag')) {
    global $wp_query;
    gdlr_include_portfolio_scirpt();
    echo '<div class="portfolio-item-holder" >';
    if ($theme_option['archive-portfolio-style'] == 'classic-portfolio') {
        global $gdlr_excerpt_length;
        $gdlr_excerpt_length = $theme_option['archive-portfolio-num-excerpt'];
        add_filter('excerpt_length', 'gdlr_set_excerpt_length');
        echo gdlr_get_classic_portfolio($wp_query, str_replace('1/', '', $theme_option['archive-portfolio-size']), $theme_option['archive-portfolio-thumbnail-size'], 'fitRows');
        remove_filter('excerpt_length', 'gdlr_set_excerpt_length');
    } else {
        if ($theme_option['archive-portfolio-style'] == 'modern-portfolio') {
            echo gdlr_get_modern_portfolio($wp_query, str_replace('1/', '', $theme_option['archive-portfolio-size']), $theme_option['archive-portfolio-thumbnail-size'], 'fitRows');
        }
    }
    echo '<div class="clear"></div>';
    echo '</div>';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;