Static Page Help
-
I am trying to create a static page with 3 things; some text, the 5 latest posts of my blog w/ time and date, and 5 latest updated galleries.
I’ve read the WordPress tutorial on creating static pages and I’m using the code it gives me (listed below). And it works fine if you just want the title. But I would like to have the time of the post either next to the title or underneath the title. I keep trying to use “get_time” and it just won’t work. Any suggestions?
Example of the site: here
ID
<?php
$how_many=5; //How many posts do you want to show
require_once("wp-config.php"); // Change this for your path to wp-config.php file ?>
<ol id="whats-new">
<?
$news=$wpdb->get_results("SELECT,
post_titleFROM $wpdb->posts
post_status
WHERE= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
foreach($news as $np){
print ("<li><a href=\"");
echo get_permalink($np->ID);
print ("\">$np->post_title</a></li>");
} ?>
</ol>
- The topic ‘Static Page Help’ is closed to new replies.