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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
function _prime_print_homeSlides(){

	$args = false;

	if( prime_slides_use_custom() ){

		$postIds = get_prime_option_by( THEME_SHORTNAME . '_sliderCustomPostOrder', 'null');

		if( $postIds != 'null'){
			$array_postIds = explode(",", $postIds);

			$args=array(
				'post_type' 		=> 'portfolio',
				'post_status'		=> 'publish',
				'posts_per_page'	=> -1,
				'ignore_sticky_posts'=> 1,
				'paged'				=> false,
				'post__in'			=> $array_postIds
			);
		}

	} else {

		$type = get_prime_option_by( THEME_SHORTNAME . '_sliderPostContent', 'latest');
		$number = 5;
		switch ($type) {
			case 'latest':
					$number = 5;
				break;

			case '6':
					$number = 6;
				break;

			case '7':
					$number = 7;
				break;

			case '8':
					$number = 8;
				break;
		}


		$args=array(
			'post_type' 		=> 'portfolio',
			'post_status'		=> 'publish',
			'posts_per_page'	=> $number,
			'ignore_sticky_posts'=> 0,
			'paged'				=> false
		);

	}

	if( $args ){

		$slideQuery = new WP_Query( $args );
		
		if( $slideQuery->have_posts() ):
?>
<div id="full-slides">

	<div id="slide-nav-container">
		<ul id="slide-data">
<?php
	while ($slideQuery->have_posts()): $slideQuery->the_post();
	global $post;

	$thumbID = get_post_meta( $post->ID, '_prime_portfolio_thumbnail_id', true);

	if( $thumbID != "" && prime_check_file_exists( $thumbID ) ){
		$iFile = prime_check_file_exists( $thumbID );
		$img_size = getimagesize( $iFile );

		$num_comments = get_comments_number();
		$num_view = _prime_portfolio_visitor_count($post->ID);
		$num_likes = _prime_portfolio_likes_count($post->ID);
?>

	<li>
		<span class="s-data" data-width="<?php echo $img_size[0]; ?>" data-height="<?php echo $img_size[1]; ?>"><?php print wp_get_attachment_url( $thumbID ); ?></span>
	<?php if( prime_get_homepage_content() == 'none' ) { ?>
		<div class="project <?php echo prime_portfolio_category_as_class(); ?>">
			<figure class="frontCover">
			<div class="project-thumbnail-title">
				<div class="project-thumbnail">
					<img src="<?php echo prime_resize( $iFile, wp_get_attachment_url( $thumbID ), 300, 9999, false, true ); ?>" alt="" />
					<a href="<?php the_permalink(); ?>" class="project-mask-link"></a>
					<?php if( get_option( THEME_SHORTNAME . '_show_the_view_and_like' ) !== '0' ){ ?>
					<span class="list-meta view"></span>
					<span class="list-meta like"></span>
					<span class="list-meta comment"></span>
					<?php } ?>
				</div>
				<div class="project-title">
					<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
				</div>
			</div>
				<div class="sideBase">
					<?php if( get_option( THEME_SHORTNAME . '_show_the_view_and_like' ) !== '0' ){ ?>
					<span class="list-meta-value view"><?php echo $num_view;?></span>
					<span class="list-meta-value like"><?php echo $num_likes; ?></span>
					<span class="list-meta-value comment"><?php echo $num_comments; ?></span>
					<?php } ?>
				</div>
			</figure>
		</div>
	<?php } ?>
	</li>

<?php
	}

	endwhile;
?>
		</ul>
	</div>

</div><!-- #full-slides -->
<?php
		endif; wp_reset_query(); //reset
	
	} else {
		
		print '<!-- Fail - Error : Slide fail to generated, no posts found! -->';
	
	}

}