Rewrite rules and query_var
-
Hello guys,
extending my custom theme, I discovered rewrite rules and I am planning to set them up for dinamically building “Leagues” pages based on its ids.
After some research (correct me if i am wrong), I learnt that it has 3 parts, the rewrite rule, query_var and template assignment to this vars.
To follow my actual theme and build my own, i looked for all those elements everywhere (.php templates, .htacess, theme’s associated plugin…), but only managed to find rewrite rules on my functions.php, the others are missing and i am unable to find them.
I am looking in the wrong place? Where should i look those definitions on? It works different, what I am missing?Rewrite rules look like follow:
// Match page
add_rewrite_tag(‘%streamname%’,'([^/]*)’);
add_rewrite_rule(
‘^stream/([^/]+)$’,
‘index.php?pagename=stream&streamname=$matches[1]’,
‘top’);I am pretty sure i am looking for the right things, because the Match.php extracts “id” from URL slug and query for correct match, i am just missing the connection point.
You can see a working example of that on https://teamdarkpirates.com/equipos-dark-pirates/ clicking on any team tile, those pages does not exist are build onruntime.Thanks you guys in advance.
- The topic ‘Rewrite rules and query_var’ is closed to new replies.