Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if( is_home() || is_front_page() ) : ?>
- <div style="display: block; position: relative; width:100%, height: auto; margin: 10px auto; text-align:center;">
- <?php
- global $post;
- $tmp_post = $post;
- $args = array( 'numberposts' => 15 ); //Change the count for the theme
- $myposts = get_posts( $args );
- foreach( $myposts as $post ) : ?>
- <?php if( has_post_thumbnail( $post->ID ) ) : ?>
- <?php $link = get_permalink( $post->ID ); ?>
- <div style="float: left; display:inline; margin: 0 3px;" onclick="location.href='<?php echo $link; ?>'">
- <?php /* Change the array(width,height) values to match the theme */ ?>
- <?php echo get_the_post_thumbnail($post->ID, array(50,50) , 'thumbnail'); ?>
- </div>
- <?php endif; ?>
- <?php endforeach; ?>
- <?php $post = $tmp_post; ?>
- </div>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement