I have in the following code in the template:
<img src="<?php header_image(); ?>" />
However, I want to change this image according to the language selected (through GET parameter lang).
The question is, how to change this function to look for different images according to the received GET parameter?
I thought of:
- Change this code on header.php to a fixed image path, so I could put an if and choose between the images I want.
- Replace the result of the function get_header_image() and use it instead on header.php according to the received parameter, sort of replacing the string suffix .png to _en.png or .png to _es.png.
- Change the header_image() function to behave the way I want.
All these ways look ugly to me. Are there better ways?