In some ealier topics, it was advised that we can change the URL associated to List a Service by using the below code snippet in the functions.php file of the child theme.
// Set a temporary slug for the "Submit Listing" page
add_filter('hivepress/v1/routes', function($routes) {
$routes['listing_submit_page']['path'] = '/example';
return $routes;
}, 1000);
However, this also deletes the option to access the /submit-listing/details/ page.
Basically, I want the button in the navbar/header section to redirect to another page, but I still want users to access the /submit-listing/details/ from other buttons on my website, which becomes impossible once I use the code snippet above.
Would you be able to assist? How do I change the URL of the List a Service button without entirely deleting the /submit-listing/details/ page?
The below code snippet, shared earlier, had no effect.
// Set a temporary slug for the "Submit Listing" page
add_filter('hivepress/v1/routes', function($routes) {
$routes['listing_submit_page']['path'] = '/new-listing';
return $routes;
}, 1000);
Kindly note that I did refresh the permalinks, but nothing seems to work.
We tested the second snippet and it worked on our side.
Please make sure that you add the snippets correctly (in functions.php of your child theme or by using a code snippets plugin: Code Snippets – WordPress plugin | WordPress.org). In this case, it completely replaces the URL base of the listing submission pages.
If you’d like to change a button, please ensure that the path is correct: meetinghive_child/hivepress/listing/submit/listing-submit-link.php