Random Featured Post Plugin

Download from WordPress.org

The Featured Post plugin allows you to display a random post from a designated category. Ideally this should draw readers landing on your homepage to some of your best posts. The featured post will display the title ‘Featured Post’ (customizable) along with the post’s title, an excerpt and a link to continue to the full post.


Can You Have More Sales, Too?
Here at MyDollarPlan.com we use AWeber’s opt-in email marketing software to reach our subscribers. If you’re serious about raising profits and building customer relationships like we are then take a FREE test drive now!




Take a Free Test Drive today!

This plugin requires WordPress version 2.3 or higher and has been tested up to version 2.5.1. User reports suggest compatibility up to 2.9.2 but I have not tested or verified.

I hope you find this plugin useful. Unfortunately, I no longer have the time to support or maintain this plugin. Please don’t contact me for support.

Installation

  1. Download and unzip featuredpost.zip (see below) to your plugin folder.
  2. Activate the plugin from the Plugins section of your dashboard.
  3. (Optional) Create a ‘Featured’ category.
  4. Go to the ‘Featured Post’ options in your dashboard and select the categories from which you would like posts to be randomly selected.
  5. Check the ‘Show Featured Post’ box and click ‘Update’ to save your changes.
  6. Place a call to the show_featured_post() function in your template, most likely in your main index template just before the loop. See additional notes below.

Additional Notes

  • The show_featured_post($PreFeature = ”, $PostFeature = ”, $AlwaysShow = false, $categoryID = 0) function has five optional arguments. The first two are for any HTML you would like to display before and after the featured post. The third argument is a boolean (true/false) argument which will override the ‘Show Featured Post’ option and always display the featured post when true. The fourth option allows you to specify a category to display from, overriding the selection in settings page.
  • If you choose to display excerpts, the plugin will display your optional custom excerpt from the advanced options section of your post; otherwise, the standard WordPress excerpt is shown. The fifth option allows you to show more than one post at a time, overriding the settings page option.
  • This plugin respects the <!–more–> tag when you choose to display the full content. There is a setting which allows you to ignore the tag and display the full post.

Examples

  • This example will display the featured post only on your homepage inside a span block:

    if ( function_exists('show_featured_post') )
     if (is_home() && !is_paged())
      show_featured_post('<span class="container">','</span>');

  • This example will always display the featured post, ignoring the ‘Show Featured Post’ option and the category ID option in settings:
    if ( function_exists('show_featured_post') )
     show_featured_post('', '', true, 42);

  • All output is contained in a DIV class named “featuredpost” and can be adjusted via your stylesheet.

Change Log

v1.1.3 (May 15, 2008)

  • Bug fix: more tag was not being respected on single posts/pages when full content option was selected.

v1.1.2 (May 5, 2008)

  • Added option of showing posts and/or static pages.

v1.1.1 (April 30, 2008)

  • Added multiple category selection option.
  • Added option to display multiple posts.

v1.1.0 (April 28, 2008)

  • Discontinued use of truncated post content and switched to the option of displaying full post content with HTML intact or standard excerpts, custom or WordPress generated.
  • Added option to ignore the <!–more–> tag when displaying full post content.
  • Added fourth argument to show_featured_post() function to allow category ID from settings to be overridden.

v1.0.1 (April 11, 2008)

  • Added category name and ID table to options page for convenience.

v1.0.0 (April 7, 2008)

  • Initial plugin release.
Download from WordPress.org

