wordpress - pull same blog data into multiple sites

I have a wordpress blog currently installed at blog.mydomain.com. I am creating a mobile version of my site at m.mydomain.com which will have a blog section. Obviously I want to use the same database and just pull in all the blog posts and display them with CSS customized for the mobile site. How can I accomplish this?

EDIT: Here is the code I'm trying to insert the blog posts into:

<div class="blog">
    <div class="section-header">
        <img class="section-logo" src="images/logo-small.png" alt="img">
        <a href="#" class="section-navigation-deploy"><img class="navigation-deploy-icon" src="images/nav-icon.png" alt="img"></a>
        <div class="clear"></div>
   </div>
   <div class="deco-open"></div>

   <?php
require('http://blog.mydomain.com/wp-blog-header.php');
$posts = get_posts('numberposts=-1&order=DSC&orderby=date');
?>

   <?php foreach ($posts as $post) : start_wp(); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<section><?php the_excerpt(); ?></section>
<?php endforeach; ?>


    <div class="deco-close"></div>


</div>

Answers


<?php
  require('./blog/wp-blog-header.php');
  $posts = get_posts('numberposts=-1&order=DSC&orderby=date');
?>

The require should point to the wp-blog-header.php file in the root of your blog directory.

This is the code I am currently using in wwwroot/index.php and my blog is in wwwroot/blog Once I get $posts I'll display the contents with:

<?php foreach ($posts as $post) : start_wp(); ?>
  <article>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <section><?php the_excerpt(); ?></section>
  </article>
<?php endforeach; ?>

Need Your Help

Copy data from one part of a userform to another automatically

excel vba excel-vba userform

I am trying to work with an Excel form using VBA that I have customized (I found the original on the web).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.