How do i add an image (icon that will link to photographer's page) on top of my logo
that is already part of my theme, into the child theme functions code, so that it will be saved if i ever upgrade the theme?

I don't know how to use widgets to achieve this nor have I found a suitable plugin.
I currently have it hacked into the parent theme's header file.


You have done the most of it, just that you haven't realized it yet. If you are using a child theme then you can copy and paste the header.php from the main theme into the child theme folder and make the exact same changes you have made now to keep the icon above the logo.

Now the header.php in child theme will load instead of the main theme's.

In doing so the changes remain preserved even if the main theme is upgraded/updated.

Files inside the child theme remain preserved on parent theme update

Another way is to find suitable hooks from the header.php file and code it in the child theme's functions.php file.

Hope it helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.