Featured posts plugin and widget

Here’s a plugin complete with a widget that lets the site admin pick and choose which posts to feature. A backend menu is created where the admin can input a sitewide feed. In MU, the menu item is under site Admin, and in regular WordPress, it’s under Appearance.

We recommend using this in conjunction with Sitewide tags, then use the feed from the tags blog. Each item from the feed has a checkbox, and when selected, the post is moved over to the “Featured” column. The widget will display the featured post excerpt as well as the user’s avatar.

Screenshots:
The admin area.
featured posts admin screen

The widget in action.
mommieblogscom-blogs_1256592620548

Currently, if you want to change some options, you will have to edit the code of the plugin. The widget is in a separate file if you wish to remove it. Also, the widget is set to display one post, but that is easily changed by editing the plugin. Find the function call and change it thusly:

<?php ra_featured_show(10); ?>

Where the number 10 is the maximum amount of posts to show. You can also use this same function if you want to hardcode it in your theme. There are also options in the code for default avatar sizes, and some CSS classes around the post and the avatar, so you can adjust them to your liking. Feel free to fold, spindle, mutilate and enjoy the heck out of it. Since we are going to WordCamp New York, we wanted to get this plugin released before then. We’ll add more options for backend configuration after we get back.

Download the plugin here.

About andrea

City kid turned country wife, obsessive crafter.

