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.

[Post to Twitter] Tweet This Post 


bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top  banner ad


18 Responses to “Featured posts plugin and widget”

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

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

  3. 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?

  4. Hunnas says:

    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!

  5. Hunnas says:

    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

  6. Gordie says:

    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.

  7. Gordie says:

    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.

  8. Amir says:

    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?

    • andrea says:

      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.

  9. Amir says:

    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?

  10. Amir says:

    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.

  11. ezhil says:

    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

  12. ezhil says:

    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

  13. `rolandinsh` says:

    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

  14. Nicolas says:

    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!

Leave a Reply