/
page-portfolio.php
150 lines (82 loc) · 3.75 KB
/
page-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
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
<?php
/**
*
* Template Name: Port Video Template
*
**/
?>
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1><?php the_title(); ?></h1>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-12">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<h3>No Content Found ...</h3>
<?php endif; ?>
</div> <!-- ROW ONE -->
<div class="row">
<?php
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'portvideo',
'posts_per_page' => 3,
'paged' => $paged
);
$the_query = new WP_Query( $args );
// query_posts( $args );
?>
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<!-- <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 portfolio-item">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div> -->
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 portfolio-item">
<h2><?php the_title(); ?></h2>
<!-- <img class="img-responsive" src="http://lorempixel.com/300/200/nature/1"> -->
<?php if ( has_post_thumbnail() ) : ?>
<?php
$thumbnail_id = get_post_thumbnail_id();
$thumbnail_url = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail-size', true );
?>
<div class="">
<figure class="blog-index-img" >
<?php //the_post_thumbnail('medium', array( 'class' => "img-responsive")); ?>
<a href="<?php echo $thumbnail_url[0] ?>" rel="lightbox-0"><p><img class="img-responsive" src="<?php echo $thumbnail_url[0] ?>"></p></a>
</figure>
</div>
<?php endif; ?>
<!-- <p> commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui ... </p> -->
<p><a class="btn btn-danger" href="<?php the_permalink(); ?>" role="button">View details »</a></p>
</div>
<!-- CREATING NEW ROW FOR BOOTSTRAP -->
<?php $portvideo_count = $the_query->current_post + 1; ?>
<?php if ( $portvideo_count % 3 == 0) : ?>
</div> <!-- FIRST ROW CLOSED -->
<div class="row">
<?php endif; ?>
<!-- CREATING NEW ROW FOR BOOTSTRAP ENDs -->
<?php endwhile; ?>
<section class="custom-post-nav row">
<nav class="text-center col-md-12">
<?php
bootstrap_pagination( $the_query->max_num_pages, 2 );
?>
</nav>
</section>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<h3>No Content Found ...</h3>
<?php endif; ?>
</div> <!-- ROW TWO -->
<hr>
<?php get_footer(); ?>