I use multisite and am trying to query my data base to get content from one site to display on another. Autoblog doesn't really suit my purposes for what I'm trying to do, so I tried adding something like
<?php /* Template Name: Qbased */ ?> <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php global $wpdb; $querystr =" SELECT * FROM $wpdb->wp_3_posts WHERE post_type='post' "; $pageposts = $wpdb->get_results($querystr, OBJECT); ?> <?php if ($pageposts): ?> <?php global $post; ?> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post); ?> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?>asdf </div> </div> <?php endforeach; ?> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
This is a modification of what I found here.
All I'm getting is the content from the else statement. Can someone tell me what I'm doing wrong please.