Home Forums Archived Forums Weaver II Theme Weaver II Pro How to create a different background image per category? Re: How to create a different background image per category?

#20668
Weaver
Keymaster

A very good PHP programmer familiar with the WordPress API could probably put together a child theme to do this in less than a day.

But it is not trivial. It could be done using Actions and Filters, but the code is not really all that small, and a child theme might be more appropriate.

But the idea would be to add a new ‘body_class’ filter (this is the exact name of the WP filter), and add the name of the single page’s categories to the body tag. Then one could add custom CSS rules for body with the appropriate BG Image url() and how to display that BG image. But writing that filter does require a good knowledge of the WP API to be able to retrieve the category slug to add to the body class list.