Here is the way to change image according to screen size
<picture>
<source media="(max-width: 767px)" srcset="https://....image1.png">
<source media="(min-width: 767px)" srcset="https://....image2.png">
<img src="srcset="https://....image2.png">
</picture>
Then you use a snippet to hook it at the top of your category page.
add_action ('wp_body_open' , 'add_content_after_header', 20);
function add_content_after_header() {
if (is_category($category='your category')){
?>
<picture>
<source media="(max-width: 767px)" srcset="https://....image1.png">
<source media="(min-width: 767px)" srcset="https://....image2.png">
<img src="srcset="https://....image2.png">
</picture>
<?
}
}
To add snippets I prefer to do without any relation with the Theme, in case you change Theme…
https://webservices-pme.com/plugin/post-snippets/
Regards
Thierry