• Resolved sheriffderek

    (@sheriffderek)


    I’d love to give out a special URL

    something like https://site.com?code=exampleCode

    
    if ( $code === "exampleCode") {
      echo $code;
    }
    

    or something.

    Any suggestions? I haven’t used query params in PHP or WordPress before.

Viewing 2 replies - 1 through 2 (of 2 total)
  • imakeinternet

    (@imakeinternet)

    You can use something like this at the top of your template file:

    $code = $_GET['code'];

    and then do whatever you want with the $code variable.

    Thread Starter sheriffderek

    (@sheriffderek)

    Perfect!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Use query parameters in template’ is closed to new replies.