Use get_background_image in src
-
Hi, I have an image tag in the header.php file in my WordPress child theme. I want to use the wordpress background image defined in the Admin panel as the img src.
I found where you can call the background image from PHP, but I put it in the quotes in the src, but that will not put the image there. It leaves the img src blank when I view source in Firefox.
https://codex.ww.wp.xz.cn/Function_Reference/get_background_image
Basically, this is the code I wrote that did not work:
<img id="parallaxContainer" src="<?php get_background_image(); ?>" />What am I doing wrong?
Thanks for the help! 😀
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Use get_background_image in src’ is closed to new replies.