Hi. I am new to Beans and working on making my first Child Theme.
I want to add a logo image to the header, and have successfully added an <img>
tag in my functions.php file, using beans_header_prepend_markup
. However, the logo image is located inside my Child theme images folder, and my src code for the image is only src="https://beanscommunity.wpenginepowered.com/images/JRyanLogo.jpg"
and that is not working. It shows an empty image. Apparently, I need to include the Child Theme Directory, but I have been unable to find the code to do that despite extensive Google searching. I suppose I could add the image as a background via my style.less file, but then it would be a background image, and that is not what I want.
Thanks for any info you can provide!
Hey wyn,
Welcome to Beans community. You can upload it on the customizeer. you don't have to add any code.
Hi Anupam, Thanks! However, I don't want to use the customizer. I am accustomed to working in the code, and if I start using customizer for task A and writing code for task B, I won't know where to look to adjust things. PS -- So far, I think Beans is pretty awesome. It is SO powerful!!
Hi Wyn and welcome π
What you are looking for is get_stylesheet_directory_uri()
(see codex here) so your url would be get_stylesheet_directory_uri() . '/images/JRyanLogo.jpg'
.
Happy coding,
Hi Thierry!
Thank you so much. So . . . it's legit to use "ordinary" Wordpress and PHP stuff together with beans and UIkit stuff? That solves a LOT of issues. Thanks again. π
It is more than ordinary, it is partly what makes Beans so magical.
You will see how cool it becomes when you start using Beans HTML API markup and attributes to add, modify or remove UIkit attributes and other HTML π
Happy coding,
Thanks again -- yes, I am already delving into changing markup and attributes. That's what makes Beans so awesome!!