Help with Shortcodes Attributes / PHP
-
I have limited PHP coding experience but decided to try my hand at adding shortcodes to my theme once I realized I would not be able to easily make certain modifications in the future otherwise. It will be a photo-based blog, and what I’m working on is a way to add certain information to photo posts through use of shortcodes. This information will include captions, links to the gallery that photo is found in and the next/previous photo in that gallery, ect. Hopefully the snippet of code that I’m having trouble with will at least help demonstrate what I’m trying to do:
https://wordpress.pastebin.com/LA8zL55S
Basically since I don’t know of any way to query the posts or pages that a particular photo is found in, I will manually add that information within the posts themselves through shortcodes. In this case, I want the shortcode [photo_in_gallery photo_page_id=”40″] to return some html including a link to the page declared by the id attribute.
- The topic ‘Help with Shortcodes Attributes / PHP’ is closed to new replies.