Comments

  1. Whoa, depending on the number of comments I make, I might have to start an andrea fan club site…:)

    This plugin seems pretty cool. I would assume that for a normal blog, one would just enter their own feed address?

  2. Hey, nice plug-in.

    Would be great to have more back end control on the dashboard like having a group of featured posts that can be randomly displayed?

    Also to be able to add thumbnail images?

    Any chnace you can email me when you make new versions of this plug in so I can update them right away?

    Good job Andrea and team!

  3. Just a couple of things while I think of it:
    * Be good to include the post author’s details and the posted date under the post heading?
    * Be good to have a check box on the right side of the admin screen selecting which post to display (mine is only displaying one post in the sidebar at the monent?)rather than the post at the top of the list gets displayed.

    Cheers

  4. I wrote another widget that could replace yours.
    You can now have multiple widgets and options for each of them (widget title, number of comments, show link, show avatar).
    Better that way ;)
    Feel free to include it into your plugin, here’s the code :

    http://pastie.org/684177

    Also; there should be an option to choose the avatar size.
    Even better; be able to choose a template to display the posts ! That would be niiice.

  5. As I told you yesterday, I think you should do something for that the user can handle the post as he wants to. Here you are storing your posts (excerpt,etc) in a table but not all the informations are accessible, that’s a problem.

    With this system; only the blog_id & post_id are stored.
    I think that an even better idea would be to store an array of items (blog_id+post_id) in the plugin options. So you don’t even need a table.

    I did something to retrieve the full posts and display them in a template :

    http://pastie.org/685999

    I’m tired now, but it still need some work :

    1-here I put “feature_id as post_id” in the query to try; but you should find a way to store the post_id when saving the featured, then call that field instead of what I put (or using a plugin option as I said before)

    2-setup_postdata allows you to use the template functions like “the_title”, etc.

    3-locate_template gets a template to display the item.

  6. Hi Andrea, could you please tell me where to place the files in order to activate the plugin. There are one folder and two files ra-featured-posts, ra-featured-posts.php and ra-featured-posts-widget.php respectively. And where after activation of the plugin where do I get the option of plugin in admin area?

    • I have mine in the mu-plugins folder. There’s no need to activate it as it won;t show up on the Plugins menu.

      To get to the backend menu of it, you’ll find it under the Site Admin menu as Feature Posts.

  7. Thanks Andrea, however, this plugin has a conflict with another plugin called wpmu theme stats. If we enable wpmu theme stats plugin while having this plugin activated then we got the following error:

    Fatal error: Cannot redeclare ra_show_hide_begin() in /home/letmeno/public_html/wp-content/mu-plugins/ra-theme-stats.php on line 114

    How to fix this issue?

  8. Fixed. Change the names of both functions ra_show_hide_en and ra_show_hide_begin. Please take care of this conflict in next versions.

  9. Hello Andrea,
    This featured post plugin is awesome can you tell me how to bring images in the plugin.
    and is their any flashy featured post plugin like this available for wpmu

  10. Hello Andrea,
    This featured post plugin is awesome can you tell me how to bring images in the plugin.
    and is their any flashy featured post plugin like this http://css-tricks.com/examples/FeaturedContentSlider/ available for wpmu

  11. look like it’s not working with WP MU 2.8.5.2. Resulting blank screen.
    Only by editing wp_ table in phpMyAdmin I got back my admin page.
    Just FYI

  12. This plugin is fantastic! Thanks for creating it!

    Just one question, how can you limit the length of caracters of the featured posts in the plugin?

    Is that something that can be controlled?

    Thanks in advance!

  13. Hi there,

    Is this plugin working with WPMU 2.9.1.1?

    I had it working with 2.9.1.1 but having upgraded it doesn’t seem to be working. I’m using the Global Tags plugin. I’m getting the feed and can select the articles but nothing is showing up on the main blog.

    The blog is http://motif.swinmc.net

    Cheers!

  14. I love the idea of this plugin, but I can’t seem to get the list generated on the right-side.

    My error log says “Data too long for column ‘feature_timestamp’ at row 1 for query INSERT INTO wp_featuredposts…(and so on).”

    Just wondered anyone on WPMU 2.9.1 was dealing with.

  15. So, I gave your plugin a try. In the plugins list it’s listed as version 1.0. It says click here to upgrade automatically, but upgrading it does nothing and leaves it listed as 1.0. (not 2.8.1?)

    I also can’t find any management screen for this plugin. Nothing under appearance, nor settings. If it is supposed to be under appearance, You should seriously reconsider this choice and place a settings screen under settings.

    I found the widget under widgets, and added the widget, but found no options for the widget and it displayed this on my blog:

    Fatal error: Call to undefined function ra_featured_show() in /home/casualvegan/data/www/thecasualvegan.com/wordpress/wp-content/plugins/wordpress-mu-featured-posts/ra-featured-posts-widget.php on line 22

  16. Benjamin Knight says:

    Are there any compatibility issues with MU 2.9.2? I installed this plugin, but in the admin area for the plugin, when I enter the feed URI and click “Save Options” I don’t any posts that I can choose to feature, even though the feed is valid and has content.

  17. I’m having the same upgrade issue, can’t get it to upgrade, even manually, and then can’t get the admin menu to show up. Really want to use this. Using wpmu

  18. OH! I just got it to work, reinstalled it. I deactivated a plugin I think was conflicting. Now am getting the blank screen, but will keep working on it (blank screen that is noted above with the admin page) – I’m psyched it’s showing up now though!

  19. I got it working finally! One problem still remains – the avatar – it is entering the blog id of just the tag database – so if there are multiple users, the incorrect avatar shows up. I’m working to correct this. Is there a fix to this in any later version?

    • Nope, no fix. Don’t know what avatar you mean, as they aren’t built in to WordPress itself, unless you mean where it pulls in gravatars.

  20. Erik Vlietinck says:

    Hi,

    I tried your plug-in, and from the database tables it creates, it looks like it’s working, but the admin page never shows –it’s a blank page (nothing in-between the body HTML tags.

    I’ve tried turning off all plug-ins that I have installed, but to no avail. I am running WPMU 2.9.2.
    Can you please help? I am not a programmer, so I won’t touch your code as I’m sure to mess it up anyway.

  21. Yes, and it works on a 3.0 RC3 blog but not on the WPMU 292 blog my main site runs on.

  22. Not working with wp3.0 After update or upgrade it is still asking to upgrade in the plugin. Tried upload method also the same. Any idea.

    • “Not working with wp3.0″ is not much to go on when trying to find an issue with a plugin. In this case, one of the files did not get updated to the new version in the SVN. I’ve fixed that.

  23. Denise Barnes says:

    hi:

    will this work with a multi-site WP 3.0 install? and, more to the point, if so, how? i am a complete novice. i’d like to pull posts from 25 blogs to 5 areas on the blogs main blog, having the ability to point to where those posts will land.

    i understand you have a plugin in development for just what i am describing. any idea when it will be available?

    thank you.

    • Yep, this’ll do it.

      • Denise Barnes says:

        i have been unable to make it work as i would like, but as i said i am a novice. you don’t have any extended tutorials, do you?

      • Tenley Shewmake says:

        I installed this on a wordpress 3.03 multisite and cannot find the Admin page. There is nothing under Appearance or Admin. I then created a mu-plugins directory and put the plugin there, refreshed the dashboard and still nothing. This would be a big help if I can get it to work. Thanks!

  24. Is it possible to show the whole post (including images, featured image if there is one) and any embedded video/audio…?

    I’d like to show the posts as if they’re just part of the normal blog – not just an excerpt.

    Thanks,
    Nathan

Trackbacks

  1. [...] from: Featured posts plugin and widget – WPMU Tutorials Comments0 Leave a Reply Click here to cancel [...]

  2. [...] Featured posts plugin and widget [...]