New2WP Latest Posts For Custom Types Sidebar Widget WordPress Plugin
For a long time now there has been a huge need for a sidebar widget that allows you to choose from any WordPress post type to show a list of the latest posts in the sidebar.
I've created a fully customizable sidebar widget for doing just that, packed up as a plugin for you to use now!
...
Finally, Just What We All Needed!
If you've been using WordPress custom post types at all on your site, like I have been now for about 10 months or so... since 3.0 Alpha version, then you'll probably love this.
I've created a new custom sidebar widget for WordPress, to display the latest posts for other post types besides the 'post' post type. This widget actually lets you show not only custom post types, but you can choose to display content from any public post type which includes the built-in post types 'page' and 'attachment', and of course 'post'.
So as long as your custom post types are publicly available, you can display the latest posts for them in your widgetized sidebar areas. What I mean when I say public, that means you must have specified in your code when registering your post type the property 'public' => true in the $args array which you must set up when you use register_post_type().
Since I don't use custom post type plugins I don't know if you have that capability to set 'public' => true or not. I assume you would be able to, but I'm not sure.
Plugin Features:
This plugin is similar to another plugin widget I made and recently released for showing your latest Tweets. It simply adds a new custom widget to your Widgets page in the WordPress dashboard, which you can use in your widgetized sidebars.
I have yet to see or hear about anything like this which displays the latest published custom post type posts in your sidebar. It's a replacement for the well-known Latest Posts widget which only displays the latest posts from the 'post' post type, and that's it.
Features Built Into this Plugin/Widget
- Ability to choose which post type to display the latest posts from.
- Able to control the heading HTML tag for formatting the widget title depending on how your theme displays the headings of widgets.
- Control the number of posts to display.
- Customizable widget title text.
- Full localization of text to support use with non-English languages.
- Link to view all posts from XXXX post type, whichever it is you have selected to display.
Plugin Installation:
You will need to Download the n2wp-latest-ptypes.zip file.
- Unzip the folder `/n2wp-latest-ptypes/` to your computer.
- Upload the entire contents of `/n2wp-latest-ptypes/` to the `/wp-content/plugins/` directory of your WordPress installation.
- Activate the plugin through the 'Plugins' menu in the WordPress dashboard.
- Go to your Widgets panel in the dashboard, and drag the New2WP Latest Custom Posts widget to your sidebar, and configure the settings to your liking.
If you like this, you might like some of my other crappy plugins that I've made.
You can see this widget in the sidebar right here showing Latest Snippets →
Let me know what you think of it in the comments, and if you find any bugs please tell me so I can fix them. I really like this widget myself, and would like to get it added to the WordPress plugin directory if I can.







User Comments
( ADD YOURS )Philip November 30
tanks a lot for this Jared,
how i can convert this widget to multi-widget?
now is loading only one widget.
thanks a lot
Philip
Boston December 1
I'm also wondering how to convert this to multi-widget :)
Thanks,
Boston
Jared December 4
I tried to make it into a multi-widget but settled for this for now. I plan to make a multi one soon.
Anonymous December 30
.............Browse .............. widget logic and custom post type.....................
Shane January 7
Thanks for this, exactly what I was looking for, well almost, because I can only create one widget, but I have multiple custom post types.
Martin February 10
This is one of the only widgets which allows you to select custom posts! Looking to display the latest posts as a monthly archive, do you think this possible????
So like an archive i would select the post type from your drop down but would appear as January, February etc
I haven't seen any other custom post type widgets, I developed this for my own use just about a month or so after WP 3.0 was fully released. I wasn't even aware that there were other similar widgets out there since mine does all that I think a widget of this sort really should have, aside from my never fixed but half-ass attempt to provide a link at the bottom of the widget linking to the page template which displays the full list of the selected post type. It worked for a sec then I broke it and stopped trying to fix it after a few minutes lol.
As for your request, not sure I follow. You want there to be an archive dropdown drop down which you can select a month from the chosen post types post archive? So another dropdown, not a different one than whats already there? Is that right?
I suppose that wouldn't be too hard to add into it. Let me know more specifically what you mean exactly and I'll see what I can do.
Martin February 11
That would be much appreciated, I'll try to be clearer …
In thoery I want an archive widget, but one that allows you to only show the archive list from a custom post type.
The list will appera
January
December etc
but only for post types news not the complete wordpress site
Jared February 11
Okay, I'll see what I can do. It may be something that would be more easily done once 3.1 comes out since it has better support for custom post type archives.
Edwin February 22
Hi Jared, love this widget, one question, how to display thumbnail from the post ?
pherum March 6
The plugin does not have a valid header. any way to get it?
Yesh April 23
How to add (Embed) Custom PHP contact form as a widget in the sidebar
Trackbacks