Comments to Random Featured Post Plugin

  1. Great plugin and just what I’m looking for. Many thanks.

    Unfortunately, as a relative newcomer to WordPress and adjusting css style sheets, the additional notes and examples provided are a bit beyond me. Not quite sure where to place the code. Any chance of a more detailed step-by-step on how to do this?

    Kate Foy


  2. Kate,
    I’m not very good with CSS either but here’s my best attempt at an explanation. In your Design-Theme Editor, open your stylesheet and create a section like this:
     
    #content .featuredpost {
    border:1px solid #000000;
    }
     
    You can further adjust other elements in the featured block, such as the post title, like this:
     
    #content .featuredpost h2 {
    color: #FF0000;
    }
     
    Does that help?

    Scott


  3. I’ll give it a shot. Thanks Scott.

    Kate Foy


  4. Hi Scott

    no go. This is what I have done:

    downloaded, unzipped and uploaded the plug-in to my plug-ins folder; activated the plug-in on my WP Dashboard; inserted the category name for random post to choose from; saved. BTW, I assume Category ID is the name of the category? It’s not showing after I hit the save button.

    I then inserted this code in the index.php within my theme folder:

    <?php if ( function_exists(‘show_featured_post’) )
    if (is_home() && !is_paged())
    show_featured_post(”,”);?>

    And in my CSS style sheet for the theme, I’ve inserted:

    #content .featuredpost {

    border:1px solid #000000;

    in the content styles section of the file.

    I can only think I’ve got the code in the wrong place, either within the particular file or in a wrong file altogether.

    Sorry to be a pain, but I’d really appreciate a solution as I’ve gone past the ‘forget it’ stage and want to make it work! Call me ornery …

    Best

    Kate Foy


  5. Kate,
    The category ID is a number, it won’t save if you enter text. In your dashboard go to Manage-Categories and click the category you want. Then look in the address box of your browser and you’ll see a cat_ID= at the end of the URL. The number at the end is what you want. Also, did you check the “Show Featured Post” box in the options? If you need more help just shoot me an email.

    Scott


  6. Is there a way in which you can put more control in this plugin? Such as the fact, that some users may not want a random post, but posts ordered in terms of the newest first..

    Nick


  7. Nick,
    Do you mean that you want to always display the single newest post from a specific category as your featured post? Or am I reading your comment wrong?

    Scott


  8. Very interesting plugin. I’ll probably use this for some of my future theme developments.

    @Nick: You can probably just use a wp_Query to do that.

    Good luck!

    Leland


  9. Ok Im a retard…. Could anyone do a step by step guide for this?? I mean down to the “T”… Sorry and thanks for all the help…

    Tim


  10. @Kristen

    The plugin shows the content of a post. I can put in an option to not strip HTML tags from the post content which would show images in your post, along with any text you might have as well though.

    Scott


  11. @Kristen

    Look for the lines

    $desc = attribute_escape(strip_tags($post->post_excerpt));

    and

    $desc = attribute_escape(strip_tags($post->post_content));

    and replace them with

    $desc = attribute_escape($post->post_excerpt);

    and

    $desc = attribute_escape($post->post_content);

    respectively.

    Scott


  12. This is the perfect plugin for me except I need to allow it to show images — any advice? I am trying to show a thumbnail that links to my latest project but right now I can only display text.

    Kristen


  13. Sorry, forgot to take off the attribute_escape functions as well. The lines should be

    $desc = $post->post_excerpt;

    and

    $desc = $post->post_content;

    Scott


  14. That would be perfect. I tried examining the plugin code but couldn’t identify what exactly I needed to modify.

    Kristen


  15. I modified the plugin as instructed and it nearly works — except instead of displaying the image you see <img src=”…..”

    Kristen


  16. Thanks a million, it definitely works now!

    Kristen


  17. Great plug-in, thanks. I’m using the following classes in my stylesheet, which work well for me:

    h3.featuredpost

    h2.featuredpost a

    Andrew


  18. this actually works a bit better though after tinkering:

    div.featuredpost h2 a

    div.featuredpost h3

    Andrew


  19. Hi, thanks a lot for this great plugin. I like it very much and you can see it in action on my site.

    Some questions:

    I would like to use the more-tag including images instead of truncating the text. Is that possible or do you plan this feature?

    The solution in comment 15 breaks the formattings when attributes like strong or italic are used? Is it possible only to use the img-tag inside the truncated text?

    Best wishes and excuse my chaotic english.

    Daniel

    Daniel


  20. another question is, if it possible to use this as a widget?

    Daniel


  21. @Daniel,

    Widgetizing this plugin is not possible; however, there are other plugins out there for displaying featured posts in your sidebar if that’s what you would like to do. Check the WordPress.org plugin database. I’ll take a look at your other feature requests when I have a chance.

    Also, if anyone is just looking for a plugin to display a single featured post and is not interested in randomizing from a group of posts then I would recommend using the WP-Sticky plugin.

    Scott


  22. Hi Scott,

    yes I wanted to show your random featured post in a sidebar, because I like the flexibility to manage a group of articles through the categories, which are important for me :-)

    It would be really great to use an eyecatcher too.

    Daniel


  23. I’m not a coder, but this worked for me:

    $desc = strip_tags(($post->post_excerpt), ”);

    Daniel


  24. Hi Scott,

    Thanks for sharing with us this plugin. It works well in our site ~ with truncated text, etc.

    Because I wanted to display the entire text of the post being rotated, I increased the character limit in the admin option which works okay except all the html tags and formats are lost.

    Is there a way I could display the entire text of the post being rotated with formatting being retained?

    Thanks heaps.
    Pam

    Pam


  25. Hi- I’ve added this plugin to my site and it works great, but how do I set it to show more than one featured post at I time? For now I’ve duplicated the code: , but more than often it shows the same featured posts in a row.

    Casey


  26. @Pam:
    I’ll really try to fit in some time to work on the plugin this week. In the meantime, comment 15 will do what you’re looking for, but keep in mind that if the post is ever truncated in the middle of a tag it will mess up your formatting.

    @Casey:
    This plugin is really designed to only show one featured post at a time but I’ll see about adding an optional parameter to the function call so that you can specify different categories for each call, that should help you out.

    Scott


  27. Ok Scott thanks! I only need to specify one category – but I’d just like to show more than one Featured Post at a time. Let me know if you find a way to make that work – thank so much!

    Casey


  28. The plugin has been updated with a few new options. Basically, the truncated post option has been discontinued in favor of displaying either full, formatted post content (with or without more tag) or post excerpts.

    @Casey:
    The best I could do for you is add an additional option to the function call to specify the category (see above for example). You’ll be able to have two featured posts at once but they will have to be from different categories. You can have them come from the same category by creating two new categories just for featured posts and then adding different posts to each of those categories, along with their original categories.

    Scott


  29. Thanks very much, Scott. You’re a legend!

    The admin option to use “excerpt” or “full text” with formatting remaining intact is just exactly what I’ve been looking for. :-)

    Pam


  30. Its possible to configure more than just one category?

    Miguel


  31. @Miguel:

    That’s one of the things on my “to do” list for this plugin.

    Scott


  32. Plugin has been updated with multiple category selection and multiple post options.

    Scott


  33. Wow, thats was fast… thanks for the wonderful plugin, I am using and will update.

    Miguel


  34. Hi – really useful plugin with one problem which means I can’t use it. I’ve just noticed that it displayed one of my ‘pages’ instead of one of my ‘posts’, even though pages don’t fall into any of the categories – is it possible to exclude ‘pages’?

    Paul


  35. @Paul:

    Good catch. The plugin has been updated with the option of displaying posts and/or static pages.

    Scott


  36. Sounds good, and I would like to try this plugin but after bouncing back and forth between this page and the WordPress plugin page I cannot find it.

    Where is it?

    DigitalZip


  37. @DigitalZip:

    The link is at the top (I just added) and bottom of this page. It takes you to the WordPress.org Plugin Directory where you can find the download link on the right side of the page in an orange box.

    Scott


  38. Thank you Scott. It’s not very obvious on WordPress that you should click on the orange download box. Well it isn’t to me :-)

    Got it now anyway.

    DigitalZip


  39. Hi Scott
    I was the first commenter here and just wanted to say thanks for your neat plug-in and for being such a responsive developer. It’s really appreciated especially by those of us who are ‘challenged’ by all this coding stuff! :-)

    I’m part of the comment08 challenge running right now to increase communication round the blogosphere, and thought I should say thanks to people who make my blogging life much easier. You’re on my list!

    Best wishes.

    Kate Foy


  40. Wow, that was quick! Since my comment I have been dabbling with using multiple loops within WordPress, and found that this is also a good way to display a single random post alongside my usual homepage content. I’ll use that route in the interests of keeping plugins to a minimum, but this is certainly useful for those who don’t want to delve into advanced stuff like multiple loops.

    Paul


  41. Thanks Scott. Given the series of improvements that you have introduced to your plugin, I guess comment #24 has helped it realize its full potential, that there’s a big community out there looking for this kind of plugin. Good work! ~ Pam

    Pam


  42. Glad to see others are finding this useful.

    Spread the word!

    Scott


  43. hi. Thanks for plugin

    perfect.

    regards

    baron


  44. Hi Scott,

    I wanted to add this code into single.php to showw my featured articles in top of each post.

    On my Homepage it works fine but in single.php it always displays the full post?

    Best wishes

    Daniel

    Daniel


  45. @Daniel:

    Are you using the most recent version of the plugin? I’m unable to replicate the problem you’re having. Please check your settings and make sure you’ve selected “display excerpt” under the content options.

    Scott


  46. Hi, Scott.

    Thanks for a great plugin. I’ve got it working pretty well.

    I’d like to see the date of the featured post show up with the post and excerpt. Could you help me with the code for that?

    Thanks!

    Wardeh


  47. @Wardeh:

    I thought about including the date but decided against it because typically a “featured” post would be an older post from deep in your archives and highlighting the date might keep readers from clicking through, or at least that was my thinking.

    If you want to add the date you’ll need to modify the code. Look towards the end of the show_featured_post function and in the place of your choosing insert the line
    echo date(“F n,Y”,strtotime($thepost->post_date));

    Scott


  48. Hi Scott,

    I use 2.3.3 and K2. The problem is, that the same functions has different results. On my homepage everything works fine, but in single.php I got the whole article.

    No, I use full content with “more-tag”. If I switch to “excerpt” everything works fine.

    Daniel


  49. @Daniel:

    I hadn’t tried the full content option with the more tag on a single post. I found the bug and the plugin has been updated. Thanks for bringing it to my attention.

    Scott


  50. hi scott, thanks a lot. hope your private million dollar plan works :-)

    but there is another mysterious behaviour. on the homepage it works again fine, but now after the more tag, only on single page, I get the list of related articles inside it?

    Daniel


  51. @Daniel:

    I’m guessing this is because whatever plugin you are using to generate the related articles is hooking the function that displays the formatted content. I’m not sure how to get around this. What plugin do you use for related articles?

    Scott


  52. @Daniel:

    I just glanced at the code for that plugin and I’m near certain that’s the issue. You can probably test it by disabling that plugin. I’m not sure how to get around that, but I’ll do some thinking and let you know if I figure it out.

    Scott


  53. You’re right. When I disable the plugin everything works fine, as it should.

    It’s a pitty, because I like simple-tags for managing the tags very much. Hope you find a solution.

    Daniel


  54. but for the moment I decided to disable the related posts, because your way of featuring articles is much more attractive.

    Daniel


  55. @Daniel:

    I’m glad you find the plugin so useful. Until I can find a fix, you might want to check out another plugin to do the related posts. We use Similar Posts here and I’m happy with the way it works.

    Scott


  56. I’ve successfully done steps 1-5 but 6 is where I get confused… what does it mean to place a call? and what is a loop… What exact code should I be placing in my index.php per theme??

    Linz


  57. @Linz:

    In index.php look for the line that has “while (have_posts())” in it; that’s the start of the loop. Just before that line place the code from the first example above, making sure to include it between the “” tags.

    Scott


  58. Great plugin. Anyway, can it be inserted into the page/page?

    Thx

    gofree


  59. @gofree:

    Yes, but if you read the other comments you’ll see that it may conflict with some plugins.

    Scott


  60. Hi Scott,

    I am trying to call it using this show_featured_post() with Adman plugin to have the featured post appear on the top of index in homepage, but it seems not working as it shows the code show_featured_post() back.

    Did I do sth. wrong.

    Thanks

    gofree


  61. @Scott. Great tipp. Thanks again.

    Daniel


  62. Working perfect on my site, I enjoyed the new implementations and support. Good Word :)

    Miguel


  63. Hi Scott,

    Great plugin. It displays my posts excerpts with no problem. However, when I go to display my pages it shows nothing.

    Have I done something wrong?

    Sheri


  64. @Sheri:

    I checked out your site and I see you’re using it on all of your pages… maybe I don’t understand the problem you’re having? Also, the formatting for the featured post is aligned too far to the left on Firefox 3 and IE 7.

    Scott


  65. Scott,

    Thanks for looking. They show up as long as I have posts and pages checked, but if I just check pages – which is what I would like to do – the entire box disappears.

    I am running a browser check via browser shots right now. If it is aligned too far left I am unsure what to do – as moving it will mes it up in other browsers. Any advice would be very helpful.

    Thanks again
    Sheri

    Sheri


  66. @Sheri:

    Maybe we have our terminology mixed up. The “static pages” referred to in the settings are things like an about page or archive page which are managed in a different section of WordPress. Can you be more specific as to the problem you’re having?

    As far as the alignment, CSS is not my thing so I can’t help you there.

    Scott


  67. lol, CSS is sometimes a savior and other times a pain.

    WordPress has posts and pages. In my pages section I am using eshop for my shopping cart. What I would ideally like to do with this plugin is use it to display random items from my pages – not my posts. Does this help at all?

    Sheri

    Sheri


  68. @Sheri:

    Ok, I understand your problem. Unfortunately, WordPress doesn’t allow you to categorize pages. I’m not sure how one of the previous commentors had static pages show up, I assume another plugin was being used. I did find this plugin which claims to tag static pages but I’ve not tested it. Feel free to give it a try and let me know if it works.

    Scott


  69. Again please,

    Hi Scott,

    I am trying to call it using this show_featured_post() with Adman plugin to have the featured post appear on the top of index in homepage, but it seems not working as it shows the code show_featured_post() back.

    Did I do sth. wrong.

    Thanks

    gofree


  70. @gofree:

    Then you’re not putting the code between the php tags. I would recommend you find a tutorial on modifying WordPress themes; explaining how to do this is beyond the scope of this page.

    Scott


  71. Thanks anyway, Scott.

    gofree


  72. Hi,
    i love this plugin and i’ve installed it on my server.
    Only a question, how can i use this plugin in different page with different code?

    Example:
    I need that on the homepage this plugin give me only three featured post.. but i want that on “archive” this plugin give me ten featured post (of the same categories).. is it possible?

    Thanks.
    Andrea

    Ska


  73. I found it,
    thanks anyway ;)

    Ska


  74. Hey great plugin… coming in handy a lot!

    Works great for me right out of the box.

    Thanks!
    Chris

    Chris McCorkle


  75. Excellent script.
    I wanted to modify it so that it only displays the posts title, and reduce the space between the
    “featured post:” headline and the posts title.

    roger


  76. @roger

    If you want to eliminate the post content/excerpt you’ll have to modify the code… look for the echo lines near the end of the code. I’ll think about adding this as an option next time I update.

    You can reduce the space between elements using CSS, but I’ll leave that up to you, I’m not an expert.

    Scott


  77. Hi Scott and thanks for this plugin. :)

    Is it possible to display featured posts by tag and not by categories?

    Aldo


  78. Hi, Scott. Nice Plugin, Iam trying to display random posts from the Feature Category on the home page,above the normal content, but if the post is the latest post and is from the featured Category, There are duplicates being displayed.

    Can you suggest how to remove the 2nd duplicate, and let the random post from your plugin be displayed on the homepage.

    venkat


  79. @Aldo: I’ll put it on my to-do list, but it might take me a while to get to it.

    @venkat: The best I could do is return the post ID from the function. Then it would be up to you to check for the post ID as you go through the loop. Would that work for you?

    Scott


  80. please help i got this error :

    ————–
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) ORDER BY RAND() LIMIT 1′ at line 8 on line: 202————–
    i use WP 2.3

    regards

    dr801


  81. @dr801:

    It looks like you haven’t selected any categories in the options pages.

    Scott


  82. Scott… great plugin.

    One issue: I am using another plugin “Custom Field Images”, so that I could place an image ABOVE the Title. This works fine on the Full Post, however to get a thumbnail, I have had to add it separately into yet another custom field, which does not now show up in “Random Featured Posts”.
    I know there is another way of getting the thumbnails in place, and that is by creating an extract option, and duplicating.
    I am unsure what to do!
    Any suggestions? See index page with one example of Painting with title below, that appears in my Mini-post view below the Featured Post.

    Thanks
    Peter

    Peter


  83. @Peter:

    I’m not clear on what your problem is exactly because I don’t see an image on the featured post of your page; however, this sounds suspiciously similar to the problem Daniel was having (see comment 51). Basically, your other plugin is most likely not compatible with this.

    Scott


  84. Thanks for the post

    Best

    diegogue


  85. great wp-plugin!

    autworld


  86. Hi Scott,
    this plugin seems very good. I wonder if this plugin can choose the post date rather than by category. Exactly all posts published in a time interval.
    Thank you and sorry for my english.

    Alessandro

    Alessandro


  87. The plugin shows the correct title of the random post but the content is the same of my latest post. Did I something wrong?

    Novecento


  88. @Alessandro: I’ll see about adding to future version, but I don’t have plans to update in the near future. Sorry.

    @Novecento: No idea… maybe you put the function call inside the loop. Also, make sure you’re using the most recent version.

    Scott


  89. The function call is placed before the if (have_posts() loop and i’m using the 1.1.3 version

    Novecento


  90. Didn’t know if this would help, but maybe you can use the custom fields to apply a mock category structure to static pages? You know, assigning a key and value that you can call in this plugin to only pull certain pages to display.

    Personally, I want to know if it is at all possible to shortcode this plugin so it can be brought into a page, rather than page.php. Like say I want to have my homepage show a page rather than my posts, and put this plugin into the page I select as home, to show a featured post. Basically making this plugin part of one specific pages content. Any ideas?

    Bryson


  91. @Bryson:
    You can check for the page ID and only execute the plugin function for a specific page like this:

    global $post;
    $postID = $post->ID;
    if ($postID == 123) show_featured_post();

    Scott


  92. @Scott

    Thanks for the quick response. That looks like it might work very well for me, I’ll test it on my home app and see. Thanks.

    Bryson


  93. That works pretty well, except that the page title keeps showing in the page as if it’s just another page. Still gotta sift through it and find a way to drop it from that page since it’ll be my home page.

    Also gotta adjust the styling for the output of this plugin since I’m just using it as a part of a page, but rather as the page.

    Thanks again Scott.

    Bryson


  94. @Bryson:

    Just use the same code as before at the part where the title is displayed except modify the if line like this:


    if ($postID <> 123) // display title here

    That shows the title on all pages except page 123.

    Scott


  95. I actually went another way, and from the looks of it, the hard way. I’m not a php whiz by any means though I can manage at times.

    Here is what I have

    [code]ID;
    if ($postID == 18) { show_featured_post();
    } else { if (have_posts()) : while (have_posts()) : the_post(); ?>

    [/code]

    It keeps any part of the wp page from showing if $postID is 18, and if it’s not, then I don’t want the featured post to show up, so it goes on to exclude the plugin output in favor of the page content. Works for me ;)

    Bryson


  96. And is it just me, or does IE7 really not like ajax? I couldn’t edit the post to take out the bbcode after it didn’t work. Seems to be like that a lot.

    Bryson


  97. Hi there!

    Is it possible to just extract a random page ID to use for other purposes?

    I am using the MimboPro theme and would like to present a random leading article from one or more categories.

    Best Regards Krezz

    Krezz


  98. take a look at my homepage, http://www.brokesanity.com. Look in the red section of the header and tell me if that’s what you’re looking for.

    I used, and quite easily I mitgh add, recent posts plugin to accomplish this.

    Bryson


  99. Thanks this is exactly what i am looking for!

    Richard


  100. I dont why but suddenly it starts to show only full post, and not the WP excerpt anymore. I have checked the option to display excerpt in conf.

    Miguel


  101. Hi, Firstly thanks for your excellent plugin, secondly is there a way to reduce the number of words output in the extract?

    Jon


  102. @Jon:

    Strictly speaking for my plugin, other than creating your own custom excerpt under the advanced options of your post, no.

    You can try another plugin like Advanced Excerpt at http://wordpress.org/extend/pl.....d-excerpt/ but I don’t have any actual experience with it.

    Scott


  103. or you can fill the excerpt field in “advanced options” (below the post field), is absolutely compatible with random featured post plugin, and anyone other plugin is needed

    diegogue


  104. I wish to have my front page display a random featured post. How do I do that?

    I tried creating a page with the code suggested

    and the page just shows the code.

    thanks for any help,
    David

    david


  105. Got it to work. (I didn’t want to have to edit the loop, but realize that’s the only way)

    Thanks for the great plugin. Now that I don’t write often, it’s nice to have something different show up every time someone visits.

    David

    david


  106. Sorry…I’m back. I want the featured post to display only on my home page, not on post pages.

    How do I “call” that in the code?

    thanks,
    David

    david


  107. Figured it out by trial and error

    and I can’t enter the code here….so I guess I’m done.

    thanks,
    David

    david


  108. Scott,
    Using your plugin at my site.
    Thank you. :)

    P.S: Is there a way to not show the photos in the featured post section…show only the excerpt?

    katya


  109. Scott, I am donating to your account for your hard work. And, I am adding a second request to comment 109 to add a feature to choose whether to eliminate photos.

    Thanks,
    David

    david


  110. @katya:
    Images do not show when you select the excerpt option… check to see if you’re actually displaying the full content with a more tag, which appears similar to an excerpt.

    @david:
    Thanks! See my reply to katya. Do you want an option to eliminate images regardless?

    Scott


  111. That works. Thanks. I was using the Advanced Excerpt Plugin, which also probably has a way to eliminate photos with longer excerpts, but your option works fine for me for now.

    Thanks,
    David

    david


  112. Hi Scott,
    I have selected the excerpt option. However, I see the image. Is it because of the layout of my site?

    Cheers.

    katya


  113. @katya:
    I’ve tried but I’m simply unable to replicate the problem you’re having. I checked the site you linked to in your sig but I don’t see the featured post running. I suppose it could have something to do with your layout, but more likely it’s an incompatibility with another plugin.

    Scott


  114. Thank you for your patience and your quick replies Scott
    When I learn more of php, I should be able to figure these problems out for myself. : )
    I have installed the plugin in the posts and not on the home page. Here is one such post.

    http://theyoungindia.com/?p=312

    Hope this plugin gets more popular.

    Cheers.

    katya


  115. Hi Scott,

    I am trying to edit the plugin to show images like Kristin did but cannot find the lines in the featuredpost.php file.

    I am using Version: 1.1.3. Maybe the next version could have the image option built in?

    If you could let me know where to look it would be great.

    >>>>>>>>>>>
    Look for the lines

    $desc = attribute_escape(strip_tags($post->post_excerpt));

    and

    $desc = attribute_escape(strip_tags($post->post_content));

    and replace them with

    $desc = attribute_escape($post->post_excerpt);

    and

    $desc = attribute_escape($post->post_content);

    Flavio


  116. @katya:
    That is definitely not the excerpt showing, it is the full post with a more tag, that’s why the image is showing. Please check your settings again. Try changing them around to see the difference.

    @Flavio:
    You’ll have to use the full content setting for an image to show. You’re on your own if you want to try to edit the code.

    Scott


  117. Hi,

    I dont knwo what I’m doing wrong. I have the following pasted to the bottom of my index.php document and nothing happens. Any idea as to why?

    <?php if ( function_exists(‘show_featured_post’) )
    if (is_home() && !is_paged())
    show_featured_post(”,”); ?>

    jenny


  118. I can’t for the life of me figure out to arrange it so that when showing more than one featured post that they are side by side rather than underneath each other..=/

    I’ve messed around with the css on that particular section marked “Featured Post”.. but cant seem to figure it out.

    Any Css ideas? Or is this something I’d need to change in the plugin code?

    Timothy B’s last post: teensy green

    Timothy B


  119. Not sure if it can be done with this plugin, if not, check out a site called perishable press, and search it for “double columns”. it will show you a very easy way to use multiple loops that post side by side.

    bryson


  120. I might try to run a second plugin called Advanced random post and just run that on the right side of the ..

    Timothy B


  121. Well I’ve just called two instances of the plugin in the two different hoping that the same featured post won’t show up at the same time =/ That seems to be the only workaround to the CSS issue..

    Timothy B


  122. You could check the codex as well, depending on how you’re featuring articles. If you’re just pulling random articles, it’s more coding, but the rand() feature seems to work pretty good for it. Might give you more options for multiple featured articles. I actually did it a while back without any problems though. I had five featured article sets that I was pulling from five different categories. It can be done with this plugin quite nicely.

    bryson’s last post: Good Start for Chrome

    bryson


  123. @Timothy B and bryson:

    You can use this plugin alone to display two columns of featured posts side-by-side, but the formatting is a CSS issue. Off the top of my head, I believe you’ll need to enclose 2 div elements inside another div and set the float value of each.

    In order to avoid randomly showing the same featured post in both columns, you’ll need to override the category ID in the function call for each column, specifying different category IDs. See example 2 above.

    Scott


  124. Hi,

    I’m trying to include your function call in a little content box on the top of my blog. But nothing is showing up, I’m using this line:

    <?
    php show_featured_post();
    ?>

    The plugin is installed and on the options page all the requiered choices are made. What am I missing here?

    Echtzeit


  125. Hi

    Great plugin. Is it possible to use this plugin within the category pages as well? i.e it features posts not just on the home page but within each category.
    Many thanks
    Lynne

    Lynne’s last post: Part Two Of RSS & Google Reader

    Lynne


  126. @Lynne:

    Yes, but that will require you to do some coding in your theme to determine if you’re displaying categories. This is not really related to the plugin.

    Scott


  127. No answer for me? :(

    Echtzeit


  128. @Echtzeit:

    Try not to take this the wrong way but I really can’t answer every “Why is this not working for me?” question unless you want to give me the admin password for your blog. Without an error message or specific question I can’t really help you. Plus, I see some sort of featured post thing on your blog with an error message that doesn’t appear to come from my plugin.

    Scott


  129. Ok, I got it working now, very strange ;)

    Now I have another question, the plugin “category-icons” is showing user defines icons next to the post title. In the index.php the code to invoke it, goes just in front of the “the_permalink” tag.

    The code looks like this:

    http://pastebin.com/d72364c58

    Is it possible to show the icons next to your featured post as well? Where do I have to put it in your `”featuredpost.php”?

    Thank you, for your time!

    Echtzeit


  130. I added this plugin in my blog. But i want to customize Title Font Size and want to add some styles. Can you plz tell me where i can edit those options? Thanks

    Jim


  131. i would like to display more than one featured article on my front page.

    is there a way i can make sure that i do not get repeat featured posts

    thanks for the plugin

    Steffen


  132. @Jim: You’ll have to change your stylesheet. CSS are not my strong point so you’re on your own.

    @Steffen: See comment #28 above.

    Scott


  133. Aloha! I’m digging this plugin as it’s perfect for what I’m trying to accomplish. Is there any way to NOT have the “Featured Post” header? That option would be great! Is there a way to hack it? Other than that, it rocks! Thanks so much…

    Patrick Iverson


  134. @Patrick:

    You can try hiding the h3 title using CSS. Not sure if this will work but off the top of my head,

    .featuredpost h3 { display: hidden; }

    Or you can edit the plugin itself and remove the line,

    echo “<h3>”.$div_title.”</h3>n”;

    Scott


  135. wow. thank this is what I was looking for. you could also add some examples of this plugin in use. thanks

    hellows


  136. Hi Scott,
    first, thanks for a great plugin, its exactly what i was looking for…well, except for random thing :).
    Is there a quick hack to show posts by date instead of random. I’ve tried other similar plugins as mentioned in the comments (wp-sticky, featured category) but they just don’t do it for me. I have heavily customized theme and want a block with featured news for that day (its a news portal) so random is not preferred. I was looking at the code and saw

    .$sqlcat.” ORDER BY RAND()
    could this be modified into date order?

    Thanks again!

    perke


  137. @perke:

    You could try replacing “RAND()” with “$wpdb->posts.ID DESC” to show the most recent post.

    Scott


  138. PERFECT!! Thanks a lot, donation is on its way ;)

    perke


  139. Hello guys ! Is there anyone knows how I can include the content image to the random posts ?

    Thanks
    Joe

    josef


  140. I mean the Display excerpt with content image ..

    thanks again

    josef


  141. This is a really good plugin

    Time Synchronisation


  142. Hello,

    I’m very new to coding but I activated the program but what exactly must I do to activate the plugin on the homepage. I want it just above the new posts for today and just by putting this in the index file “show_featured_post()” doesn’t activate it.

    Jason


  143. hey,
    I tried this on v2.7 and it doesn’t seem to show up at all.
    Is there any code im supposed to paste in the area i want the featured post to appear?
    thanks

    Khaled


  144. Hi Scott,
    Love the concept here, but I can’t get this to work. I’m trying to paste in the following into my page_frontpage.php file, but the random post doesn’t show up. I’m a true beginner with PHP so do not know what I’m doing.

    I’ve uploaded to the plug-ins folder, activated and selected categories/checked the display featured post box.
    Thoughts?

    I’m wanting to place the Random post on my frontpage – this is a different page to where my posts normally show

    Gareth


  145. I have read entirely of this post but can’t seems to get this plugin to worked,

    I have install, activate, modify the plugin option and replace the following code in my index.php

    But it doesn’t worked, strange.. are these plugin doesn’t compatible with WP 2.7??

    Takumi86


  146. Somehow I just got this to worked, thanks
    btw, do you know any good plugin to show slideshow post??

    Takumi86


  147. I figured this out without using the plug-in… Thanks anyway!

    Gareth


  148. I’ve reopened comments on this page (sorry, didn’t realize they were closed). However, I haven’t done any development on this for a while and I don’t have much time to work on it right now. Please keep that in mind before posting.

    Scott


  149. CSS Help
    I have this plugin installed and working well. I want to change the title of the featured post to a larger text. I want the title only to be larger than the titles on the other blog post.
    Can someone help me with this?

    Jon


  150. Scott — Wow! What a great plugin! I only have one question that I haven’t seen anyone else ask.

    When I use your plugin (at my test site at http://www.tribblogs.com/wpmu ) it looks like WPMU is showing both the thumbnail associated image and the full-size image. Any guesses as to why?

    Thanks so much!

    Josh


  151. Been trying for a few hours to get this plug-in to work to no avail.

    What is the exact code to put in the Main Index Template?

    Do I need to modify anything?
    I’ve followed the instructions but the following keeps showing up at the top of my page:

    if ( function_exists(‘show_featured_post’) ) if (is_home() && !is_paged()) show_featured_post(”

    Also, on the plug-in dashboard page within wordpress, I get the following error to the right of the Featured post checkbox:

    Table ‘dailwri8_wrdp2.t’ doesn’t exist on line: 126

    http://www.tribblogs.com/wpmu


  152. thanks a lot for the amazing plugin….

    WordPress Mover


  153. @http://www.tribblogs.com/wpmu

    try this and u’ll be fine…

    ” ”
    the thing that u missed was the ‘php’ tags….
    moreover in the above code, i haven’t passed any of the optional parameters…. u can pass if u want…

    PS: the code is being stripped off …:(

    just add the php tag before the first if and then close it after the semicolon of the featured_function…

    http://sapan.co.nr


  154. Is there any way to have featured post display an image pulled from the post gallery aside from having an excerpt and a link to the actual post on the sidebar?

    Andrew


  155. hi i use this plugin tree page in my website. but it isnt work with three page.it only work my homepage .
    can u solve it

    ali


  156. Hi Scott, this plugin is great. It’ll fit the new blog perfectly (although not even close to completion).

    I’m not a php expert, but after looking at the code, this is what I changed to allow the code to display the post image the way I wanted it to. It uses the Custom Fields to display the image.

    I’m not sure if it is the most efficient way of displaying the image, but I do know that it works.

    echo “\n”;
    if (get_post_meta($thepost->ID, ‘large_preview’, true)) {
    echo “ID, ‘large_preview’, true);
    echo “$featured_img”;
    echo “\” alt=\””;
    the_title();
    echo “\” />
    “;
    }
    echo “”;
    echo “post_title);
    echo “\”>”;
    echo apply_filters(‘the_title’, $thepost->post_title);
    echo “
    \n”;
    echo “Posted on “;
    the_time(‘F j’);
    echo ” in “;
    the_category(‘, ‘);
    echo ” by “;
    the_author_posts_link();
    echo “”;

    Hope this helps…

    Thanks again!

    Aleks Blagojevich


  157. I jumped the gun on the previous post. Using the previous code, when you click the image it won’t go to the correct post.

    Here it is, corrected. However, since I don’t know how to post the whole code, I’ve uploaded a text file with just the edited part of the plugin.

    And of course, the CSS can be adjusted for each of these elements as well as the classes and IDs of the CSS selectors.

    Again, great plugin Scott. Truly great work!

    http://www.blagodesigns/dev/sc.....edited.txt

    Aleks Blagojevich


  158. I was searching this type of plug in and I got it from here
    Thanks!

    mcse practice questions


  159. Does this plugin supports WordPress 2.8.X? Thanks.

    Publicidad en Internet


  160. I have an issue with the Simplepress Forum. The created link to the forum in the post alters to show the same forum post as the first post in the category. When viewing the posts directly the urls are ok. Anyone have any idea where I should look to sort this out as the random plugin works great apart from this.

    Mark-Jones


  161. Hi man! I liked the idea, but when I tried to use your plugin I got this error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) ORDER BY RAND() LIMIT 1′ at line 8 on line: 202

    any ideas?

    Johnny C


  162. ops, my bad. just saw that you already answered that before talking about the categories.

    can’t you make it so when no category is chosen, all apply?

    http://www.proveisso.net


  163. Hey ,
    i was using this normally but suddenly i get this error ;
    Table ‘mehmetka_soyyac.wp_posts’ doesn’t exist on line: 202

    my wordpress table is mehmetka_wordpress . how can i fix this error ( change mehmetka_soyyac to mehmetka_wordpress ) ? i looked my pma and db is okay ..

    Deniz


  164. Plugin looks great.

    I tried some of the instructions further up the this page and my featured post appeared, however it knocked my sidebar to the bottom of the page below all my other posts.

    Also the featured post changed everytime I refreshed is that supposed to happen?

    Regards

    Paul

    Paul


  165. How to add / display the thumbnail on each post?

    Triindi


  166. Hi. Scott, I, like others, love this plug-in.

    I notice that back in 2008 someone asked you if there was a way to include images. You provided some code but it looks as though you incorporated the change in later upgrades, no?

    Yet, I can’t see how to get the images to show up. Is it possible?

    Thanks a million!

    John

    John K


  167. How would I add the ‘Comments(0)’ to the bottom of the featured post?

    Lacuna


  168. I can’t figure out where to put this code

    Some have said “outside the loop” but what does that mean? Am I looking for index.php?

    Marcus


  169. Very Good Plugin

    pitbull


  170. Hi Scott,

    I just upgraded to WP 2.9 and I’ve been displaying this plugin with the following line inside of a div:

    <?php show_featured_post(); ?>

    Since the upgrade, this code doesn’t seem to work. No text at all shows up inside the div. Any idea if this is due to an incompatibility with 2.9?

    Thanks for your help and your hard work!

    Kristen C


  171. Great plugin!

    But, don’t works with WordPress 2.9.1. !

    fixed , please!!!

    ( sorry, my english … ;) )

    venenbluten


  172. Hi Scott,

    great plugin. When will there be an Update for version 2.9?

    Thomas

    Thomas


  173. Is there any way to change the “Read more ->” text displayed by default when you choose to not ignore the tag? I would like it to say something like “Click here to read full story”. Ideas?

    Mike


  174. I am using WP 2.9.1 and it works great. I am diplaying 5 random posts on a page. Is there a way to put an AJAX refresh button on the display so that someone can pull a new list of posts without refreshing the entire page?

    Derrick


  175. can anyone help me, I only want this to display on my Welcome “static” page but it shows on all my “Static” pages, is there anyway I can set it to only display on 1 static page, or is it possible to display different catagories on different pages?

    Colin


  176. HI there im looking for some help with this plug in..

    i would like to show featured posts when categories 67, 24, and 1001 are current

    Any help would be appreciated

    Thanks..

    Stuart


  177. Hi Scott,
    Is there a way to display more than one post?

    MJ


    • MJ,
      Way I did it is by pasting the function twice.
      e.g.
      show_featured_post();
      show_featured_post();

      Steve Harris


  178. hi there! I installed WP3.0 unfortunately plugin is not compatible so I am having a blank screen.

    When do you think that we can upgrade it, so that continue to use it.

    Very nice plugin thanks for the efforts.

    aydincan


  179. but there is another mysterious behaviour. on the homepage it works again fine, but now after the more tag, only on single page, I get the list of related articles inside it?

    answerinthebox.com/


  180. Hello ,
    please can you tell me what code I should insert in the main index exactly ?
    you say make a call to “show_featured_post() ”
    and I can’t do that coz I don’t know in php codes
    so If possible tell me what should I insert in the theme templates
    All I done was downloading, installing and activating the plugin , then I made the right options .
    But the plugin didn’t appear at all at my site .
    So can you help in that ?
    Waiting your answer
    Thanks in advance

    Ahmed Amer


  181. Great plugin!

    Trying to get the page title to change and match the random post.

    wp_title either shows the last added post to the DB or blank…….

    eddie


  182. Hello!
    Thanks for this great plugin!

    I have a question:
    How can I show a random post from more than one category?

    My Code:

    <?php if ( function_exists('show_featured_post') ) show_featured_post('Team Feature’, ”, true, 19); ?>

    I want to use the categories: 19, 20, 21, 22, 23, 24, 25, 26. Not only the 19.

    I know that it worked, when I use the functionality of the Admin-page. But I use the plug in on 3 places in my template to show different categories and so I must use my own code 3 times.

    Thanks!

    Florian



Powered by sweet Captcha