Last active
August 29, 2015 13:56
-
-
Save zulfnore/9036874 to your computer and use it in GitHub Desktop.
Anew content.php with featured image in blog feed
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 $format = get_post_format(); ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class('group'); ?>> | |
<h2 class="post-title pad"> | |
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> | |
</h2><!--/.post-title--> | |
<ul class="post-meta pad group"> | |
<li><?php the_category(' / '); ?></li> | |
<li><i class="fa fa-clock-o"></i><?php the_time('j M, Y'); ?></li> | |
<?php if ( comments_open() ): ?><li><a href="<?php comments_link(); ?>"><i class="fa fa-comment"></i><?php comments_number( '0', '1', '%' ); ?></a></li><?php endif; ?> | |
</ul><!--/.post-meta--> | |
<div class="post-inner"> | |
<?php if ( has_post_format() ){ // Anew supported post formats ?> | |
<?php get_template_part('inc/post-formats'); ?> | |
<?php } | |
elseif ( has_post_thumbnail() ) { //Workaround support for Standard post format ?> | |
<div class="image-container"> | |
<?php if ( has_post_thumbnail() ) { | |
the_post_thumbnail('thumb-large'); | |
$caption = get_post(get_post_thumbnail_id())->post_excerpt; | |
if ( isset($caption) && $caption ) echo '<div class="image-caption">'.$caption.'</div>'; | |
} ?> | |
</div> | |
<?php } ?> | |
<div class="post-deco"> | |
<div class="hex hex-small"> | |
<div class="hex-inner"><i class="fa"></i></div> | |
<?php if ( $format != false ) :?><a href="<?php echo get_post_format_link($format); ?>"></a><?php endif; ?> | |
<div class="corner-1"></div> | |
<div class="corner-2"></div> | |
</div> | |
</div><!--/.post-deco--> | |
<div class="post-content pad"> | |
<div class="entry"> | |
<?php | |
if ( ot_get_option('post-text') == 'content' ) { the_content(); } | |
else the_excerpt(); | |
?> | |
</div><!--/.entry--> | |
<a class="more-link-custom" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><span><i><?php _e('More','anew'); ?></i></span></a> | |
</div><!--/.post-content--> | |
</div><!--/.post-inner--> | |
</article><!--/.post--> |
hello, could you please tell me how to make this changes in my anew theme?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably not the best way to achieve this but it works :)