Join our new community forum for support & discussion
Join NowSnippet for changing slugs on JobHive
-
AuthorPosts
-
martin 1 year, 11 months ago
Hi!
As per your E-mail i’m creating a post here on the forum.
The snippet for changing slugs on ListingHive doesn’t seem to work on JobHive.
Can you please provide a snippet we can use for translating the slugs.The one’s i want to translate is:
http://www.site.com/jobs
http://www.site.com/companies
http://www.site.com/company
http://www.site.com/job-categoryAs a feature-request for the future – it would be awesome to be able to translate the slugs either via Loco Translate or integrated in the theme or plugin 🙂
Thanks, this feature is on the roadmap (adding the slug options to Settings/Permalinks). Please try using this code snippet:
add_filter( 'hivepress/v1/post_types', function( $post_types ) { $post_types['listing']['rewrite']['slug'] = 'job-something'; $post_types['vendor']['rewrite']['slug'] = 'company-something'; return $post_types; }, 1000 ); add_filter( 'hivepress/v1/taxonomies', function( $taxonomies ) { $taxonomies['listing_category']['rewrite']['slug'] = 'job-category-something'; return $taxonomies; }, 1000 );
And then refresh permalinks. The first 2 links from the list seem to be pages, please edit them in WordPress/Pages section and change their URL slugs.
martin 1 year, 11 months agoThanks for your reply Ihor!
I tried your snippet, and it successfully changes the slugs in all the links on the site, however if you follow one of the links it doesnt work and show the listing / company etc.
I also tried refreshing permalinks as instructed.
If possible send more details, do you mean when you click on the listing link it still has the “listing” URL slug? Please make sure that this code snippet is added globally (e.g. via the Code Snippets plugin or to the child theme’s functions.php file).
martin 1 year, 11 months agoHi again!
I tried it again today, and it seems the issue is now resolved after i updated the “permalinks” page.
I did this also yesterday as per your instructions, but for some reason it didnt work then – luckely it does today.Thanks as always for awesome support!
Hanna 1 year agoHi,
1) Is it possible to leave listing slug out completely, meaning so that helmiolo.fi/listing/listing-name would become just helmiolo.fi/listing-name?
2) For slug translations I’ve found everything except helmiolo.fi/account/orders/, do you have the snippet for this one?
Thanks!1) Sorry, as far as I know there is no easy way to do this because WordPress uses the
example.com/slug
structure for regular pages in WordPress/Pages section, thelisting
part is required to detect that the current page has a listing type.2) It is possible to override it, but this requires a custom code snippet (for the
hivepress/v1/routes
filter hook), if you are familiar with code changes please try overriding the path of theorders_edit_page
route. Please consider leaving the private URLs as is because they require login anyway and they are not indexed by the search engines like the listing or vendor pages.Hanna 1 year agoThanks for your reply!
2) The following code doesn’t change the “orders” ending of https://helmiolo.fi/oma-tili/orders/. Did I get something wrong?add_filter(
‘hivepress/v1/routes’,
function( $routes ) {
$routes[‘user_account_page’][‘path’] = ‘/oma-tili’;
$routes[‘orders_edit_page’][‘path’] = ‘/tilaukset’;
// …return $routes;
}
);Please try this PHP snippet and please refresh permalinks in Settings/Permalinks after adding this code snippet
add_filter( 'hivepress/v1/routes', function( $routes ) { $routes['orders_edit_page']['path'] = '/tilaukset'; return $routes; }, 1000 );
Hanna 1 year agoI added the snippet exactly as you posted, and refreshed permalinks but no luck.
However, I changed the woocommerce my account page permalink to helmiolo.fi/omatili (it was oma-tili) and noticed that all other user account tabs use /oma-tili except for the orders tab. It uses /omatili/orders. So it seems that that tab comes from WooCommerce?
The other tabs follow the snippet where I have:
$routes[‘user_account_page’][‘path’] = ‘/oma-tili’;Please let me know if you mean the WooCommerce orders page (the one where customers view their orders) or the vendor orders page (this one is added by HivePress for managing orders). The latter one initially has the “/account/orders” URL, while the WooCommerce one is based on their account page URL, e.g. “/my-account/orders”. There may be confusion since WooCommerce also has its own account page for buyers.
-
AuthorPosts
New Reply
This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.