thank you for the links. The coding is confusing. I do not want it to show on the front page, but all other pages and posts. If I want the text to say Sponsor this page, do I add the entire url AFTER that? or do ………I may be better off just adding to all 407 pages because code is too complicated for me. Thanks for the help though.
-
This reply was modified 4 years, 7 months ago by
kristihugs.
I may be better off just adding to all 407 pages because code is too complicated for me.
Nooooooo. Definitely do not do that.
What if 6 months from now you need to change something?
See here to add a loop to check if you are on the front page / home page:
https://developer.wordpress.org/reference/functions/is_front_page/#comment-457
https://developer.wordpress.org/reference/functions/is_home/#comment-290
The form should be able to take in the referrer URL, see HTTP_REFERER:
https://www.php.net/manual/en/reserved.variables.server.php
This entire process should be automated.
(you have right click disabled, which is pretty annoying), but you can eliminate the field that says:
The page you want to sponsor at CrystalBasics.org
bc the form input will tell you.
Once you have captured the form data, you can now use a function on the sponsorship link to output the data:
A big thank you to <fname lname> who has sponsored this page!
Visit their website at <http_referer url>
or whatever. To take it a step further, you could add an Admin paremeter in the backend to store the Page ID of the sponsor. Then you just need to have a single function that checks the page ID being loaded in the browser, retreives the data from your db, and outputs the right sponsor name and URL.
You can do all this in your page template.
Here is the page ID and the template you are using for this for example:
https://postimg.cc/LYzyqP59
sorry about the right click. A lot of the info on the pages are directly from my books and I have had so much stolen and not credited over the years, I just got pissed off and felt the need to protect my work.
I am so code challenged, you lost me after “see here……” but I will read all of the things you have shared and see if I can make sense of it.
Thank you for taking the time and sharing all that you have. I will try my best π
yeah, nope, my head has exploded. I dont get it. Don’t understand.
While I am grateful for CorrinoRusso’s advice, I have to repeat, I have NO coding experience, so doing what CorrinoRusso shared is far beyond me and would take at least a few coding classes which I do not have access to, SO………..does anyone else have a slightly easier idea which could work for me, one that does not have major coding involved? Otherwise, I will just add the link to each page myself. I am extremely frustrated at this point.
-
This reply was modified 4 years, 7 months ago by
kristihugs.
It’s pretty straight-forward from a programming perspecitve.
You could try to find a developer to take the task on.
At minimum, create your form using a shortcode – then all you need to do is add the shortcode to your template:
https://docs.gravityforms.com/shortcodes/#but-i-just-want-to-add-a-form-
If you use the built in HTTP_REFERER parameter in Gravity Forms, you will know which page the form was submitted on:
https://docs.gravityforms.com/capture-http-referrer-url-form-submissions/