WordPress.org

Ready to get started?Download WordPress

Forums

Blog posts to main site from network (2 posts)

  1. jamesg40
    Member
    Posted 1 year ago #

    I know this question has been asked a thousand times and I have read pretty much everything on it and still can not find a suitable answer. It really seems that this is not possible without being a php expert and writing my code but I thought that I would take a chance anyways and see if anyone has come up with something that actually works the way I need it too.

    I all ready have MU installed and working fine.

    What I am trying to do is set-up my site ( http://www.kazler.com/community ) "which is basically installed in a php site that I built ( http://www.kazler.com ")so that I have a Kazler news page that will only display my posts, which I all ready have and its working fine.

    I have a Agent Blogs page that will need to display all of the newest posts from different network sites. So for instance, if an agent (real estate agent that wants to blog on my site) comes along and registers for a site and begins posting blog posts, they show up on this page along with all of the other agents posts as well but will exclude all of mine.
    I have tried sitewide tags but it does not seem to allow me to set it up this way and I have also tried this code below but it only displays links to post and blogs and images that anyone has uploaded and my post links and images as well.

    <?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 guid like '%".$domain."%'");
    foreach($posts as $p)
    {
    $postdetail=get_blog_post($blog['blog_id'],$p);
    ?>
    <a href="<?php echo $postdetail->guid;?>"><?php echo $postdetail->post_title;?></a>;
    
    <br />
    <?php
    }
    }
    ?>
    <span class="divider"></span>

    This snippet of code does work, but like I said, it only displays the links and it displays that links to everything, including pages, posts, any uploaded images and tags and cats ect, ect, ect, lol. Anyways, I am hoping that the code above could be modified so that when I put it into one of my custom page templates that it will display only posts from the network sites and not mine and so that it only displays the users actual posts and not the links to their image uploads, pages, and everything else in the world. And I am hoping that it could display the posts just like sitewide tags does, basically the same design and layout of my main sites posts.
    So, has anyone found "The Solution" to this? If so, I could certainly use some guidance here.

    [No bumping. If it's that urgent, consider hiring someone.]

  2. Generally if you want to 'collect' all posts on a site, you use this: http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/

    If you want to 'broadcast' all posts to another site, you use this: http://wordpress.org/extend/plugins/threewp-broadcast/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.