Last active
August 29, 2015 14:16
-
-
Save iiiBird/2d80924d5ae56f2c8771 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 | |
<div class="news"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<div class="news-item is-post is-post-excerpt" <?php post_class(); ?> id="post-<?php the_ID(); ?>"> | |
<ul class="post-info"> | |
<li>Категория: <?php foreach((get_the_category()) as $category) { echo '<a href="'.get_category_link($category->cat_ID).'" title="'.$category->cat_name.'">'.$category->cat_name.'</a> '; } ?></li> | |
<li><?php comments_number(); ?></li> | |
<li><?php echo get_the_date('F j, Y'); ?></li> | |
</ul> | |
<div class="post-img"> | |
<?php if ( has_post_thumbnail()){ ?> | |
<?php the_post_thumbnail('lol-thumb');?> | |
<h2> | |
<?php }else{ ?> | |
<h2 class="noimg"> | |
<?php } ?> | |
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> | |
</h2> | |
</div> | |
<ul class="post-tags"> | |
<?php the_tags('<li>Теги:</li><li>','</li><li>','</li>'); ?> | |
</ul> | |
<div class="post-text"><?php the_excerpt() ?></div> | |
<a class="btn btn-default btn-sm read-more pull-right" href="<?php the_permalink(); ?>">Читать далее...</a> | |
</div> | |
<?php endwhile; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment