change images in a widget via child theme
-
I have a custom theme from a friend who is out of contact I’m trying to modify. The theme has a social media widget that displays images for each social media website (twitter, facebook, etc)
I am trying to change the icon displayed for the social media, as the one’s he gave in the widget are a bit bland. How can I do this with a child theme? The easy solution is to go into the original theme file and replace the images with the files of the same name, but this theme will be updated frequently and I cannot get access to the original file, so I am stuck trying to do this with a child theme.
I do not know much php, but am fluent in CSS. I have modified the theme quite a bit with the style sheet in my child theme, but can’t figure out how to change the images in this widget.
-
Hard to tell without the files. Is the widget part of the theme, or is it an external plugin?
If you do a text search through the theme files, can you find which file calls the image filenames? If that is the case, you could just modify that file in your child theme.
If you’re really lucky, the image filenames will be determined by css (as backgrounds, rather than links). In that case, if you give us the url of the page you’re looking at, we might be able to pinpoint a css style you could use to change the background image filename.
Here is a test of the page we’re getting ready to launch, as you can see the social media icons are on the right hand side of the page next to the slideshow – newlifea2.org
I believe the widget is part of the theme. I downloaded the original theme and have the PHP file of the widget. I copy/pasted the widget file into my child theme folder and changed where it calls the images from, hoping the child theme would upload it and override the original, but not luck.
Also in the widget file I found the code “<?php echo get_template_directory_uri(); ?>” where it was calling each social media icon, is there a another PHP code that would tell it to pull the image from the child theme rather than the parent?
I tried just removing this PHP code with and putting a simple URL (ie images/facebook.png) but it still pulls from the parent theme, even though that directory is in my child theme.
Eesh, sounds like you’ve exhausted all the ideas I can give you. Anyone else?
The topic ‘change images in a widget via child theme’ is closed to new replies.