1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php 
/*
* The Loop for portfolio overview pages. Works in conjunction with the file template-portfolio.php and taxonomy-portfolio_entries.php
*/



global $avia_config;
if(isset($avia_config['new_query'])) { query_posts($avia_config['new_query']); }

$loop_counter = 1;
// check if we got a page to display:
if (have_posts()) :
	
	$extraClass = 'first';
	$style = 'portfolio-entry-no-description';
	
	$grid = 'grid3';
	$image_size = 'portfolio4';
	$showcaption = true;
	$hr_class = "hr";
	$render_hr = false;
	
	
	switch($avia_config['portfolio_columns'])
	{
		case "2": $grid = 'grid6';  $image_size = 'portfolio2'; break;
		case "3": $grid = 'grid4';  $image_size = 'portfolio3'; break;
		case "4": $grid = 'grid3';  $image_size = 'portfolio4'; break;
		case "2 sidebar_left single_sidebar":  $grid = 'grid4';  $image_size = 'portfolio3'; break;
		case "2 sidebar_right single_sidebar": $grid = 'grid4';  $image_size = 'portfolio3'; break;		
		case "3 sidebar_left":  $grid = 'grid_third1';  $image_size = 'portfolio3_sb'; break;
		case "3 sidebar_right": $grid = 'grid_third1';  $image_size = 'portfolio3_sb'; break;
		case "1 dual-sidebar":  $grid = '';  $image_size = 'page'; break;
		case "2 dual-sidebar":  $grid = 'grid3';  $image_size = 'portfolio4'; break;
		case "1":  $grid = 'fullwidth';  $image_size = 'aviacordion'; if(isset($avia_config['remove_portfolio_text']) && $avia_config['layout'] =='fullwidth') { $image_size = 'featured';} break;
	}
	
	$avia_config['portfolio_columns_iteration'] = $avia_config['portfolio_columns'][0];
	if(!isset($avia_config['remove_portfolio_text'])) $style = 'portfolio-entry-description';
	
	
	$includeArray = "";
	if(isset($avia_config['new_query']['tax_query'][0]['terms'])) $includeArray = $avia_config['new_query']['tax_query'][0]['terms'];
	
	$args = array(

		'taxonomy'	=> 'portfolio_entries',
		'hide_empty'=> 0,
		'include'	=> $includeArray,
	);

	
	

	$temp_cats = explode(',', $includeArray);
$filtered_cats = array_filter($temp_cats,
	function ($cat){
		return ($cat != '91');
	}
);
$includeArray = implode(',', $filtered_cats);

$args = array(

		'taxonomy'	=> 'portfolio_entries',
		'hide_empty'=> 0,
		'include'	=> $includeArray
	);
	
	
	
	
	$categories = get_categories($args);
	$container_id = "";
	
	
	if(!isset($avia_config['portfolio_sorting']) || $avia_config['portfolio_sorting'] == 'yes')
	{
		if(!empty($categories[0]))
		{
			$output = "<div id='js_sort_items' >";
	
			$hide = "hidden";
			if (isset($categories[1])){ $hide = ""; }
			
			$output .= "<div class='sort_by_cat $hide '>";
			$output .= "<a href='#' id='all_sort' class='active_sort'>".__('All','avia_framework')."</a>";
			
			foreach($categories as $category)
			{
				$output .= "<span class='text-sep'>/</span><a href='#' id='".$category->category_nicename."_sort'>".$category->cat_name."</a>";
				$container_id .= $category->term_id;
			}
			
			$output .= "</div>";
			
	
			$output .= "</div>";
			
			echo $output;
		}
	}