Support » Fixing WordPress » passing additional GET variables to post

  • Hi,

    I posted a few questions about different approaches I’m taking here and have had no luck with replies… hopefully my new approach will be clearer.

    What I’m trying to do is when someone goes to my taxonomy archive for my custom post type I need to remember which taxonomy they came from because on my post I need a next and previous based on that taxonomy.

    I currently have a taxonomy[continent]/[country]/[city]/

    So this works also[continent]/[country]/[continent]/

    My original idea is that each photo is a custom post-type. So I wanted[continent]/photo/[post_name] or[continent]/[country]/photo/[post_name] or[continent]/[country]/[city]/photo/[post_name]

    this would have been perfect but from all my research it doesn’t look like it would be. correct me if I’m wrong.

    NOW my new approach is to keep my taxonomy URL’s as is but recreating my permalinks from that taxonomy. So if someone is browsing a city my permalinks would be[continent-slug]/country/[country-slug]/city/[city-slug]/photo/[post_name] OR[continent-slug]/country/[country-slug]/photo/[post_name] if they were in the country taxonomy OR[continent-slug]/city/[city-slug]/photo/[post_name] if they were in a continent taxonomy.

    BTW it’s all the same taxonomy I’m figuring it out by hierarchy.

    So I started with continent

    add_rewrite_rule( 'continent/([^/]+)/photo/([^/])+/',
    				'index.php?post_type=photo&continent=$matches[1]&post_name=$matches[2]', 'top');

    and I register this var $vars[] = ‘continent’

    which allows this

    but doesn’t give me the right result

    What would be my next step to say

    “Serve this a custom post type photo BUT leave the URL as is”

    If I can get this done I know which taxonomy they came from and I can do my next and previous.


Viewing 1 replies (of 1 total)
  • Please, I’m begging 🙂 any direction to solve my complete project block would be more than appreciated.

Viewing 1 replies (of 1 total)
  • The topic ‘passing additional GET variables to post’ is closed to new replies.