-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add is_route function #4
Comments
But you're right, there should be a template tag for that. |
I tried using your method as
but "Help section" is output on to every page, not only the only ones routed through "help-route-id". This happened when placing the above code in either header.php or page.php. Is there any other way to check the current route? P.s. thanks for a great plugin 👍 |
Hello, I ended up doing like this : // in header.php :
if(get_query_var('is_route_wiki') == 'true') echo 'menu-active';
// in functions.php :
$route_args = array(
'path' => '^wiki',
'query_vars' => array(
'is_route_wiki' => 'true' // ***** this is the line ***
),
'page_callback' => 'empty_callback',
'page_arguments' => array(),
'access_callback' => true,
'title' => 'Wiki',
'template' => array(
'templates/_wiki.php',
TEMPLATEPATH . 'templates/_wiki.php'
)
);
$router->add_route( 'wiki', $route_args ); |
Aah brilliant - that works for me! And thanks for the quick reply |
you're welcome ! |
@jbrinley : do you plan adding an |
Stick with your code for now. I plan to add template tags in the future, and |
Ok good ! I'll try to do it, I let you know if I reach something ;) |
Hello,
Is there a way to test what route I'm showing,
example, in my header.php, I'd like to do :
thanks
The text was updated successfully, but these errors were encountered: