Updating page changes get_styleshet_directory syntax
-
Hi – I’m a WP newb and learning to build my first child theme site installed locally using MAMP. I can build a flat html/css site in my sleep but WP requires me to be fully awake and caffeinated.
I was reading the Function Reference about using get_stylesheet_directory_uri which I want to use so that I can more easily load images from my child theme’s images directory.
Copying/pasting & personalizing the example in the Reference I enter this onto the Edit screen of the page –<img src=”<?php echo get_stylesheet_directory_uri(); ?>/images/trial-image.png”
alt=”trial” width=”” height=”” />…and hit the Update button. This has been unsuccessful enough times that I tried every variation of the path until I realized that Updating the page caused the syntax of the PHP code to change “?>” to “?/>”.
Is that correct syntax? Is that common behavior?
I don’t know how to proceed. It seems that either the Function Reference is incorrect or WP is trying to tell me something totally mysterious. Either way no images are appearing on my page.
Thanks in advance for your help.
- The topic ‘Updating page changes get_styleshet_directory syntax’ is closed to new replies.