If not, can i just override default taxonomy URLs to point they to my archive-page?
I am not sure about newer version of the WP, but In the past I managed to create a taxonomy, say ivan_taxonomy
and I also created a page, which slug was also ivan_taxonomy
. So, when user viewed posts through example.com/ivan_taxonomy/super-cool-post/
, he could have gotten easily to example.com/ivan_taxonomy/
and my page was being displayed. (Not sure, whether you wanted to know sth like this :-D)
And I want something like this:
…
Easy, grab a url param and create a WP_Query with dependence on it, for example:
if(isset($_GET) && false != $_GET)
{
//whitelist
$allowed = array("category", "tag");
$url_params = array_keys($_GET);
//get your term, provided it is the first in a query,
$term = (string)array_shift($url_params);
//get your id
$id = (int)$_GET[$term];
//validate input
if(in_array($term, $allowed) && (false != get_the_term_list( $id, $term )))
{
$query = new WP_Query(array($term => $id));
}
}
Or it would be a lot easier with url like example.com/archive-page/?term=category&id=8
.