I’m SOOO Close – PLEASE HELP
-
This might get confusing, but bear with me:
I wanted a headlines list on my homepage (static, HTML)
I found the php code for a Mini-loop.
Now obviously I can’t put php into my html homepage, so I got a little creative-
I made a page with the loop in it, saved as php, and <IFRAMED> the new page into the homepage.This works great, but with 2 exceptions:
1) the list of headlines is justified as “center” and needs to be”left”
2) (and most importantly) The links open in the IFRAME and need to open in a new window (i.e. – target=”_new”)Here is the php for the loop so far:
<td>
<?php define(‘WP_USE_THEMES’, false);
require(‘./wordpress/wp-blog-header.php’);
?>
<div id=”content” class=”narrowcolumn”><h2>Lastest Posts:</h2>
<?php
# Here starts Mini Loop trick: You can use this code, but _at your own risk_
# If you want to improve this code, you’re welcome ??$how_many=7; //How many posts do you want to show ?>
<ul class=”whats-new”>
<?
$news=$wpdb->get_results(“SELECT ID,post_title FROM $wpdb->posts
WHERE post_status = \”publish\” ORDER BY ID DESC LIMIT “.$how_many);
foreach($news as $np){
printf (”- %s
“, $np->ID,$np->post_title);
}?></div>
</td>
——————————–
I don’t understand php (yet) so I really need your help
Thanks
Seth
- The topic ‘I’m SOOO Close – PLEASE HELP’ is closed to new replies.