WordPress.org

Forums

Diamond MultiSite Widgets
[Plugin: Diamond MultiSite] It only shows the FIRST post?! (5 posts)

  1. Devotion
    Member
    Posted 4 years ago #

    I just installed Diamond MultiSite Widgets for our WordPress MU Network and I'm using the Recent Posts Widget.

    But: It only displays the very FIRST post of each blog instead of displaying the latest post. How is that even possible?

    Anyone? o_O

  2. Devotion
    Member
    Posted 4 years ago #

    I've changed the file permissions, too - no difference.

  3. dains
    Member
    Posted 4 years ago #

    You wouldn't believe it, but that's EXACTLY the functionality I'm looking for! If you've managed to troubleshoot it by now, can you post some details so I can replicate that behavior?

  4. andrewmowder
    Member
    Posted 3 years ago #

    I had this same problem. I just figured out that if, under:

    Maximum post per blog (0 for unlimited):

    If you select '0' it displays the most recent.

    If, however you select 1, 2, etc. it displays the first post from each blog. This really goofs me up, because I need the most recent posts (1 only) from each of l0 selected blogs.

    Anyone have any ideas, or is this just a bug?

  5. blazeblz
    Member
    Posted 3 years ago #

    There is solution, just add ORDER BY post_date_gmt desc to mysql queries:

    120                 $blog_list = get_blog_list( 0, 'all' );
    121                 if (($white == 0 && !in_array(1, $wgt_miss)) || ($white == 1 && in_array(1, $wgt_white))) {
    122                         $sqlstr = "(SELECT 1 as blog_id, id, post_date_gmt from ".$table_prefix ."posts where post_status = 'publish' and post_type = 'post' and post_title <> '".__('Hello world!')."' ORDER BY post_date_gmt desc ".$limitstr.")";
    123                 }
    124                 $uni = '';
    125
    126                 foreach ($blog_list AS $blog) {
    127                         if (($white == 0 && !in_array($blog['blog_id'], $wgt_miss) && $blog['blog_id'] != 1) ||
    128                         ($white == 1 && $blog['blog_id'] != 1 && in_array($blog['blog_id'], $wgt_white))) {
    129                                 if ($sqlstr != '')
    130                                         $uni = ' union ';;
    131                                 $sqlstr .= $uni . " (SELECT ".$blog['blog_id']." as blog_id, id, post_date_gmt from ".$table_prefix .$blog['blog_id']."_posts  where post_status = 'publish' and post_type = 'post' and post_title <> '".__('Hello world!')."' ORDER BY post_date_gmt desc ".$limitstr.")";
    132                         }
    133                 }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Diamond MultiSite Widgets
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic