Which template(s) to override to use a different sidebar for blog, single posts, categories, blog archive?

Thinking about this problem some more, and meditating on the WordPress template hierarchy below, I came up with a solution to my own problem.

I found that if I looked at the left side of the template hierarchy diagram and found the page type I was interested in, I could then work my way as far to the right side of it as I could without affecting other site pages. I also looked for existing templates in use by my Child Theme, and my parent theme, to ensure that chosen file wouldn’t be overridden.

Clearly the solution is going to vary depending on the child and parent theme files that exist, but this worked for me:

  1. No category.php file existed in my child or parent theme, so I looked at archive.php which was further to the right on the diagram.
  2. archive.php existed in my parent theme, but not my child theme, so I copied it to my child theme and updated the sidebar template to use my new side bar. This changed my sidebar for the category and archive pages.
  3. Single posts still used the old sidebar. I suspected other content on the site might be using the single.php template, so I tried overriding just single-post.php. This file didn’t exist in my child theme, but did in the parent, so again I copied it to my child theme and updated it to use the new sidebar template.

There was a search field appearing in the main content heading in an unexpected place after my changes, so I hid that with some CSS and everything looks great.

WordPress Template Hierarchy as at May 2017:
Wordpress Template Hierarchy as at May 2017