Support » Themes and Templates » How to pass global variable via url query string to wordpress?

  • Hi folks,
    I’m currently designing a travel blog and I’d like to divide post into 4 parts : main content, a diaporama, itinerary information and more infos. I decided to use the custom fields to do so.

    My problem is that I want to split the 4 parts onto 4 different tabbed panels. I intended to pass a variable currenttab to wordpress using url query such as “index.php?p=41&currentab=diaporama” and use that variable to create some conditional test. But apparently I don’t manage to write that variable since when I echo it on the next page it doesn’t display anything.

    I’m pretty sure that mod-rewrite (I’m using permalinks) has to do with that but I don’t know how. Could you please help me?

    Thanks in advance!

    ps : If you know an other way to display only some values of the custom fields modifying the template hierarchy and creating diaporama.php, info.php and itinerary.php… feel free to let me know!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Am I saying a non-sense? If you think so, please let me know why : it’ll help me a lot!

    You can do this a few different ways.

    First, if you need to divide up the main content block you could use specific markup for the sections, such as an h2 heading. Then AFTER the page is output use jQuery to chop the post into pieces and put them behind a tabbed interface. (Non-js aware browsers will see the normal post). It can be done with just a few lines of jQuery. I use it on my real estate listings pages. (Although I also output the tabs, and I do that using plugin code).

    You’re right about permalinks. You’ll want to see how the page splitter works (look at the code) because that’s similar to how you’ll need to do it. First check the docs and see if this will work without any mods, though: Styling Page-Links

    Oh and I just remembered seeing this new plugin announced… postTabs

    Perhaps that will help too.

    Thanks for answerinf so precisely!
    I don’t have time to dig deeper in what you’ve said right now but i’ll let you know tomorrow on my situation.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to pass global variable via url query string to wordpress?’ is closed to new replies.