Created
June 13, 2017 08:38
-
-
Save dn7734/32923b1bfe7b4077848c2e1a5a981579 to your computer and use it in GitHub Desktop.
The template for displaying archive photogallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying archive pages. | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
*/ | |
get_header(); ?> | |
<div class="content"> | |
<div class="fotogallery-row row"> | |
<?php | |
$current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$params = array( | |
'posts_per_page' => 10, // количество постов на странице | |
'post_type' => 'photogallery', // тип постов | |
'paged' => $current_page // текущая страница | |
); | |
query_posts($params); | |
while(have_posts()): the_post(); ?> | |
<div class="col-lg-3 col-md-4 col-sm-6"> | |
<a href="<?php the_permalink(); ?>" data-animation="fadeinup"> | |
<?php if ( has_post_thumbnail()) { ?> | |
<?php the_post_thumbnail('category-thumb', array( 'class' => 'img-responsive' )); ?> | |
<?php } ?> | |
<h4 class="gallerybox-title"><?php the_title(); ?></h4> | |
</a> | |
</div> | |
<?php endwhile; ?> | |
<?php if (function_exists("wp_bs_pagination")) { | |
wp_bs_pagination(); | |
} ?> | |
</div> | |
</div> | |
<?php | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment