• Greetings,

    I posted a similar question earlier but I’d like to clarify what I’m trying to accomplish, because there may be an easier way.

    I’m trying to pass a row number for a database table to a page so that page can select the proper row number and display good information. I’m doing it right now as a template in a theme and trying to get data into that template. The traditional method of site-url/page?id=5 does not work because of the way wordpress parses the url. Does anyone know of another way to get that data to the page?

    Thanks,
    Eric

Viewing 3 replies - 1 through 3 (of 3 total)
  • Maybe take a look at some of the author Template_Tags and also look at Function_Reference/WP_Query.

    have you tried:
    site-url/page/?mycustomid=5

    the extra slash is probably needed, and ‘id’ is generic enough that it might already be ‘used’ in the system, so use a variable name that is specific to you.

    the other alternative gets a bit hairier, which is to write your own url filter so that your variable ‘shows up’ by the time your template code goes to run. I’ve never tried doing this with a WP Page, it’s always been a completely custom php file that I’ve ‘installed’ as a template handler for my custom url. and that’s hairy!

    -d

    Thread Starter silvakow

    (@silvakow)

    Hey d,

    I tried it with the slash there and got the same 404. Also, the “id” tag was an example, and I tried using a bunch of random characters as the identifier with the same results.

    I’m going to look into the WP_Query thing and I’ll let y’all know what happens.

    Thanks,
    Eric

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Data passing’ is closed to new replies.