Created
January 16, 2016 20:02
-
-
Save KarasAlina/0bdf89a3ff40cb0d9988 to your computer and use it in GitHub Desktop.
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 get_header() ?> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="breadcrumbs"> | |
<?php if (is_home()) { ?> | |
<?php } elseif (is_page()) { ?> | |
<a href="<?php echo get_option('home'); ?>">Главная</a> > | |
<?php foreach((get_the_category()) as $cat) { | |
$cat=$cat->cat_ID; | |
echo(get_category_parents($cat, TRUE, ' > ')); } the_title(); ?> | |
<?php } ?> | |
</div> | |
</div> | |
</div> | |
<div class="text"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<h2> | |
<?php printf( __( 'Результаты поиска: %s', 'twentyten' ), '' . get_search_query() . '' ); // Динамический заголовок поиска?> | |
</h2> | |
</div> | |
</div> | |
<?php if ( have_posts() ): ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<div class="row"> | |
<div class="col-md-12"> | |
<h3 class="entry-header"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
<div class="date"><?php the_time('F j, Y'); // Дата создания поста ?></div> | |
<br> | |
<p><?php the_excerpt() ?></p> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<h3 class="err_search">No posts found. Try a different search?</h3> | |
<div class="alt_search"> | |
<?php include (TEMPLATEPATH . '/searchform.php'); ?> | |
</div> | |
<?php endif; ?> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="pagination"><?php // Пагинация | |
global $wp_query; | |
$big = 999999999; | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'type' => 'list', | |
'prev_text' => __('« Назад'), | |
'next_text' => __('Вперед »'), | |
'total' => $wp_query->max_num_pages | |
) ); | |
?> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php get_footer() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment