I have a confession, a lot of the features in my Genesis Featured Widget Amplified plugin are purely selfish. I needed hooks in the Genesis Featured Post widget for a client or else I was going to need a custom widget just for this one project. So I built the plugin. I wanted a drop down list for the extra posts in another client site, so the plugin got that feature. People make suggestions on the plugin that I add even if I don’t need it personally, only because I think “hey that’s a cool idea that might come in handy one day.”
One feature I added was the ability to order posts by custom meta key because I didn’t want to use a “Featured” category or tag to get my posts, and if I used a meta key to get the posts, I knew I could control the exact order the posts appeared in the sidebar. I am the target user for that feature and you can see it in action on the sidebar of my personal blog, http://NickGeek.com.
OK, so now you know the dirty truth, but I have another quick tip to help you sort your posts using he GFWA widget.
Add Custom Fields
If you don’t see a “custom field” in your post the first step is to enable that feature, it was hidden in posts by defaults back in WP 3.1. It’s easy to get back. In the post editor click “Screen Options” in the upper right portion of the page. Then click “Custom Fields” to check the box and enable custom fields. Pretty easy right?
Now that you have custom fields, add a new custom field to the posts you want to show in the widget. For my site I used “featured” as the custom field name. In the “value” use a number to indicate what position the post will appear in the widget. Here is a screen shot for the post that currently shows in the 3rd spot on the sidebar of my personal blog.
I have 5 posts and I occasionally change the order or feature different posts. I can delete the custom field if I want to remove a post, or change teh field value to change the post position, it’s pretty easy and convenient.
The next step is even easier.
Setup the Widget
If you don’t have the plugin installed and activated, hop over and get that done. I’ll wait.
Now, you should notice that the Genesis Featured Widget Amplified widget replaces all of your Genesis Featured Post widgets. That’s normal. This adds to the build in widget, and replacing the existing widget lets me save a bit of code overhead, since you have one less widget running, and it simplified the widget list.
Put the widget in a sidebar and setup the image and content options however you want. You can see the post settings from my widget on the right. Notice I leave it for “post” and “All Taxonomies and Terms” so that I don’t’ have to worry about what category or tag my post is in, just that custom field. I put my custom field name into the “Meta Key” field, told it to show 5 posts, selected “Numeric Meta Value” for Order By and “Ascending” for the Sort Order.
Now I have 100% control over which posts show up in my “Featured Posts” without an extra tag, category, or other taxonomy and I can sort the order of the posts in this widget without changing the date, so my archives display in the order I wrote my posts, but this sidebar displays in the order I want.
Maybe this quick tip will make up for my selfishness 🙂