Sneak Peeks Widget
Posted on Saturday the 23rd of June, 2007 at 5:56 am in WidgetUpdated 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.


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 jazzleGreat 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:
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 WatchmanIt has to be published with a future date for it to show up.
It can’t currently, but I’ll add in the ability within a day or two.
Yes, the plugin assumes that you write posts ahead of time and then just schedule them for later.
Reply to AaronGot 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 WatchmanThe 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 AaronCool I like this page.
Reply to MartyThe 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 VishwasThat is because wordpress changed the way future posts are marked. Give me a few minutes an I’ll upload the updated version.
Reply to AaronI 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 DarylI apologize, something must have happened. It has been fixed.
Reply to Aaronthanks 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 DarylGreat plugin! Thanks for releasing it for all of us to enjoy.
Reply to DeanNice 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 JonathanI’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!
Reply to Ed CooperCheers,
Ed
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.
Reply to RichardRichard
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 GallivanterAny thoughts on how to modify it to work with 2.2? Or when that might happen?
Reply to MichaelHah! 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 MichaelBetter to use if($wp_version >= 2.1) to at least make it forward compatible.
Reply to DavidMichael, it works! Thanks a million!
Reply to GallivanterDoesn’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 EdI 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!
Reply to MoseyIt 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 AaronThanks 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 MoseyAlso, 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 MoseyI didn’t really test this, but it should work.
Open sneak-peek.php
Find: foreach ($scheduled as $post) {
Add After:
global $post;if ( in_category('A Category ID Number HERE') ){Find:
}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 AaronAaron - 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!
Reply to MoseyOkay try moving global $post; before foreach ($scheduled as $post) {.
Reply to AaronThanks 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:
Reply to Moseyhttp://pastebin.com/930503
That’s a nice feature. It not only makes the user return but also encourage me to really WRITE articles
Reply to SandraAaron is the best~!
Thanks for adding the category restriction setting!
Reply to moseyI 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 TempoI 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 HurdHello, 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” ?
Reply to Li-AnThank you for an eventual answer.
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 AaronSo, 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-AnOn 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 AaronSorry, it’s just one week I’m on Wordpress and I have not the reflex (?) to look at widget options (I went in Options menu). Thank you for your answer. Now it’s fine :-))
Reply to Li-AnI’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