I have installed wp router plugin to mange my search url.
After the successful integration of this plugin, I have found that it’s making conflicts with woocommerce setting page.
It shows following error on woocommerce setting page
Action failed. Please refresh the page and retry.
I have done lots of work using WP Router plugin so, I don’t want remove this plugin.
Can you please help with this issue.
Thank you.
]]>I am trying to output some code on a custom route within my default template. I am using the following code…
add_action( 'wp_router_generate_routes', 'sf_add_routes', 20 );
function sf_add_routes( WP_Router $router ) {
$route_args = array(
'path' => '^dashboard',
'query_vars' => array( ),
'page_callback' => 'sf_dashboard_route_callback',
'page_arguments' => array( ),
'access_callback' => true,
'title' => __( 'Dashboard' ),
//'template' => false
);
$router->add_route( 'dashboard', $route_args );
}
function sf_dashboard_route_callback( ) {
echo "This will be the dashboard";
}
It’s in a plugin and the route works but the echo isn’t output. If I set template to false or add exit into the callback the string is output without the rest of the page rendering.
The sample route included in the plugin also behaves in the same way.
I have tried copying in the default page.php from twentyfourteen and twentytwelve but all act in the same way.
Any ideas?
]]>Any idea how to disable the ability to recieve comments on the Placeholder page ?
That is beside setting ‘no comments’ as a site-wide default …?
Or will this break the plugin/site?
]]>Hello,
I installed it.
I have a quick and dirty plugin. Add your example to see if I can hook into it and watch the URL get changed from standard WordPress to another URL and make the page come into the template I created.
Can you add more documentation so I can figure out how to use it properly? Seems simple enough to setup but not know where to place things or what limits I can do may help me avoid this or use this plugin.
Thanks.
]]>When I re-route the pages a default comments section shows up at the bottom of the page. I’m looking for a way to soft disable this without having to make a new template. Any ideas?
]]>https://gist.github.com/luzpaz/c55dc557447ebc33deff
I’m trying to do something like this:
'title' => __( 'Locate Practitioners in '.print_r($page_arguments['country'] ).''),
]]>
I call this plugin from a custom made plugin.
I’m wondering how do I make multiple routes.
The routes that I’d like to set up are:
^find/practitioners/
and
^practitioners/
The error I’m getting from the below code is:
Fatal error: Cannot redeclare WP_Router_Sample::generate_routes()...
Here is the plugin code so far:
// I'm adding an array as an argument with the different routes I'm trying to add
add_action( 'wp_router_generate_routes', array('iabt_practitioner_find_routes', 'iabt_practitioner_results_routes', 20) );
function iabt_practitioner_find_routes( $router ) {
$route_args = array(
'path' => '^find/practitioners/',
'query_vars' => array( ),
'page_callback' => 'iabt_find_practitioner_route_callback',
'page_arguments' => array( ),
'access_callback' => true,
'title' => __( 'Demo Route' ),
'template' => array(
'page.php',
dirname( __FILE__ ) . '/page.php'
)
);
$router->add_route( 'iabt-find-route-id', $route_args );
}
function iabt_find_practitioner_route_callback( ) {
return "Congrats! Your demo callback is fully functional. Now make it do something fancy";
}
function iabt_practitioner_results_routes( $router ) {
$route_args = array(
'path' => '^find/practitioners/',
'query_vars' => array( ),
'page_callback' => 'iabt_results_practitioner_route_callback',
'page_arguments' => array( ),
'access_callback' => true,
'title' => __( 'Returning BCST Results' ),
'template' => array(
'page.php',
dirname( __FILE__ ) . '/page.php'
)
);
$router->add_route( 'iabt-return-route-id', $route_args );
}
function iabt_results_practitioner_route_callback( ) {
return "Congrats! Your demo callback is fully functional. Now make it do something fancy";
}
]]>
Hi there,
i have problems to get this plugin running. Although i followed the steps described for the installation.
I got a clean WordPress setup with current version (3.5.1, but also tried 3.4.2 and 3.3). I unzipped the plugin and moved it to the wordpress plugins folder and activated the plugin.
My local wordpress is under localhost/wordpress.
So when the plugin would work correctly i should see the example page when i go to localhost/wordpress/wp_router/sample. Is this correct? When i go to this url, i get 404 error.
I also tried to configure my own custom routes, but same result.
Anyone got an idea what i am doing wrong?
Thanks!
I have a custom WP_Query in my site’s header (in header.php), and wp-router is replacing that content too, instead of just the main content for the page. So the header content is missing, and the main content is on the page twice.
How can wp-router be LIMITED to just the main query / content?
I tried giving my header content a different post_type (a custom CPT i created, called “global_content”). But that didn’t work.. wp-router still replaced that content too.
Can we somehow tell wp-router to only replace a certain post_type?
]]>Will there be support for WordPress 3.4?
]]>Thanks for creating this plugin.
]]>