Hello, I would like the “List a service” button to redirect me to another page. Can you give me the CSS or Snippet code to change the button redirection? Thank you
Hi,
Please use this PHP snippet: Change the Add Listing page URL slug (requires refreshing permalinks) #hivepress #listings · GitHub
I hope this is helpful to you.
Another issue with the same request @andrii
When I use this code, it works, the “List a Service” button redirects me to another page.
add_filter('hivepress/v1/routes', function($routes) {
$routes['listing_submit_page']['path']='/publish-listing';
return $routes;
}, 1000);
But then I can’t use the link: https://molnee.com/submit-listing/details/
So what should I do to be able to redirect the “List a Service” button to another page: molnee.com/publish-listing and continue to use the URL https://molnee.com/submit-listing/details/ separately?
Thanks a lot.
Hi,
I see. We recommend not changing the URL for the route. If you only need the button to hook and the URL to work, we recommend overwriting this template part /listing/submit/listing-submit-link.php
with a child theme: How to override template parts - HivePress Help Center
And if you need to block the URL altogether, the best option is to disable the publication of listings in HivePress > Settings > Listings.
I believe this will be useful to you.
Hi. I used the code above and everything worked as I wanted. The button in the header directed to the /wspolpraca page (which I created in Elementor), while on another page I placed a button that directed to the /submit-listing/details page with form.
But the next day something happened without my involvement. The /wspolpraca page changed to the /wspolpraca/details page and the form to add listing is displayed there, while the /submit-listing/details page doesn’t work at all.
I created the /wspolpraca page in Elementor and it appears to have been changed to a form page. Disabling the PHP snippet causes neither of these pages to work.
Hi,
Yes, the code above changes the URL specifically for the route built-in, which takes you to the submit listing process (built-in). It is not possible to create a custom page with the wspolpraca slug and use the code to put this slug as the basis of the submit listing, because then there will be conflicts and random redirects (because WordPress does not understand this submit listing route or the page you created, since the basis is the same in the URL). We recommend that you just create a custom template in HivePress > Templates for Add Lisitings, but note that only the editor block works there.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.