Yet Another Featured Posts Plugin for WordPress (YAFPP)

Yet Another Featured Posts Plugin for WordPress (YAFPP)

Yet Another Featured Posts Plugin provides an easy-to-use interface for featuring specific posts in a WordPress blog. After installing the plugin, you can feature and unfeature posts by clicking on each post’s ‘featured star’ in the WordPress edit posts page.

Yet Another Featured Posts Plugin has a variety configuration options, allowing you to control a number of display options as well as which users can feature posts. For developers YAFPP allows several output options besides the default: it can return a data array, modify the next query for WordPress’ the_loop(), and or return formatted data (which can be easily formatted through the admin panel).

Download Yet Another Featured Posts Plugin (YAFPP)

YAFPP Screenshots

Read the documentation

How to use YAFPP

To start, download YAFPP and upload it to your site’s wp-content/plugins/ directory. Activate the plugin and go to the posts listing in your WordPress admin panel. Here you will see a grayed out star next to each post—simply click the star to feature (or unfeature) that post.

Next within your site template you can include a list of featured posts by calling:

<?php get_featured_posts(); ?>

To control how this list is displayed, go back to your WordPress admin panel to Settings > Featured Posts (YAFPP). Here you can select whether to display the title, post excerpt, or even the image from YAPB. You can control how long the post excerpt is, and the maximum number of featured posts to display.

Visit the docs for more detailed info

Some advanced options for developers

While YAFPP is easy for first time users, there are a number of advanced options for developers. Mainly, YAFPP offers a couple output options to make your WordPress dev smoother. By default, the plugin echoes out formatted data (which can be controlled by the admin panel), but if you’d prefer to return this as a string you can pass this option in an array:

<?php $output = get_featured_posts( array( 'method' => 'return'));

Other options for the method include ‘arr’ which returns an array of various post data for the featured posts, and ‘the_loop’ which attaches the list of featured posts to the next instance of the_loop().

An example of ‘the_loop’ method is as follows:

get_featured_posts(array('method' => 'the_loop'));
 while (have_posts()) : the_post();
//whatever you want in here

When using ‘the_loop’ method, the original WordPress loop is still preserved, it is just bumped so that the featured loop is called first. So if you need the original query, just call the_loop a second time.

Download YAFPP

Visit the docs for more detailed info

Jon Raasch

Jon Raasch is a UX nerd and free-lance web designer / developer who loves jQuery, Javascript & CSS.

You Might Also Like:

