Created
August 5, 2014 14:44
-
-
Save scottwyden/fc8496b68cabf1884dd5 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
For CSS | |
.attachment-thumbnail { | |
float: left; | |
padding: 10px; | |
} | |
For functions.php | |
// Add thumbnail to excerpt | |
add_filter( 'the_excerpt', 'excerpt_thumbnail' ); | |
function excerpt_thumbnail( $excerpt ){ | |
if( is_single() ) return $excerpt; | |
global $post; | |
if ( has_post_thumbnail() ) { | |
$img .= '<a href="'.get_permalink($post->ID).'">'.get_the_post_thumbnail($post->ID, 'thumbnail').'</a>'; | |
} else { | |
$img = ''; | |
} | |
return $img.$excerpt; | |
} | |
Change in index.php | |
<?php /* The entry content */ ?> | |
<div class="entry-content"> | |
<?php the_content( __( 'Continue reading <span class="meta-nav">»</span>', 'photocrati-framework' ) ); ?> | |
<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'photocrati-framework' ) . '&after=</div>') ?> | |
</div><!-- .entry-content --> | |
to | |
<?php /* The entry content */ ?> | |
<div class="entry-content"> | |
<?php the_excerpt( __( 'Continue reading <span class="meta-nav">»</span>', 'photocrati-framework' ) ); ?> | |
<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'photocrati-framework' ) . '&after=</div>') ?> | |
</div><!-- .entry-content --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment