photo link based on page slug
-
I am creating a custom theme, and still pretty new at this. I’d like to get it set so that a photo appears on the side of the main content. I would like that photo to be pulled from a set of photos, and the pulled photo would correspond to the page slug url.
Essentially, in the page.php file, I would have
<img src=” <template URL>/images/<page-slug-name>.jpg”>
How do I call the template URL and page-slug-name? Also, in case there isn’t a photo for that slug name, could I have a default photo that would be inserted? How would that be done?
thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘photo link based on page slug’ is closed to new replies.