-
Notifications
You must be signed in to change notification settings - Fork 1
/
content-portfolio.php
61 lines (51 loc) · 1.79 KB
/
content-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
<?php
/**
* @package Great Plains Landscaping
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content gallery-content">
<?php the_content(); ?>
</div><!-- .entry-content -->
<?php
$args = array(
"post_status"=>"publish", // published posts, right?
"post_type"=>"image", // I'm not sure if its a custom post type or not.
"posts_per_page"=>100 // how many do you want to see?
);
$galleries = new WP_Query( $args ); // let's get that query object
// HERE IS YOUR LOOP
if ( $galleries->have_posts() ) {
?>
<div class="row gallery-group">
<h2>View some of our galleries!</h2>
<?php
while ( $galleries->have_posts() ) {
$galleries->the_post();
// This is the section that actually repeats.
?>
<div class="col-lg-2 col-md-4 col-sm-6 col-xs-6">
<div class="hovereffect">
<img class="img-responsive" src="<?php echo get_field("PUT YOUR IMAGE FIELD SLUG HERE");?>" alt="">
<div class="overlay">
<h2><?php echo get_field("PUT YOUR FIELD SLUG HERE");?>/h2>
<a class="info" href="<?php echo $permalink = get_permalink(get_the_id()); ?>">link here</a>
</div>
</div>
</div>
<?php
// OK we're done repeating here.
}
echo '</div>'; // close up that div at the top.
} else {
// No posts. We're all doomed!!!
}
// Reset that post data, dawg.
wp_reset_postdata();
?>
<footer class="entry-footer">
</footer><!-- .entry-footer -->
</article><!-- #post-## -->