Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Inside a WordPress site I load a external xml file parse it and show some links. The link looks like this:
domain.com/prof/vac/item?guid=1234&title=foo
This works, but now i would like the url to look like this:
domain.com/prof/vac/item/1234-bar
when I create a link to that url and click it it says it kind find the page. However if i just put the guid in and forget about the title it works:
domain.com/prof/vac/item/1234

can anyone point me in the right direction?

share|improve this question
    
is the url always prof/vac ? I assume prof and vac are pages and vac has a unique page template –  Tom J Nowell Nov 16 '11 at 15:25

1 Answer 1

up vote 0 down vote accepted

You can use the details here in this answer to solve your problem :

Pretty URL with add_query_var

Something along the lines of

add_rewrite_endpoint('item', array(EP_PAGES)); 

resulting in a rewrite rule that would let you use /prof/vac/item/1234 which you would then check in the vac pages template for a query variable 'item' and pull its value ( in this case 1234 )

Of course one must then avoid having a page with the slug 'item' else bad things will happen.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.