I've been searching the internet for 6 hours now, so I decided to ask this in the forum and would appreciate every help.
I just want my permalink to say (e.g. portfolio, post, etc)
http://mysite.com/?portfolio=xxxx¶m=whatever
I need the param, because the post itself defines the "whatever" parameter and there is a search form in the post, which initializes itself using this parameter (the searchform gets the parameter, if it's in URL). For single links, I could've placed the param into the link, but the WP defines the permalinks restrictively.
I tried adding add_query_arg() to functions.php without success (It's not even clear where to place the code (single.php or functions.php) and how to call the function from the post).
I then tried adding custom fields and Meta Boxes, but they seem to conatin the extra parameter but not add it to the URL. So all I get is:
http://mysite.com/?portfolio=xxxx
a.) BEST SOLUTION The best way would be, to add a custom field to the post (or post type), which inserts a value the param and shows the permalink-URL with that parameter.
b.) JUDO SOLUTION The simplest thing would be, to add this parameter (text) to the link.
There are a gazillion post about this online, but they all refer to parsing of parameters which external links pass ($_GET) and conditionally change the appearance of the site or adding one specific parameter/value to each post/page. I do not need this.
Is there any way to add this 1 single parameter to the permalink-URL directly from the post, without changing 18 php files and writing hundred lines of code?
Thank you for any help!
m
PS. I am using WP 3.6.1 DE with inovado
.
Things I have already tried
- WP Codex add_query_arg()
- Stackoverflow: question 4586835 how-to-pass-extra-variables-in-url-with-wordpress
- Cookie-monster: wordpress-url-parameter-utility
- Creativebloq: user-friendly-custom-fields-meta-boxes-wordpress-5113004
- Farinspace: how-to-create-custom-wordpress-meta-box
- stackexchange.com: questions 51444 - add-extra-parameters-after-permalink
and finally
- webopius: using-custom-url-parameters-in-wordpress