I’m so excited, finally I fix it.
I must make a record.
Below is the code to access the database.
<?php
$how_many=6; //how many posts to display
require(’../../blog/wp-config.php’); //the path to the wp-config file of the blog I want to use
$news=$wpdb->get_results(”SELECT ‘ID’,'post_title’,'post_content’ FROM $wpdb->posts
WHERE ‘post_type’=”post” AND ‘post_status’=”publish” ORDER BY post_date DESC LIMIT $how_many”);foreach($news as $np){
printf (”<div class=’normalText’> %s </div>”, $np->post_content);
}?>
And the database is ok now
Then you should have the code to get the links and title of the post.
<ul>
<?php
global $post;
$myposts = get_posts(’numberposts=6&offset=1&category=1′);
foreach($myposts as $post) :
?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
You can get the code from the source of the Appearane, depend on you. above is the code to get the category list which id is 1.
You can also get some code from http://codex.wordpress.org/Template_Tags/get_posts
I like wordpress

May 28th, 2009 at 3:54 pm
hey this is a very interesting article!