Sidebar widgets
-
I’m also wondering how to control what appears on the left sidebar on the posts page (category and tags are there by default). And, whether or not I could place the author widget there?
Thanks,
Gregg
-
Gregg,
That part of the site is not “widgetized”, so to speak. Adding an authors list there would require a bit of customization, but if you’re comfortable dabbling with PHP I can point you in the right direction.
Otherwise, there is always the “After Post Content” widget area where an authors widget could be inserted.
Hey Ben,
I understand. That’s what I figured, but just in case I missed something simple, I figured I’d ask.
If you could point me in the right direction, I’ll give it a shot. I’m pretty familiar with php but I’m still learning the ins and outs of WordPress.
Thanks so much!
Sure, here’s how it can be done:
The first step is to copy the
content.phpfile into your child theme. This tells WordPress to use your version instead of the “parent theme’s” version.Next, find where the “entry-tags” and “entry-categories” divs are located, and add your “entry-authors” div. The tags and categories lists both get their content from files in the
contentdirectory.If you copy their markup exactly, it will be easier to style. Also, you should consider adding the “entry-categories” class to your “entry-authors” div, so it gets styled automatically for you. There is a javascript function that calculates whether the tags and categories have enough vertical space to sit to the side, and if you use the “entry-categories” class it should automatically factor in the height of the “entry-authors” element.
Lastly, I think you’re going to love this function: wp_list_authors(). I’m pretty sure it’s the exact same function used in the Authors widget. It has quite a few parameters you can use to customize the output.
Let me know how that works for you and if you have any other questions
Thanks a lot, Ben!
This is great info and will save me a lot of time. I think I understand the approach pretty clearly. I’ll give it a shot.
Cheers,
Gregg
Excellent, feel free to post any questions you have along the way.
The topic ‘Sidebar widgets’ is closed to new replies.
