Question

I have a small header-of-sorts that's in a html file, with its own css file and a folder of images (svgs). I'm basically trying to put this on my site in the header, so I made a child theme and went to edit that theme's header.php with my html code, linking to the css file (which I added to the theme), and with the folder of svgs in the theme files as well.

The svgs don't appear and neither is any of the styling though the html itself shows up fine. I even moved the css into my styles.css for the child theme and it doesn't make a difference. I'm basically wondering what the easiest way is to incorporate my code/file structure (html file, css file, folder of svgs). I can include code if it's relevant, but I figured right now my question is more of a general, how-to-approach-this-issue kind of question.

Was it helpful?

Solution

If your HTML is displaying but the images aren't that normally points to a path issue - doublecheck it by opening your browser's dev tools and checking whether the requested path to the images is correct. Make sure you're using get_stylesheet_directory_uri() to get the URI to the root of the child theme, as get_template_directory_uri() will point to the parent theme even when used in a child theme's template.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top