Last active
September 29, 2016 05:18
-
-
Save misterebs/5c1a569632ee5b8193d1dc619821a8d4 to your computer and use it in GitHub Desktop.
Create blog page template
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 | |
/* | |
Template Name: Blog | |
*/ | |
?> | |
<?php get_header(); ?> | |
<article> | |
<?php // Display blog posts on any page @ http://m0n.co/l | |
$temp = $wp_query; $wp_query= null; | |
$wp_query = new WP_Query(); $wp_query->query('showposts=10' . '&paged='.$paged); | |
while ($wp_query->have_posts()) : $wp_query->the_post(); ?> | |
<h2><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h2> | |
<?php the_excerpt(); ?> | |
<?php endwhile; ?> | |
<?php if ($paged > 1) { ?> | |
<?php } else { ?> | |
<?php } ?> | |
<?php wp_reset_postdata(); ?> | |
</article> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment