I am using a theme network wide called Esplande. I need help ingrating networked content with it -

I am beginning a multi-site network ... you can read all about my mission at todaysvisions.com.

Anyway, you will see a slider on top. This slider is controlled with sticky posts. I would like to be able to show sticky post from certain networked sites - my curators - in this slider.

Can you help me find a solution?

Thanks

  • Vaughan
    • Support/SLS MockingJay

    Hi @arizona,

    You would most likely need to custom code the theme so that it fetches sticky posts from your network sites. That could be tricky in some ways depending on how many blogs you want to fetch from.

    So inside your loop you'd need to switch to the blog id each time using switch_to_blog() see http://codex.wordpress.org/WPMU_Functions/switch_to_blog

    You would most likely require a developer to do this though. Let me just ask one of our developers to see if this could be done without too much work, but if it would be quite complex, you would need to hire a developer to do the changes for you. We do have a jobs board here, if you need to advertise. https://premium.wpmudev.org/wordpress-development/

    Hope this helps

  • Arizona Lowe
    • Site Builder, Child of Zeus

    I read the post and understand the code. I think I can bandaid a quick fix for now - not having too many curators - but I want it to loop based on the pro-site level curator. When I get ten - I will let the system coast for a year and organically grow. Then next September or October I will open that category for another 10 curators.

  • Jose
    • Bruno Diaz

    Hi there @Arizona,

    As @Vaughan said above, this would require a good amount of custom coding. So, it's beyond of our scope.

    Nevertheless, I can provide you some guidance on the approach I would take for this:

    - First, Install Post Indexer plugin on your network. This plugin doesn't provide any visible feature, it just run in the background indexing all your network posts and putting all together and ready to be queried.

    - Create a custom code to get all the sites with level 'curator'.

    - Create a custom routine to get all the posts marked as sticky and related to the blog ids obtained in the previous step.

    Hope this helps.
    Please let me know if you have specific questions when developing the customization.

    Cheers,
    Jose

  • Arizona Lowe
    • Site Builder, Child of Zeus

    Okay, here was my final solution to this ...

    I created a script call slider-today.php. Here is what is within that script:

    <?php
    
    // if( false === ( $blogs = get_transient( 'saved_blogs_query' ) ) ) { 		
    
            global $wpdb;
    
            $table = $wpdb->prefix . 'blogs';
    
            $table2 = $wpdb->prefix . 'pro_sites';
    
          // $blogs = $wpdb->get_results(("SELECT * FROM $table WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'"));
    
         //  $blogs = $wpdb->get_results("SELECT * FROM $table WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1' and blog_id IN(10,11,12,13)");
    
             $blogs = $wpdb->get_results("SELECT *FROM tv_blogs LEFT JOIN tv_pro_sites ON tv_blogs.blog_id = tv_pro_sites.blog_ID
    
    WHERE tv_pro_sites.level = '5'");
    
     //   set_transient( 'saved_blogs_query', $blogs, 60*60*4 );  
    
    // } 
    
            if(!empty($blogs)){  ?>
    
      <section id="slider">
    
    			<ul class="slides">
    
                <?php
    
                foreach($blogs as $blog){
    
                switch_to_blog($blog->blog_id);
    
                $details = get_blog_details($blog->blog_id);
    
    			              $args1 = array(
    
    	'posts_per_page' => 1,
    	'orderby' => 'post_date',
        'post_status'      => 'publish',
    	'post__in'  => get_option( 'sticky_posts' ),
    	'ignore_sticky_posts' => 1,
    
    );
    
     $slider = new WP_Query( $args1 );
    
            //$slider = @array_slice($slider,0,$sorting_limit,true);
    
    	?>
    
    				<?php while( $slider->have_posts() ) : $slider->the_post(); ?>
    
    <li>
    						<article <?php post_class(); ?>>
    
    							<div class="entry-container">
    
    								<header class="entry-header">
    
    									<h2 class="entry-title"><a>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    									<aside class="entry-meta">
    
    										<?php the_time( get_option( 'date_format' ) ); ?> | 
    
    										<?php _e( 'Filed under', 'esplanade' ); ?>: <?php the_category( ', ' ) ?>
    
    										<?php edit_post_link( __( 'Edit', 'esplanade' ), ' | ', '' ); ?>
    
    									</aside><!-- .entry-meta -->
    
    								</header><!-- .entry-header -->
    
    								<div class="entry-summary">
    
    									<?php if( has_post_format( 'audio' ) ) : ?>
    
    										<?php esplanade_post_audio(); ?>
    
    									<?php endif; ?>
    
    									<?php the_excerpt(); ?>
    
    								</div><!-- .entry-summary -->
    
    								<div class="clear"></div>
    
    							</div><!-- .entry-container -->
    
    							<?php if( has_post_format( 'video' ) ) : ?>
    
    								<?php esplanade_post_video(); ?>
    
    							<?php elseif( has_post_thumbnail() ) : ?>
    
    								<a>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    
    									<?php the_post_thumbnail( 'slider-thumb' ); ?>
    
    								</a>
    
    							<?php endif; ?>
    
    							<div class="clear"></div>
    
    						</article><!-- .post -->
    
    </li>
    				<?php endwhile; ?>
    
    	<?php    wp_reset_query();
    
                    restore_current_blog();
    
      }   ?>
    
    			<div class="clear"></div>
    
    		</section><!-- #slider -->
    
                 <?php //wp_reset_postdata(); ?> 
    
            <?php }
    
        ?>

    This somewhat does what I want. Here are the issues

    1. I would prefer that the articles appear in date order rather than in BLOG_ID order.
    2. I would like to add the Blog title blow the excerpt to give each site more recognition.
    3. The rest of the front page is a blooming mess. For now I am going to create a page to go under the slider. But I would like to show more articles on the front page if I ever clean the mess.

    Any advice, thoughts or suggestions by anyone would be greatly appreciated. You can view this in action at http://todaysvisions.com

  • Vinod Dalvi
    • WP Unicorn

    Hi @Arizona,

    1. I would prefer that the articles appear in date order rather than in BLOG_ID order.

    So now the articles are displayed order by post date from each blog in the ascending order of blog ID.

    Do you want to display all articles from all all blogs ordered by post date regardless in which blog it is created?

    2. I would like to add the Blog title blow the excerpt to give each site more recognition.

    To add the Blog title below the excerpt you have to use the following code below the the_excerpt function code which use get_bloginfo function.

    <?php echo 'The Blog Title is: ' . get_bloginfo ( 'name' ); ?><br />

    3. The rest of the front page is a blooming mess. For now I am going to create a page to go under the slider. But I would like to show more articles on the front page if I ever clean the mess.

    Could you please describe it a bit more in detail so that we can help you?

    I have plans to make the first query a transition so it does not query the database every time the page loads

    You can try using WordPress caching or WordPress Transients as described on the following pages to achieve it.

    http://codex.wordpress.org/Class_Reference/WP_Object_Cache
    http://codex.wordpress.org/Transients_API

    Regards,
    Vinod Dalvi

  • Arizona Lowe
    • Site Builder, Child of Zeus

    1. I want to display the latest ten article from the CURATORs in date order. I have a way to separate the curators from the other blogs (see script above) but it only allows me to pull x number of articles per blog (where x is defined in the script). Currently I have it pulling 1 article per curator blog.

    2. Used your suggestion. Added a link and it is perfect! Thank you.

    3. What I originally pictured here were columns of article titles separated per blog (curators again). Right now, I do believe I just need to design a page to better advertise the community and have it display under the slider. It would be cool to have a page of post names separated by blog, but that can be put on the back burner for now. I have too many other issues to worry about (like getting membership and pro-sites talking to one another :smiley: )

    I would really appreciate any suggestions you could offer up for number 1. Thank for all your help. ~AZ

  • Vinod Dalvi
    • WP Unicorn

    Hi @Arizona,

    1. I want to display the latest ten article from the CURATORs in date order. I have a way to separate the curators from the other blogs (see script above) but it only allows me to pull x number of articles per blog (where x is defined in the script). Currently I have it pulling 1 article per curator blog.

    Do you want to display the latest ten article from the CURATOR blog and not any other article from other blogs or different/same number of articles from other blogs or anything else?

    Please answer my questions specifically.

    Regards,
    Vinod Dalvi

  • Arizona Lowe
    • Site Builder, Child of Zeus

    Sorry it has taken me so long to replay. I admit that I got frustrated - no strike that - angry with your reply as it indicated that you had not read the entire stream - the first necessity for trouble ticket answering. To be asked to answer a question SPECIFICALLY seemed downright rude when I am paying your company $99 per month for support THAT SHOULD INCLUDE READING THE STREAM.

    If you had read the stream you would know that the CURATORS are a pro-site level, not one particular blog. In fact I currently have 9 curator blogs and there could be countless more in the future.

    This stream got started again because I was trying to share a partial fix I had already come up with. If I find any further solutions to make this more what I am looking for, I will update here.

  • Timothy
    • Chief Pigeon

    Hey there.

    To be asked to answer a question SPECIFICALLY seemed downright rude when I am paying your company $99 per month for support THAT SHOULD INCLUDE READING THE STREAM.

    Apologies for any frustration caused here, I really just wanted to mention one thing though, Vinod isn't a native English speaker and it most certainly wasn't his intention to be rude or make you angry.

    Sure he could have worded that better, but the English language is a big one and for someone that isn't native to it, finding the right softer approach can be more of a challenge than we realise sometimes, I even get it wrong and it's my first language.

    The issue with written words and the World Wide Web is that things can easily be misconstrued, and I really believe this to be the case here. Vinod was simply attempting a request for clarification so that he can better understand and ensure it would only be curator blogs and no exceptions at all.

    Again please accept my apologies for any frustration or anger you might be feeling due to this misunderstanding.

    I've asked him to pop by this ticket again.

    Take care and have a great day.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Arizona,

    I am really sorry for any frustration caused but my intention was to just make it clear so that i can help you to achieve it.

    1. I want to display the latest ten article from the CURATORs in date order. I have a way to separate the curators from the other blogs (see script above) but it only allows me to pull x number of articles per blog (where x is defined in the script). Currently I have it pulling 1 article per curator blog.

    To display the latest ten article from the CURATORs in date order you can try using the following arguments as your WP_Query arguments in your code.

    $args1 = array(
    	'posts_per_page' => 10,
    	'ignore_sticky_posts' => 1
    );

    In the above code we have used ignore_sticky_posts to exclude sticky posts from the queried posts and used posts_per_page to display ten articles. The orderby argument in the above arguments list is defaults to 'date (post_date)' and order argument defaults to 'DESC' so we have not mentioned it.

    Best Regards,
    Vinod Dalvi

  • Arizona Lowe
    • Site Builder, Child of Zeus

    If you look at my code above what that will achieve is pulling 10 posts from each curator blog - that would be 90 posts! Not what I am looking for :smiley: Sorry.

    Hopefully I will be able to tackle the code in this again tomorrow ...

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.