Looking at the WordPress new Twenty Eleven theme we will notice the built in Twenty Eleven Ephemera widget, this widget will display different custom post types in the sidebar, the Digital Raindrops website home page is made up of customized widgets, these have extra styles and features.
Over the next few weeks we are going to modify these based on the default theme style and add these to a child theme that will be available for download, we are starting the series with a category widget.
We have created a category widget built into a twenty eleven child theme, the Ephemera widget is fairly basic and we wanted to offer a widget with a few more features, we took the code from the Ephemera widget and added extra options for the output.
The theme will create two new image sizes, has a function to include the files in the Widget folder, so as we add new widgets later we can just drop one file into the folder and the widget will appear, the reason for the ‘custom-style.css’ is so the style will load after the dark theme option if selected.
You may download the file here or visit the All Downloads page for other files.Twenty Eleven Category Post Widget (293)
After activating the theme there will be a new widget 2011 Category Posts, if we drag this to the sidebar we can add or select different options.
Title: This can be left blank or we can add a title, we could have made this the Category Name but we thought it would be better to give the administrator the option.
First Post Display: With the widget we have kept the first post separate, this would be the latest post in the category so we can give it a different output.
Other Post Display: for the other posts in the category can have a different output, the default is the simple list.
Category: We do not need to know the ‘Category ID’ as we can just select a category from the dropdown list.
Number of Posts to Show: this will default to 5 but any number can be entered.
Large image with post list
Large image with thumbnails and excerpts
Large image with Excerpts
We do require your feedback to improve our themes and tutorials, please leave your comments good or bad.
Code disclaimer information
If this document contains programming examples, www.DigitalRaindrops.net grants you a nonexclusive copyright license to use all programming code from which you can generate similar functions tailored to your own specific needs.
All sample code is provided by http://DigitalRaindrops.net for learning illustrative purposes only.
These examples have not been thoroughly tested under all conditions. www.DigitalRaindrops.net, therefore, cannot guarantee or imply reliability, serviceability, or function of these examples.
All programs contained herein are provided to you “AS IS” without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.
Registration and Membership is no longer required for downloading files or interacting with Digital Raindrops, posting a comment or topic in the forum does use Captcha to reduce spammers.
This website is a tool to support and promote WordPress and Artisteer theme development, please support, share and give credit for any benefits you gain from the tutorials on this website.