If you intresting in sport buy steroids online you find place where you can find information about steroids

how to show/list post out of wordpress

Add comments

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

Related Benz News

Personal May 14th 2009

One Response to “how to show/list post out of wordpress”

  1. KeHoeff Says:

    hey this is a very interesting article!

Leave a Reply