90 Comments to “Yet Another Featured Posts Plugin for WordPress (YAFPP)”

  1. Tejaswini says:

    Excellent Plugin! I liked it.
    A small correction, on the WordPress page (from readme.txt) you have mistakenly put the template tag as “” which should be as you mentioned on this page.
    I was trying it and messed up a little bit.
    But overall, I should congratulate you for this great resource.

  2. Tejaswini says:

    Oh sorry, your comment does not accept PHP opening and closing tags and so not showing my comment properly. The template tag was get_post_listing();

  3. Jon Raasch says:

    Ugh woops! Thanks a lot for pointing that out Tejaswini, it’s fixed now

  4. VVOR says:

    Thanks for the plugin!

  5. Ayaz Malik says:

    the plugin is excellent. but there seems to be one problem in it. if i get on a post the links of the featured posts are replaced to the current post page. plz see this link
    you will understand.

  6. Jon Raasch says:

    Hi Ayaz,

    Sorry I’m not sure I understand exactly what the problem is and I haven’t run into any issues with YAFPP on a single post page. Have you made sure to include the get_featured_posts() template tag on your single.php theme file? I’m thinking maybe it’s only on the index.php theme file so the featured posts aren’t showing up in the single post view.


  7. Ayaz Malik says:

    they are showing fine everwhere. but the problem is if u are on a post , the link of the featured post is replaced the current post we are on. for example the link to feature post is 123.html and i am on a pge abc-12.html the link on this page of featured post will be changed to abc-12.html. lol i tried explainin.

  8. Ayaz Malik says:

    btw i have placed the featured post below menu on top so it will shpw up on every page. please taek a view

  9. Stacy says:

    I cannot get the option to use Images. Is there another plugin I have to install for this to work? I see in the second screenshot that there should be a column for “images” but I do not have that in my site.

  10. Jon Raasch says:

    Hey Stacy –
    The image option in YAFPP works with YAPB (Yet Another Photoblog) which you can get here:

    Ayaz –
    I’m not sure what’s causing that problem (and I still don’t see anything on the individual post pages on your site). I’ll look into this soon, but I’d guess that if this problem exists it can be solved right now by calling get_featured_posts() outside of The_Loop, so try that for an immediate fix and I’ll get back to you on the larger issue.


  11. Stacy says:

    Thanks for the response on the YAPB pluggin. I figured it out because I actually read the docs completely!

    New problem. On the home page, the cache/database isn’t clearing out the old deleted featured posts. Additionally, the permalink isn’t working and neither is the ability to show the thumbnail.

    What the heck is going on? I made “some” changes to the code and it worked fine last night but today it’s all jacked. Any ideas?

    BTW, GREAT plugin!

  12. Jon Raasch says:

    Hi Stacy,

    Hehe reading the docs is always a good idea 😉

    Right now YAFPP doesnt check to see if a post has been deleted, so make sure to unfeature anything you want removed (which you can do from the YAFPP options menu as well as the edit posts listing). And I’ll add a test to see if the post is available to the plugin soon.

    As for the permalink problem, I’ll be looking into that soon – I haven’t experienced it yet but Ayaz mentioned an issue with the permalinks, I think it has to do with The Loop. I’ll be looking into this soon.


  13. Ayaz Malik says:

    hiiz, thanks bro, yes im going to try with the loop.

  14. Marcelo says:

    Hello, congratulations for the plugin. Unfortunately, when I get to the Posts > Edit page, the star for featuring a post won’t appear. I am using WP 2.8.4. Best regards…

  15. Jon Raasch says:

    Hey Marcelo – two things, first make sure you are on the post listing page as opposed to the individual post editing page (in Posts > Edit), and if you are make sure that yafpp is in your plugins directory under the directory named yet-another-featured-posts-plugin.


  16. Marcelo says:

    great, the mistake was the folder name, mine was “yet-another-featured-posts-plugin.1.1”. let’s try it

  17. Ayaz Malik says:

    any luck with the permalink issue? regards

  18. Jon Raasch says:

    Hey Ayaz and Stacy,

    Sorry for taking so long to get back to you.

    The problem you’re having most likely boils down to another I’ve noticed when calling <?php get_featured posts(); ?> within ‘The Loop’.

    But you can pretty easily get around this, just use the ‘return’ method anywhere outside of the loop, for instance:
    <?php $featured_posts = get_featured_posts( array( 'method' => 'return')); ?>

    Then wherever you want to put the featured posts:
    <?=$featured_posts; ?>
    (this can go inside the loop)

    Sorry about the inconvenience of that; I’ll fix it so it doesn’t happen at all in a later release.


  19. Ayaz Malik says:

    hiiz again.
    yes i did that but now permalinks on homepage even chagned to home’s link.

  20. justbishop says:

    I’m having the same issue that Ayaz Malik posted about at first.
    I’ve put the featured posts template tag into my sidebar.php…when on the home page, each of the featured posts listed link to the correct place (their respective single post pages), but if I’m on a single post’s page, all of the featured posts in the sidebar link to the post that I’m on. I hope that made sense :/

  21. Anthony says:

    Hi .. great plugin! Is this compatible with 2.8.5? .. When I run it all I can get the plugin to generate is a link of the post title. It won’t post any of the excerpt, no matter what options I specify in the settings. I’m using the return method you specify above. Is this something I’m doing wrong or an incompatibility with 2.8.5? I looked in the docs at the array section, but am unclear where to put it relative to the rest of the code. It would be useful if you posted a full example of using the array in the docs. Thank you for your thoughts!

  22. Jon Raasch says:

    Hey Ayaz and JustBishop,

    I finally spotted that bug and fixed it, very sorry for taking so long to do so. Get the newest version of the script here: YAFPP 1.2

    Anthony – I have YAFPP working just fine in WordPress 2.8.5 using the return method and titles/descriptions/photos, maybe try upgrading to YAFPP 1.2 and let me know if you’re still having trouble.


  23. Anthony says:

    Jon, thank you kindly for offering to help. I know it’s a pain and donations are always far too meager to account for your time! =)

    As a general comment, I’m pretty sure I’d be able to figure out my issue if this site showed the php markers in the docs. In the basic setup, for instance, I’m fairly certain you want the get_post_listing(); within the typical php markers, but it becomes difficult to know when you’re omitting them, especially for novice users.

    As it stands right now, the only thing I can get going are links of the featured posts by calling get_featured_posts() between php markers. No excerpts or anything I select on the options. If I try the get_post_listing(); (basic setup in the docs) between opening and closing php markers, it just bricks my theme (the page ends abruptly where the code is). That seems to be what connects to the options settings per your docs, but I can’t get that working.

    I have no idea what to do with the array. It would be useful to have a single example, with all the proper markers. For instance, if you wanted to build an array that showed the post ID, excerpt, and the author, what would it look like? You show the possible values but do not appear to give an example of them working together to make a featured post in the content of a wp template. This is probably elementary to you, but I’m still learning! =)

    So I’m running into a wall even getting the basic config working. I’m usually serviceable modifying code if necessary, but I’m failing miserably just following the docs! =)

  24. Jon Raasch says:

    Hi Andrew,

    Per your request I added that array of options that can be passed to <?php get_featured_posts(); ?> to the docs: Click here.

    I also added the PHP tags to the codebits in the docs and this post to avoid any further confusion.


  25. yaacov says:

    how do i use a picture / image from the “custom field” in the post ?

  26. Mike says:

    I can’t select featured posts. I.m running WP 2.8.6. Is there something that needs to be set?

  27. Jon Raasch says:

    @yaacov – The built in image support only interfaces with YAPB at the moment – I’ll think about adding in support for passing a custom field, however for now you’ll have to either use the the_loop method (described here) or attack the plugin core to make that happen

    @Mike – I haven’t tested in WP 2.8.6 yet, I’ll take a look soon. I can tell you that all is well in 2.8.5 (but that obviously doesn’t help you too much :)).

  28. Ron says:

    Heads up – I had some serious issues getting it to work in 2.8.6. I was trying to get it to output with ‘the_loop’ and then run the non-featured loop again.

    After banging my head against the wall I discovered that I just needed to put “wp_reset_query();” between the featured loop and the non-featured loop and it worked ok…

  29. Renee says:

    Hi, I am just learning WP and am building my site. I am a total novice and half of what is said is Greek to me. I have installed the plug-in but this part of it, I don’t understand:

    Next within your site template you can include a list of featured posts by calling:

    within my site template where? where do I put this little piece of code?

    thanks in advance for your help.

  30. PerS says:

    in WP 2.9, the embedded function new_excerpt_length($length) gives me the following error:

    PHP Fatal error: Cannot redeclare new_excerpt_length() (previously declared in /PATH/wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php:47) in /PATH/wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php on line 47

    Moving the function outside function get_featured_posts fixes the error.

  31. Chad says:

    is it possible to use YAFPP with Tan Tan Noodles (flickr album plugin)?

    YAFPP works great on my site, but I am unable to pull up any of the imported tan tan noodles albums

  32. Daniel Baars says:

    Great plugin! Does anyone know of a way to limit the Featured Posts List to a certain category? So I can show a list of relevant Featured Posts on the Category pages? Thanks in advance…

  33. Ciprian says:

    Congrats Man, you rock!

  34. I’ve found that when I use ‘the_loop’ as ‘method’, the option ‘max_posts’ is ignored. I’ve found this fast fix: in yet-another-featured-posts-plugin/yafpp.php find the code

    if ( $opts['method'] == 'the_loop' ) {
    'post__in' => $featured_arr

    return $featured_arr;
    and change
    'post__in' => $featured_arr


    'post__in' => $featured_arr,
    'posts_per_page' => $yafpp_opts['max_posts']

  35. Jon Raasch says:

    @PerS I haven’t experienced this issue in WP 2.9, but I’ll look into it.

    @Chad – The easiest way to do this is to use the output method ‘the_loop’ see the docs for more info. This method allows you to build any markup you want.

    @Daniel Bears – For now you can use ‘the_loop’ output method (described in @Chad above), but I’ll consider adding an option for this to the plugin in the future.

    @Nicolo – great idea, thanks! I added that to the YAFPP 1.3 release, and credited you in the changelog.

  36. PerS says:

    Forgot that I had patched yafpp and updated to 1.3, and got the error I mention above i.e.:

    [25-Mar-2010 07:42:24] PHP Fatal error: Cannot redeclare new_excerpt_length() (previously declared in /wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php:47) in /wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php on line 47

  37. beheader69 says:

    great plugin.
    but how do I remove the black dots next to the title?

  38. Kasandra says:

    First of all, great plugin. Secondily, I am having hard time working a certain aspect of this plugin. I am new to coding. FOR some reason I cant get Tthe plugin to show more of my posts even though I have the max. length to 600 words. I have not entered anything in the excerpts box because it will afect my sidebars Recent Entries. But the plugin automatically grabs part of my post and with the read more link that I have not placed in the that location of the post. Can you please help?

  39. Based on Ron’s comment above, should wp_reset_query(); be added to the docs as a necessary step between the two calls to the_loop() if the second call is, in fact, to run unadulterated?

    At the moment, in WP 2.9.2, I’m not having much luck with max_posts or excerpt_length as parameters to get_featured_posts. 🙁

    But I have featured posts in my output now. 🙂

  40. When using with method “the_loop” I had to call wp_reset_query() immediately afterwards in the code otherwise it wrought havoc with any loop queries that fall later in the page.

    You might consider calling this function directly within your plugin code. I wasn’t able to find documentation for it within the Codex, but you can look it up in WordPress Trac.

  41. Richard says:

    Great plugin. One request though: Is it possible to exclude the featured item from being displayed in the list of the rest of the posts.

    My client would like to have the featured Item always display on the home page, but not to display what is featured again on that page.

    The site is here:

  42. gordonmacmillan says:

    hi, i update to version 1.4 and now my featured posts don’t display pics? just lines of text. Any ideas on how i get the byeline pics back? thanks

  43. Hello. I have installed this great plugin but I’m having a little issue. When I try to change the settings for it in the admin panel, they won’t “stick” After clicking save settings, they automatically revert to the original settings. Do I need to change permissions somewhere maybe?
    Thank you.

  44. Tim says:

    My requests 🙂
    1) Easily rearrange the order of featured posts
    2) Ability to feature pages as well

  45. gemma olds says:


    I am using this plugin and it works a charm.
    I have also installed sociable for bookmarking posts.
    I cant seem to find a way to make the social icons appear with the featured posts excerpt on the home homepage.

    Any suggestions?


  46. ian says:


    Great plug-in but my settings wont save. I’ve even tried setting them direct in the php file without any joy. Am using WP 2.9.

    What am I doing wrong?

  47. dodi says:

    can i show featured posts in a widget?

  48. Thomas says:

    Hi Jon, and thank you for a great plugin!

    Since both posts and pages are allowed to be featured,
    it would be really nice if also other post-types (WP3 custom post types) could be featured.

    Is this something you are planning for future releases?

    Thank you.


  49. Thomas says:

    As a reply on my own question, this is possible just by adding the post-type in the plugin:

    function yafpp_add_pages_to_query_opts($query_opts) {
    $query_opts[‘post_type’] = array(‘page’,’post’,’event’); //Added post-type “Event”.
    return $query_opts;

    That is for enabling the post-type in the output only.
    If you have custom columns for your post-type, just add another column called “Featured”.

  50. Thomas says:


    To manually change the order of the featured posts.
    Chronological order is great, but sometimes you just
    need to manually push for a post a little extra, without changing it’s Publish date.

    A graphic drag-n-drop interface would be awesome.

  51. Robbie says:

    Great plugin! I love it!

    But, I need one thing more…..How to exclude featured post from the same page. I have one column with featured posts and another column with other posts where is all regular posts list and I want to show all other posts which is not featured posts.

    In short –
    1. Top News (get_featured_posts(array(‘method’ => ‘the_loop’));) – first column
    2. Other News (query_posts(‘posts_per_page=7’);) – second column


  52. Robbie says:

    Meanwhile, I found solution!

    $featured_posts)); if ( have_posts() ) : while ( have_posts() ) : the_post();?>

    tnx anyway for your plugin

  53. tracy says:

    thanks for the plugin!
    3 questions: you have an option to feature pages but i don’t see where i can set that for each page

    also do you have a site with this plugin demo?

    and…one more: i want to display this featured setting only on one specific page…is there an easy way to do this or do i have to basically just add some code that says

    if page = “featurepage” then display

    otherwise nothing

    ? thanks so much tracy

  54. Ben says:

    The plugin looks promising to me but I can’t seem to figure out where to place the tag. I have put it in “Main Index” but I got nothing. Could you give me any idea of where to place it.

  55. Scott says:

    Great plug-in, exactly what I was looking for.

    I had a bit of an issue in the admin view with regard to the styling – the stars weren’t showing up. Turns out URL to the plug-in directory was getting mangled with the physical path to my WordPress install and breaking the image reference.

    I replaced the code to find the root of the plug-in directory with the following and it ran just fine: (Lines 303-304 and 323 – Version 1.4)

    $yafpp_dir = WP_PLUGIN_URL . '/yet-another-featured-posts-plugin';

    Not sure if this is compatible with versions below 2.9, but it works for me.

  56. Mike says:

    Hi, can anybody help me? I am trying to use this plugin and I get the following error:

    Fatal error: Cannot redeclare new_excerpt_length() (previously declared in /home/content/57/6286757/html/wp-content/themes/theme/functions.php:25) in /home/content/57/6286757/html/wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php on line 51


  57. Mike says:

    Oh yeah, I forgot to mention the theme I am using is flowhub by monkify

  58. Jason Vargas says:

    Could I get some assistance on the following?

    Fatal error: Cannot redeclare new_excerpt_length() (previously declared in /homepages/4/d291466932/htdocs/wp-content/themes/flowhub/functions.php:25) in /homepages/4/d291466932/htdocs/wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php on line 51


  59. Excuse me, perhaps this is an dumb question: how can i get with the ‘arr’ method for example the id(s) of the featured posts? what is the name of the $array and how can i get the post data?
    thanks a lot.

  60. foxy says:

    Hi, I have been featuring pages no problem but suddenly things have gone weird. I get my usual Featured Pages heading followed by the entire featured pages content followed then by the list of featured pages!

    Any idea why the pages contents might suddenly be displayed?

    I think it’s something to do with the excerpt because the featured page list isn’t showing excerpts any more. The excert length is set to 20 words. I have turned excerts off (still shows the page contents), turned it on (no change). Turned all featured pages off. Featured different pages. New page contents displayed. Help !!

    I am running YAFPP 3.1.9 on WP 3.0.1

  61. foxy says:

    sorry YAFPP version 1.4

  62. barbara says:

    A problem has appeared with yafpp…. before the list of featured pages it outputs the full contents of the featured pages followed then by the links but no excerpts. I have tried reinstalling, turning off/on, changing the excerpt length etc. Posts behave the same way, however if the post has an excerpt then the post contents are displayed followed by the link and excerpt.

    Throwing in trace comments has narrowed it down to the get_the_excerpt function generating the printing of the full post/page rather than just the title:excerpt.

    Does this behaviour ring any bells with anyone?

    Any suggestions would be much appreciated

  63. Ajay says:

    Installed the plugin but the stars are not showing under the featured column on Posts page, therefore I cant actually feature any posts.

    Is there any other way of featuring them until this is fixed?

    All other plugins are disabled.
    Am testing on localhost
    YAFPP v1.4
    Wordpress v3.0.1
    PHP 5
    Win7 x64

  64. Nappa says:

    Hi there, I have the same problem of Richard (April 29 2010).
    I would like to keep posts in homepage (using the default feature of WordPress; Post -> publish -> visibility ->Public – and – Keep in home page) and I would like to use YAFP to keep other posts in the sidebar (visible everywhere). The result is that in the home page and the sidebar are the same, the curious thing is that if I go to see the configuration of YAFP the ‘featured post’ are less than the posts in homepage.

  65. Clenn Page says:

    Very nice plugin and installed on my sites. My question, is there a way to put the featured post in 3 different column? My site has the three column content and I want the top of its contents has different featured post. Is it possible? I hope I make sense on this question. Thanks

  66. Peter says:

    Anything about my two comments ? Any help will be appreciated.


  67. Lee says:

    The plugin is exactly what I’m looking for, thanks!. Just have one issue: It outputs an excerpt of the first featured post follow by it’s title then follow by the title of the second featured post followed by the second post’s excerpt. Kind of like this:

    1st post excerpt
    1st post title
    2nd post title
    2nd post excerpt

    I can’t find anything in the config or the docs that addresses this. Any guidance?

    Thanks again!

  68. Steven says:

    Hi Jon,

    When I insert the code to my WP main template page (index.php) and push update, my site says “Fatal error: Cannot redeclare new_excerpt_length().” Do you know why this might be happening?

  69. JP says:

    Hi Jon,

    Great plugin. I have one question though. What is the best way to change the css to fit into the standard site post formats? I have looked in the php file where the css is but my changes don’t behave as they should for standard css. Any suggestions on the best way to format the posts?


  70. Chris says:

    Hi, I’m wondering if there is a way to call the plugin into a page or post, rather than in the php files.


  71. Jenny says:


    I really like the plugin, but for some reason I am not able to click on the featured starts. Can you please help!


  72. I’m having the same problem on the latest version of WordPress 3.1.2 – the Star is no longer displaying on the post listing page.. Any help would be appreciated?

  73. bob says:

    Hi im using your plugin and monkify theme and also get the error:

    Fatal error: Cannot redeclare new_excerpt_length() (previously declared in /homepages/26/d204163373/htdocs/blog/wp-content/themes/flowhub/functions.php:28) in /homepages/26/d204163373/htdocs/blog/wp-content/plugins/yet-another-featured-posts-plugin/yafpp.php on line 51

    Please can you help?


  74. damon says:

    so confused…because i’m a newbie. “within your site’s template” – where exactly? page.php? content.php? style.css? again, i’m learning.

    and all i do is copy and paste this?


  75. Jurgen says:

    Hi thanks for the great Plugin! i`ve a question and i know i saw someone else asked it too but i don`t see any answer.

    Is there a way to order te posts by date and how do i do that?

    I hope there`s a way to fix this.

  76. colir says:

    thanks for this great plugin.
    I’ve just a little quesztion, how to exclude ‘featured post’ from a regular query ?

  77. giacomo says:

    Is possible to change only a title dimension?

  78. Dan says:

    YAFPP for WordPress and Google Analytics Dashboard plugin do not play well together when you have stats for posts displayed. Completely corrupted the cached post stats data when I activate YAFPP.

  79. Melissa says:

    Where do I put the code this on a static page? Would you make this a little more friendly for those of us less code savvy? I know there are plugins out there that will allow a short code to be copied to the page rather than force you to go into the hard code itself. The thing is, none of them contain as many options. I’d rather use this one, but after around 9 hours of trying to find the answer, I’m ready to give up.

  80. Ben says:

    Great plugin! I see in the description that it is possible to insert the post thumbnail image, but I don’t see any option for that. Am I missing something?

  81. Board Directory says:

    I really like this plugin, keep it up man!

  82. giorgio says:


    I really like the plugin, but for some reason I am not able to click on the featured starts because the “star” doesn’t appear!
    Can you please help!


  83. Brad Dalton says:

    Which exact template do i paste the php code in to display featured posts if using Twenty Eleven theme?

    Can i use a hook plugin to execute the php code?

    Your screenshots are broken do you have an example shot of inserting the code into a template?

  84. ramy says:

    nice plugin , i have a question , can we show featured posts in a widget ??

  85. rinku says:

    Star image not display in my post listing,please tell me how to display it.

Comments are closed.