• I am creating a sponsor a page idea on each page of my website as a way to help advertise other artisans, individuals, businesses etc. I could not find a form that would help me do this, so I created a form on one page so that they can tell me which page they want to sponsor, etc. NOW, I need to add a link to each post and page at the top that says Sponsor this page (with the link to the form). Is that possible? I have over 450 pages, so………is there a short and quick way to do this? css maybe? I do not have the skills, so your help and suggestions would be much appreciated!

    • This topic was modified 3 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • You cannot do this in CSS, however you can easily edit the page template to display your form:
    https://www.smashingmagazine.com/2015/06/wordpress-custom-page-templates/
    https://www.dreamhost.com/wordpress/guide-to-wp-templates/

    Thread Starter kristihugs

    (@kristihugz)

    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 3 years, 1 month 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.www.ads-software.com/reference/functions/is_front_page/#comment-457
    https://developer.www.ads-software.com/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

    Thread Starter kristihugs

    (@kristihugz)

    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 ??

    Thread Starter kristihugs

    (@kristihugz)

    yeah, nope, my head has exploded. I dont get it. Don’t understand.

    Thread Starter kristihugs

    (@kristihugz)

    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 3 years, 1 month 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/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Same link on every page’ is closed to new replies.