Support » Themes and Templates » Using PHP in template to create URL based on dropdown

  • Hello,

    I’m having trouble getting some PHP code to work within a page template.

    The purpose of the code is to send the user to a URL based on post tags, with the options having been selected from dropdown menus.


    Here is the code for the dropdown menus:

    The code works if placed in a separate PHP file but is not working when placed inside a page.php template.

    (I have tried using a PHP include to insert the code from the external file and that didn’t work either.)

    Many thanks for any help anyone can give and let me know if you need any more info from me.

    Huge thanks!

Viewing 1 replies (of 1 total)
  • I haven’t found a great solution to this but have resorted to putting the PHP dropdown menu in a separate file and using an iframe to insert it in to my WordPress home page.

    This works now so that if someone chooses their options from the dropdown list, they are redirected to a page based on tags like:

    If anyone knows a better (none iframe) solution please do let me know 🙂


Viewing 1 replies (of 1 total)
  • The topic ‘Using PHP in template to create URL based on dropdown’ is closed to new replies.