Sneak Peeks Widget

Posted on Saturday the 23rd of June, 2007 at 5:56 am in Widget

Updated June 23 2007 — added WP 2.2 Support, removed 2.0 support, added ability to restrict sneak peeks to specific categories.

The Sneak Peaks widget allows you to list some of the upcoming posts on your site to allow visitors to get a glimpse of what is coming and encourage them to return. The widget is very simple, but allows you to customize the title, number of posts shown and the display text of each sneak peek using some simple tags.

You can download it here:
Sneak Peaks Widget 1.7 (Wordpress 2.1+)
Sneak Peaks Widget 1.6 (Wordpress 2.0, 2.1)

Installation is very simple. Just unzip the .zip file and upload the .php file to your plugins/widgets folder. Activate it in your plugins menu and then go to your Presentation>Sidebar Widgets menu and customize to your heart’s content.

Related posts

  1. jazzle posted the following on July 8, 2006 at 6:51 am.

    Nice idea!

    I suppose it’ll even work with unwritten articles, just save an empty post with a future date – could even cajole me into writing more!

    Reply to jazzle
  2. Watchman posted the following on November 23, 2006 at 3:42 pm.

    Great idea for a widget! We could really use this, especially since we’ve got several different authors and people come daily to see what’s new. It’d be nice if people could also see what’s about to get posted. The problem is I can’t get it to work. I’ve got a draft article saved and ready to be posted next week. But it doesn’t show up in Sneak Peaks. Please see our site and let me know if you have any idea why it’s not working.

    Is there a way of making it display not only the title but also the author? Since these are the only tags I’m assuming not:

    Tags Availible:
    %t – Displays post title
    %d – displays time and day the post will be available
    %c displays the amount of time until the post is available

    How does Sneak Peaks know “time and day the post will be available”? Is it using the time/date stamp on the article itself?

    Reply to Watchman
  3. Aaron posted the following on November 24, 2006 at 2:07 am.

    The problem is I can’t get it to work. I’ve got a draft article saved and ready to be posted next week. But it doesn’t show up in Sneak Peaks.

    It has to be published with a future date for it to show up.

    Is there a way of making it display not only the title but also the author?

    It can’t currently, but I’ll add in the ability within a day or two.

    Is it using the time/date stamp on the article itself?

    Yes, the plugin assumes that you write posts ahead of time and then just schedule them for later.

    Reply to Aaron
  4. Watchman posted the following on November 24, 2006 at 11:40 am.

    Got it! We’re new to WordPress and didn’t realize that you could publish an article based upon the timestamp. Very useful feature!

    Using the %d function displays as “Coming 1164636009:” How do I get the time and date to display correctly?

    Also it doesn’t appear that Sneak Peaks is using our style sheet (CSS).

    Reply to Watchman
  5. Aaron posted the following on November 26, 2006 at 11:45 am.

    The first part is fixed, but I’m not sure what you mean by not using your css. The plugin uses the default before and after the widget. Inside the widget it just uses an unordered list.

    Reply to Aaron
  6. Marty posted the following on January 22, 2007 at 6:09 am.

    Cool I like this page.

    Reply to Marty
  7. Vishwas posted the following on January 24, 2007 at 7:19 am.

    The plugin does not work as it should in WP 2.1. I have lined up 3 posts for future dates but none of them are displayed in the widget. It worked like a charm upto WP 2.07. Even your site does not have any upcoming posts (but that could be because you are on a break). Please look into the matter and let me know of any workaround.

    Reply to Vishwas
  8. Aaron posted the following on January 24, 2007 at 1:24 pm.

    That is because wordpress changed the way future posts are marked. Give me a few minutes an I’ll upload the updated version.

    Reply to Aaron
  9. Daryl posted the following on February 5, 2007 at 1:29 am.

    I see you updated your plugin for 2.1 but I am still having problems seeing the sneak peek in action. Your file stamp is Nov-25 for the one I can download on your site.

    Reply to Daryl
  10. Aaron posted the following on February 6, 2007 at 12:07 am.

    I apologize, something must have happened. It has been fixed.

    Reply to Aaron
  11. Daryl posted the following on February 6, 2007 at 12:39 pm.

    thanks for the update! it works great on WP 2.1 now. Your widget is something that should be just a default part of WP since it is great!

    My viewers just really love seeing the articles that I am planning to release in the future. This widget along with the countdown calendar plugin adds so much to a WP site.

    btw, something to note, if you don’t have any future posts, the widget will not display the Sneak Peek box on your pages. Which is also good because I don’t want people to think that because I have no future posts pending that stuff is not being worked on.. So out of sight, out of mind for those viewing!

    Reply to Daryl
  12. Dean posted the following on March 10, 2007 at 3:04 pm.

    Great plugin! Thanks for releasing it for all of us to enjoy.

    Reply to Dean
  13. Jonathan posted the following on April 16, 2007 at 9:23 pm.

    Nice idea! I think I may try this one out on my site along with your calendar plug-in. I have so many different posts and ideas that I get them all jumbled up and mixed up. I’ll post you a good review if all goes well.

    Reply to Jonathan
  14. Ed Cooper posted the following on June 1, 2007 at 1:18 am.

    I’d love this plugin if it worked but it doesn’t seem to show anything in WP2.2. I’ve even tried calling the plugin and using it as a static plugin in my sidebar but still nothing is shown. Is there anything I can do to get it working as at the moment we are having to write future posts in a list in the sidebar and change it everyday, quite annoying due to the fact we have alot of posts lined up for the next few months. Are you updating it soon for WP2.2 or know of any workarounds? Any help would be a great help to us!
    Cheers,
    Ed

    Reply to Ed Cooper
  15. Richard posted the following on June 1, 2007 at 2:34 pm.

    I have the same problem as Ed, WP 2.2 and sneak peak doesn’t show a thing. Future Post still works awesome though, keep up the good work, you rock. My favorite plugins so far.
    Richard

    Reply to Richard
  16. Gallivanter posted the following on June 2, 2007 at 8:50 am.

    I agree, this is a kickass plugin and I’ve been using it for quite some time now, and yeah, it doesn’t work with WP2.2.

    Reply to Gallivanter
  17. Michael posted the following on June 4, 2007 at 12:31 am.

    Any thoughts on how to modify it to work with 2.2? Or when that might happen?

    Reply to Michael
    1. Michael posted the following on June 4, 2007 at 12:36 am.

      Hah! Found it… It’s a quick hack, but it works. On line 30:

      change
      if($wp_version == 2.1)

      to
      if($wp_version == 2.2)

      Not backwards compatible, but it works.

      Reply to Michael
      1. David posted the following on June 20, 2007 at 11:03 am.

        Better to use if($wp_version >= 2.1) to at least make it forward compatible.

        Reply to David
  18. Gallivanter posted the following on June 5, 2007 at 8:24 am.

    Michael, it works! Thanks a million! :-)

    Reply to Gallivanter
  19. Ed posted the following on June 5, 2007 at 4:50 pm.

    Doesn’t work for me :( Do you need over 5 upcoming posts for it to show posts? I tried changing that before when i had over 5 upcoming posts and it didn’t work then either :/

    Reply to Ed
  20. Mosey posted the following on June 15, 2007 at 10:36 pm.

    I can confirm this works for me using 2.1.3. I was wondering how easy it was to actually link to the upcoming post in question? I’m actually using this funky widget to display upcoming events, so that when visitors click on the title, it will take them to the details page.

    The widget-customising interface does seem to take HTML, so I’m assuming what I need to do is use something like
    Coming in %c:%t

    Any help would be really appreciated! :D

    Reply to Mosey
    1. Aaron posted the following on June 16, 2007 at 12:42 pm.

      It would be fairly easy to make a link, but Wordpress won’t allow the future post to be displayed to a user, so it wouldn’t help.

      I’ve had enough people request it that I have considered creating an events calender version of this plugin.

      Reply to Aaron
      1. Mosey posted the following on June 16, 2007 at 5:02 pm.

        Thanks for your helpful reply! Sorry to read about the limitations of Wordpress, but I guess it’s also understandable!

        I’ve been searching on the WP support forums about future posts/timestamps, and was wondering if the new plugin would be able to support future display of events (with details from e.g. Custom fields?)

        Not being a programmer/php-savvy, the posts that looked rather useful included: this and this post(s).

        Either way, I’ll verymuch look forward to the potential release of an events calendar plugin! Thanks! :)

        Reply to Mosey
  21. Mosey posted the following on June 15, 2007 at 11:00 pm.

    Also, how easy is it to ask the widget to only call from posts from one(or a few) categories and not all of them?

    Thanks! ^^

    Reply to Mosey
  22. Aaron posted the following on June 16, 2007 at 12:47 pm.

    I didn’t really test this, but it should work.

    Open sneak-peek.php
    Find: foreach ($scheduled as $post) {
    Add After:

    1. global $post;
    2. if ( in_category('A Category ID Number HERE') ){

    Find:

    1. }
    2. echo '</ul>';

    Add Before:}

    If you want multiple categories use if ( in_category('Category 1 ID Number HERE') || in_category('Category 2 ID Number HERE') ){

    Reply to Aaron
    1. Mosey posted the following on June 16, 2007 at 3:58 pm.

      Aaron – thank you very much for your fast and helpful reply! I tried out both the single category and multiple category edits, but alas it doesn’t seem to be working fully on me.

      I know it’s sort of working because the div and title for the ’sneak peak’ widget still shows up if there is a post within the specified category(ies). But the content doesn’t seem to want to show up (the part with ‘coming in x days, title of event’) so am not sure what I should change?

      Thanks again! :D

      Reply to Mosey
      1. Aaron posted the following on June 16, 2007 at 7:42 pm.

        Okay try moving global $post; before foreach ($scheduled as $post) {.

        Reply to Aaron
        1. Mosey posted the following on June 16, 2007 at 8:42 pm.

          Thanks again :) I’m sure I’m doing the right changes (will check again after this) but at the moment it’s the same result.

          Here are the changes I’ve made:
          http://pastebin.com/930503

          Reply to Mosey
  23. Sandra posted the following on July 2, 2007 at 3:27 pm.

    That’s a nice feature. It not only makes the user return but also encourage me to really WRITE articles ;)

    Reply to Sandra
  24. mosey posted the following on July 11, 2007 at 7:11 am.

    Aaron is the best~! :D Thanks for adding the category restriction setting!

    Reply to mosey
  25. Tempo posted the following on September 8, 2007 at 5:54 pm.

    I am using your plugin and I really enjoy the accountability of it. It’s like having a virtual boss that puts me on a deadline, but only I control the boss!

    That said, I am also using an events calendar that needs current or future timestamps. What happens is that this plugin interprets this as a post as well and it is causing problems.

    I see that there is a way to restrict to certain posts, but I have many categories. Is there a way to tell the plugin “do NOT display” if you are x category id?

    Thanks for you help and keep up the great work

    -Tempo

    Reply to Tempo
  26. Daryl Hurd posted the following on December 13, 2007 at 4:47 pm.

    I am having a problem….
    Not sure if it is related to the sneak peeks plugin, but I will let you decide.

    I have a post that should have posted on 12-10 and for some reason it says in the sneak peaks:

    Coming in 3 days:
    Want 2,400 pairs of biker sunglasses?
    Coming in 2 days:
    Can you believe this is classed as a motorcycle?
    Coming in 3 days:
    Vandem Productions introduces Baltimore Bike Clubs Gone Wild, the first of a series of dvd’s documenting motorcycle club’s culture, lifestyles, charity events and wild parties

    So it should have posted 3 days ago, I have checked the post and all looks good but it does not appear on the website for that day. but I “reposted” it with todays date and now it shows correctly. Is this related to your plugin or just maybe a glitch with WP?

    Reply to Daryl Hurd
  27. Li-An posted the following on March 7, 2008 at 9:27 am.

    Hello, I like very much your plugins (I use Futur Calendar and Sneak Peaks) and I have some questions about this one. I am french so I tried to translate the php file for french reading users then send it in the plugins but it not seems to want to change. What have I to change to have another title than “Sneak Peaks” and “coming in” ?
    Thank you for an eventual answer.

    Reply to Li-An
    1. Aaron posted the following on March 7, 2008 at 9:40 am.

      The “Sneak Peaks” and “Coming in” are stored in the database, so if you translate them, only the default values change not the ones in the database.

      In the future, if someone using the French version activates it, the words sneak peaks will be in French by default.

      Reply to Aaron
  28. Li-An posted the following on March 7, 2008 at 9:54 am.

    So, it means that I will see it in English and other people in french, or that I have to empty my database to soo them in french ?

    Reply to Li-An
    1. Aaron posted the following on March 7, 2008 at 10:19 am.

      On your website, once you translated the php file, you will have to go to the widgets control panel and edit the options for the sneak peaks widget to change the sneak peaks text on your website to french.

      Reply to Aaron
  29. Ariah Fine posted the following on March 23, 2008 at 12:06 pm.

    I’m looking forward to implementing this.
    However, I don’t have widgets on my sidebar.

    What code do I need to insert to have this display on the sidebar?

    And is there a way to edit the options without having widgets activated?

    Reply to Ariah Fine
  30. Alexander posted the following on June 7, 2009 at 2:26 pm.

    Hello! I used this plugin and it is very nice, but now in Wordpress 2.7.1, it does not work. Why – I can not find the answer? Maybe you do I recommend something? (calendar of future entries, I will not fit, unfortunately). Thanks in advance!

    Reply to Alexander
  31. Kare Fors posted the following on November 4, 2009 at 4:42 am.

    Future post works great. WP2.8.5
    When downloading Sneak Peeks I only get sneak-peak.php file??
    No folder. I am looking forward to be able to use Sneak Peeks.
    Regards Kare

    Reply to Kare Fors

Leave a reply

:) :D :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: ;) :!: :?: :idea: :arrow: :| :mrgreen: