• So I have a wordpress install at starthealthyfoods.com/blog and one at starthealthyfoods.com/wpdev (these are still in development, so if you look, dont judge! theyre not done!)

    Anyway, I need to display the most recent 3 posts from the blog onto the homepage of the wpdev site…. Help me please!!!

Viewing 1 replies (of 1 total)
  • hattrik4

    (@hattrik4)

    I’m a new user to wordpress myself, but I just solved a similar issue using an iframe. iframe works in this instance because it points to a completely unique html/php file with its own headers. This means, for your particular case, you can include the header for your blog installation without conflict when it’s displayed on a wpdev wordpress page.

    Here are the steps to make this work.

    1. Create a unique php page (blog_widget.php) that points to the blog header and displays the content you want and save it in the wpdev directory. It will look something like this:

    <!DOCTYPE html>
    
    <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
    <!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
    <!--[if IE 7 ]>    <html class="ie7" lang="en"> <![endif]-->
    <!--[if IE 8 ]>    <html class="ie8" lang="en"> <![endif]-->
    <!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
    <head>
    	<meta charset="utf-8" />
    	<title></title>
    
    	<!-- Include Word Press Head Files  -->
    	<?php require('../blog/wp-blog-header.php'); ?>
    
    </head>
    <body>
    
    		<?php query_posts('showposts=3'); ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
    		<?php endwhile;?>	
    
    </body>
    </html>

    2. Then, on the page that you actually want to display the information, you load the php page you just created by using an iframe. For example:

    <iframe src="blog_widget.php" width="100%" scrolling="no">
    <a href="../blog" title="Alt link to Blog for non-iframe browsers">Blog</a>
    </iframe>

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Display loop from blog to different wordpress installation’ is closed to new replies.