Created
February 21, 2013 15:22
-
-
Save victor-falcon/5005423 to your computer and use it in GitHub Desktop.
Custom Query to get latest blog post on Wordpress
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 | |
query_posts('showposts=1'); | |
// set $more to 0 in order to only get the first part of the post | |
global $more; | |
$more = 0; | |
// the Loop | |
while (have_posts()) : the_post(); ?> | |
<h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'toolbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4> | |
<?php the_excerpt(); ?> | |
<?php | |
endwhile; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment