So i'm building a site with multiple blogs, and I have two divs on the homepage, one that pulls the latest entries from each blog. (the blogs are installed within two separate directories). The problem is, I'm somehow pulling entries from only one blog into both divs.
I have a separate php file for both sections (I'm sure the code isn't ideal, but I'm still somewhat of a beginner)
File one (recent_entries.php)
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./blog/wp-blog-header.php');
?>
<a href="blog/"><h2 class="blue" style="padding-left: 20px;">Blog</h2></a>
<p style="padding-bottom:0px;">
<div id="entries">
<?php query_posts('showposts=5'); ?>
<?php
while (have_posts()) : the_post(); $post_counter++;
?>
<?php if($post_counter == 2) echo('<div id="color">');?>
<?php if($post_counter == 4) echo('<div id="color">');?>
<h3 <?php if($post_counter == 1) echo('style="padding:0px; padding-left:7px; border-style: none;"');?>>
<?php the_date('m.d'); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
</h3>
<?php if($post_counter == 2) echo('</div>');?>
<?php if($post_counter == 4) echo('</div>');?>
<?php if($post_counter == 1) the_excerpt();?>
<?php endwhile;?>
<p span style="float:right"><a href="#">blog archive...</a> </p>
</div>
and file 2, which is essentially the same (recent_news.php)
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./news/wp-blog-header.php');
?>
<a href="news/"><h2 class="grey" style="padding-left: 20px;">News & Events</h2></a>
<p style="padding-bottom:0px;">
<div id="entries">
<?php query_posts('showposts=4'); ?>
<?php
while (have_posts()) : the_post(); $post_counter++;
?>
<?php if($post_counter == 2) echo('<div id="color2">');?>
<?php if($post_counter == 4) echo('<div id="color2">');?>
<h3 <?php if($post_counter == 1) echo('style="padding:0px; padding-left:7px; border-style: none;"');?>>
<?php the_date('m.d'); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
</h3>
<?php if($post_counter == 2) echo('</div>');?>
<?php if($post_counter == 4) echo('</div>');?>
<?php if($post_counter == 1) the_excerpt();?>
<?php endwhile;?>
<p span style="float:right"><a href="#">news archive...</a> </p>
</div>
So I have those, and I call to them using
<?php
$news='recent_news.php';
if(file_exists($news) && is_readable($news)) {
include($news);
}
?>
and
<?php
$recent='recent_entries.php';
if(file_exists($recent) && is_readable($recent)) {
include($recent);
}
?>
I'm sure there must be something simple I'm missing, but I can't figure it out! Any help would be much appreciated!