Hello, I am a bit confused about how WordPress's permalink works, especially beyond Wordpress's own usage. My permalinks are like:
%post_id%-%post_name%
But in single.php
I want to put another link to page itself but with different query string. When it is clicked the permalink structure may look like:
%mystring%-%post_id%-%post_name%
I want to get the value from $_GET['action']
, so:
$_GET['action'] = %mystring%
my plan is to interpret it like:
if('xx' == $_GET['action']){
//do xx stuff
} else if ('yy'==$_GET['action']){
//do yy stuff
} else {
//show the single post as a single.php always shows
}
that means, I want to parse the $_GET['action']
optionally. If I do not parse it even if it is available in query string, I want the page to be rendered correctly.
So to get this done, where should I actually work? Also how do I form the link for <a>
tag? Usually we make link this way:
<a href="'.the_permalink().'">TEXT</a>
but you already know, I need to add some text before the original permalink of post.
Thanks in advance.