Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array( 'numberposts' => 6, 'order' =>'DESC', 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
- //'order' above can be changed to 'ASC'
- Further improvement
- //wrapped the_title (below) in H3 tags
- $postslist = get_posts( $args );
- foreach ($postslist as $post) : setup_postdata($post); ?>
- <div class="events">
- <!-- The date will only be displayed once for posts posted on the same day use
- <?php echo get_the_date(); ?> to display on each post-->
- <div class="date"><?php the_date(); ?></div>
- <!--The title just displays the post title and not permalink -->
- <h3><?php the_title(); ?></h3>
- <!-- The content displays all the content in the blog post including any html and images.
- If you wish to display a snippet use <?php the_excerpt();?>, this removes all images and HTML
- You can also use the quick tag <!--more--><!-- in your blog posts to provide a cut off point
- and still use the_content();?>-->
- <?php the_content();?>
- <!-- the post thumbnail can be used to fetch a feature image, which can be set in post editor
- (bottom right) can be useful if you use excerpt above -->
- <?php the_post_thumbnail();?>
- <!-- If you want more control over the size of the feature image change the_post_thumbnail() to: -->
- <?php echo get_the_post_thumbnail($post->ID, 'full'); ?>
- <!-- The above will display the full size of the image. You can change this for medium or large too or
- specify a custom size below-->
- <?php echo get_the_post_thumbnail($post->ID, array(100,100), 'thumbnail');?>
- <!--Also make sure your theme supports thumbnails, add the following (if not already there) to
- functions.php-->
- <?php add_theme_support( 'post-thumbnails' );?>
- </div>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement