Considering you’re only grabbing the permalink for each entry it might be easier to do it a little differently….
Try this instead, same procedure, just update the file with this code instead…
<?php
/*
Template Name: List post links
*/
$postID = $wpdb->get_col("
SELECT ID FROM $wpdb->posts
WHERE (post_type = 'post')
AND (post_status = 'publish')
AND (post_password = '')
");
foreach($postID as $post_link) {
?>
<a href="<?php echo get_permalink($post_link); ?>"><?php echo get_the_title($post_link);?></a><br />
<?php
}
?>
Be sure to remember when creating the (“Page” via admin) to select the template from the right.
You can place the links into a list if you like… slight change to the above…
<?php
/*
Template Name: List post links
*/
$postID = $wpdb->get_col("
SELECT ID FROM $wpdb->posts
WHERE (post_type = 'post')
AND (post_status = 'publish')
AND (post_password = '')
");
echo '<ul id="post_links">';
foreach($postID as $post_link) {
?>
<li><a href="<?php echo get_permalink($post_link); ?>"><?php echo get_the_title($post_link);?></a></li>
<?php
}
echo '</ul>';
?>
You can them style them in your CSS with the following…
Example:
#postlinks {
width:auto;
list-style:inside none;
}
#post_links li {
margin:0;
padding:4px 10px;
}
#post_links li a:link,
#post_links li a:visited {
text-decoration:none;
color:black;
font-weight:bold;
font-size:1.0em;
}
#post_links li a:hover,
#post_links li a:active {
color:red;
}