Getting Post Meta Data on a Custom Query Across All Blogs
-
I am querying all my posts across all my blogs (works) and filtering them by events (works). Now I am trying to show the associated meta data which each post but it’s not working. I’m guessing that this might have something to do with the fact I am querying across all blogs.
Can anyone help?
This is the line that is not echoing anything
<?php echo get_post_meta($postdetail->ID, “_EventStartDate”, $single = true); ?><?php $blog_list = get_blog_list( 0, 'all' ); foreach ($blog_list AS $blog){ $domain = $wpdb->get_var( "SELECT domain FROM {$wpdb->blogs} WHERE blog_id=".$blog['blog_id']); $posts = $wpdb->get_col( "SELECT ID FROM wp_".$blog['blog_id']."_posts WHERE post_type = 'sp_events'"); foreach($posts as $p) { $postdetail=get_blog_post($blog['blog_id'],$p); ?> <a href="<?php echo $postdetail->guid;?>"><?php echo $postdetail->post_title;?></a>; <?php echo $postdetail->ID ?> <?php echo get_post_meta($postdetail->ID, "_EventStartDate", $single = true); ?> <?php // This Line Echos Nothing ?> <br /> <?php }} ?>
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Getting Post Meta Data on a Custom Query Across All Blogs’ is closed to new replies.