• Resolved jaw243

    (@jaw243)


    I am new to wordpress and am migrating my site from regular html to wordpress. My site is web app used for organizing clothes within ones closet.

    Just to clarify the main reason I use word press is just for my web template. Most if not all scripting is done in my code and almost every page on the website is dynamically generated based on the users information.

    The problem is that I have a page that is dynamically filled based on the item the user is viewing. For Example, I might click on a pair of my pants and it shows a page with a picture, brand, color, etc. The url is a url rewrite. It looks like example.com/closet/5 and really points to example.com/pages/closet/item.php?id=5.

    The question is how can I preferably keep the same form example.com/closet/5 in wordpress and dynamically fill my page? I guess a more broad question would be how can I read a get variable in wordpress? Obviously WordPress controls the urls so if I just add a number to the end it will show a 404 error. How can I make wordpress accept my get varibles.

    I have been looking on the internet for almost 6 hours now and have not found even a single article on the topic so I am starting to get the impression that I am missing something really obvious. Anything would be helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I suggest that you put your code into a page template. Create a page that uses this template, make a pretty permalink for this page.
    Now wordpress can display your pages.

    Thread Starter jaw243

    (@jaw243)

    In response to the previous –

    I don’t really understand how that would help plus I already have a template, the problem is just filing the information from the GET variable.

    Now my input –

    Anyway I figured out something that works but I really don’t like it and I hope to figure out a better solution in the future.

    Now when the user clicks on an item it runs a script that stores a php session variable called “item” which stores the id number. Then the script redirects to the item template page and the database reds the item id from the session variable rather than a GET variable. This way it avoids GET all together.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Moving dynamically filled page using PHP Get variables and query to WordPress’ is closed to new replies.