I've client that built an internet site that's part static html and part Wordpress. The Wordpress is just for that blog as the static pages are for that relaxation from the websites content, such as the webpage.

This same client want to have the ability to "pull" recent blogs and comment counts in the blog and publish them around the webpage.

I'm not acquainted with Wordpress, and so i am writing this question to discover if this sounds like even possible. If it's, I'll naturally need to know "how?" but this is to buy the ball moving.

Any constructive feedback is welcome. Thanks!

Sure you are able to fetch anything you want in the wordpress database. There's a table posts with the posts inside it. Just connect through it as if you would every other database and query away!

If you are on the remote server, you could utilize WordPress's built-in RSS or XMLRPC connects.

If you are on a single server, this snippet is examined against Wordpress 2.7 and can most likely operate in 3. too


    $number = 5;
    $wordpress_header = "/path/to/wordpress/wp-blog-header.php";

          // Include wordpress header   
          if (file_exists($wordpress_header))
             include ($wordpress_header);

            $myposts = get_posts('numberposts=$number&offset=0&category=0');

            echo "<ul class='Bloglinks'>";

            foreach(array_slice($myposts, 0, $number) as $post) 
                echo '<li><a href="';
                echo '">';
                echo " ";
                echo '</a></li>';

             echo "</ul>";

             echo "Unable to connect to Wordpress header file.";