forked from ColorlibHQ/unapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-portfolio.php
executable file
·83 lines (81 loc) · 3.47 KB
/
archive-portfolio.php
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
<?php
// Don't allow directly access this file.
if( !defined( 'ABSPATH' ) ) exit();
/**
* Template Name: Portfolio
*/
get_header(); ?>
<?php unapp_page_header(); ?>
<div class="colorlib-work">
<div class="container">
<div class="row">
<?php
$arg = array(
'post_type' => 'portfolio',
);
$counter = 0;
$portfolio_query = new WP_Query( $arg );
while ( $portfolio_query->have_posts() ) :
$portfolio_query->the_post();
$counter ++;
if( $counter % 2 == 0 ):
?>
<div class="col-md-12">
<div class="work-flex">
<div class="half animate-box">
<div class="row no-gutters">
<div class="col-md-12 no-gutters">
<a href="<?php the_permalink(); ?>" class="work-img">
<?php the_post_thumbnail( 'unapp-portfolio-big' ); ?>
</a>
</div>
</div>
</div>
<div class="half animate-box">
<div class="row no-gutters">
<div class="col-md-12 no-gutters">
<div class="display-t desc">
<div class="display-tc">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php echo wp_trim_words( get_the_content(), 18, '...' ); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php else: ?>
<div class="col-md-12">
<div class="work-flex">
<div class="half animate-box">
<div class="row no-gutters">
<div class="col-md-12 col-md-push-12 no-gutters">
<a href="<?php the_permalink(); ?>" class="work-img">
<?php the_post_thumbnail( 'unapp-portfolio-big' ); ?>
</a>
</div>
</div>
</div>
<div class="half animate-box">
<div class="row no-gutters">
<div class="col-md-12 col-md-pull-12 no-gutters">
<div class="display-t desc">
<div class="display-tc">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php echo wp_trim_words( get_the_content(), 18, '...' ); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
endif;
endwhile;
?>
</div>
</div>
</div>
<?php get_footer(); ?>