redlineguiding
Forum Replies Created
-
I mean snippets ^^
Obviously I have stuff like this on my pages.
[insert_php]echo("$somassignedvalue);[/insert_php]
The point of this being that I can apply a global price or other value change on my site by editing that one file I include(). This makes updates easy.
If I understand what you’re saying correctly, I need to add this include() for every echo() instance on the each applicable page? In other words, for every echo() short code I will produce I need to add the include() to it, too?
I just include the file once currently (though I’m not referring to the include_once() function). I figured it’d work the same same. One short code for the include() then one shortccode for each echo().
I would normally include this file in the HEAD but it doesn’t work so I include the file once per applicable page in the page or post content, then echo() the values as many times as needed further down each page, using that above.
Sent. Thank you.
Hi Alex,
It is/was active. I can’t send a video at the moment, but the snippet I created, and activated, and is what’s between those old
[insert_php]
tags above. No changes. Your instructions are clear. And it’s really straightforward. I put that code content in the snippet, named it, described it, saved it, activated it, then put the short code it produced on the page where the include above is used and in the same manner — without those old tags of course — and the expected output wasn’t there. I then put the old include line back and it still works.The included file resides in the theme folder. No changes to the path above.
One thing I didn’t do is to create a snippet for the output — the output being what echos() what’s in the include file. For the output I relied on the old
[insert_php]
tags. That shouldn’t make a difference though… should it? I can mix and match the old tags with the snippets, can’t I, or does it have to be changed all at the same time, page by page? And if that IS the problem I’m having, can I use both old and new on the page simultaneously (to include the file the old way and the new way if it’s indeed a different method)? That way I can work on a single page incrementally.Hopefully keeping this thread going until resolved will assist others making the transition.
Thank you very much.
Mike- This reply was modified 6 years, 5 months ago by redlineguiding.
And yes, it was activated before I tried.
I should add that this is on a private page. I wanted to test there before trying out public pages. Site is here: https://redlineguiding.com
Everything on the site is up-to-date with the latest and greatest.