Twenty Eleven Category Widget

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.

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.

post-widget-5

You may download the file here or visit the All Downloads page for other files.

Twenty Eleven Category Post Widget (328)

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.

post-widget-1

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

post-widget-2

Large image with thumbnails and excerpts

post-widget-3

Large image with Excerpts

post-widget-4

Notices

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.

Membership

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.

3 thoughts on “Twenty Eleven Category Widget

  1. Your theme worked well but one bud i found was that it does not allow you to chose different categories to display, Am only able to display the same category each time i use the widgets.
    Do you know why this is so.

  2. I love your twenty eleven child theme and how the colors can be adjusted. I am having problems putting a sidebar on the site though. I have it selected, but no widgets appear, as well as no sidebar. Any advice would be greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Connections

Connect with Us
Follow Digital Raindrops on Twitter Join Digital Raindrops on Facebook
Share

Related Posts

Posted in Twenty Eleven

pluggable-image2_thumb.png

In April 2011 we wrote a post on pluggable functions, since then we have been looking at other functions like post classes, which we used in the first release of our photo blogging theme. While loitering over on the WordPress … Continue reading

Read More