I am trying to add a parameter to the currently visited url but it doesn't work. I've tried query_vars, pre_get_posts, post, post_link, page_link,post_type_link.... None of this work...

How can I simply add &moo=$foo to the url and read the moo value in a shortcode

  • It's not clear when are (or need to) add to the URL. You can add the URL during The Loop using a custom template. Or you can add it to a URL in the content with a filter to the content. So, need more info on exactly what (and when and where) you want to do this. – Rick Hellewell May 15 at 2:01
  • @RickHellewell no I don't have custom template. – Bat Man May 15 at 11:13
  • So exactly how are your trying to add the parameter? Where? Edit your question and show what you tried, and what you want to happen. More details will get you an answer. – Rick Hellewell May 15 at 16:50

Your Answer


Browse other questions tagged or ask your own question.