Diamond MultiSite Widgets
[resolved] Ignore broadcasted posts in recent posts widget (2 posts)

  1. archonic
    Posted 4 years ago #

    In my theme, I wanted to show root posts on the left with a typical loop and network posts on the right with the Diamond Recent Posts widget. I also wanted the ability to post to the root blog from network blogs but not have broadcasted posts show twice on the homepage.

    That means finding and removing all broadcasted posts (since they show up on the left anyways), then removing root posts (since, again, they're already on the left). To do this, I wrote a loop to remove posts which have a duplicate titles in the $post_list results, then remove posts belonging to blog_id 1.

    NOTE: for this to work, you must not exclude the root blog in the widget settings, otherwise it can't find duplicated post titles.

    Insert this on line 293 in diamond-recent-posts.php:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    Since this finds network posts by checking for duplicate titles, it will work regardless of how you broadcasted the post (via the Diamond widget plugin or ThreeWP Broadcast).


  2. archonic
    Posted 4 years ago #

    Fastest mod ever! Here's the code at pastebin:


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