I am building a website in WordPress and have a set of photos that display along the top of the page (in the background) and have them to where the set of photos can change depending on where the visitor is on the website. For example, if they are looking at the FAQ page, then photos pertaining to asking questions are shown. If they are looking at the news page, then photos pertaining to news are shown. The code I have works great, however, I’d like to now show photos based on a specific parent and any children of the parent.
Not a wordpress user , but I do way too much PHP [probably need a 12 step program by now] :)
depending on exactly what you want and how wordpress is actually laid out , one might find the
get_included_files function useful as it maintains a list of all the files involved in the production of any page. Then one could have some simple XML ,JSON, or even plain old text file where you could store your rules that could be read in to decide when and where to include content.
Another possibility that might be easier is some sort of .htaccess mod-rewrite rule that you could set in any directory you liked that could add something to the url so you would only have to check for one thing in the PHP but otherwise not have to fiddle with the PHP scripts after the one time.
Generally I try in my PHP projects to generify and externalize things so I don’t have to be editing PHP files. To many other aspects of development that are much more fun.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".