Woah, it is ending? ds106 is almost over? Sigh. Well, sincr i have blog posts dribbled over the last few months, I thought about organizing it a bit better here in the doghouse- it’s not quite archiving, but it does feel like the suitcase needs help to get closed.


cc licensed ( BY NC SD ) flickr photo shared by demandaj

What I talk about below in likely un-reproducible code is what I did to generate http://cogdogblog.com/tag/ds106

(click for full size image)

Doing this has been part of some other WordPress tinkering around here. The current template here has 2 widgetized sidebars, and I shifted the rightmost one to be the “standard” one that appears on all pages. The left side one, by default, will have blog related things, but I also now use it on a few templates to create more relevant bits.

To allow for a new widget, I edited my functions,php template for the place where it generates 2 sidebars:

This is how the template I use creates 2 sidebars (this is the simple way, they are called “sidebar 1” and “sidebar 2” in the widget editing screen; other themes may do this differently to name the widgets).

So I just bumped it to create 3 widget areas.

All of the content is already organized via the ds106 tag used- but the basic template for tagged content is not all that special.

So what I want now is a template specific for my tag- so I make a copy of say category.php and named it tag-ds106.php, which tells wordpress to only use this template for tag archives of ds106.

For the top part of the template, I update the main header for the title I want, and use some conditionals to display an intro paragraph only if this is the first page someone is viewing:

All of the loop stuff I leave as is, it is the standard stuff a template does to spit out content.

To use my custom sidebars, I change:

to read

This tells WordPress to not use the sidebars.php template, but instead to use sidebars-ds106.php, a custom sidebar template.

This is easy. I make a copy of the sidebars.php statement, and for the code in the first sidebar, I find the line that reads:

This tells wordpress to use Sidebar 1, but now I want it to use 3. One edit:

And now all I have to do is populate the stuff I want in Widget sidebar 3 to show what I want on my ds106 tag pages.

Your mileage will most likely vary with the structure of your templates, but as a rule, you can always override a category or tag archive by this method. For another case, I am using the category I created to document by summer road trip into a custom archive for CogDog Odyssey.

Ahhh, ds106, packed and organized.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Leave a Reply

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