Created
February 27, 2010 06:52
-
-
Save randyjhunt/316528 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
<?php | |
/* | |
Template Name: List post links | |
*/ | |
$querystr = " | |
SELECT p.* from $wpdb->posts p | |
WHERE p.post_status = 'publish' | |
ORDER BY p.post_date DESC | |
"; | |
$allPosts = $wpdb->get_results($querystr, OBJECT); | |
?> | |
<ul> | |
<?php foreach ($allPosts as $post): ?> | |
<li style="margin-bottom:18px"> | |
<?php echo $post->post_date; ?> — <?php echo $post->post_name; ?><br/> | |
<a href="<?php bloginfo('url'); ?>/<?php echo $post->post_name; ?>"><?php bloginfo('url'); ?>/<?php echo $post->post_name; ?></a><br/> | |
</li> | |
<?php endforeach; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment