• Resolved danjbh

    (@danjbh)


    Is there a way to alter the slug when you visit a category which currently show ‘/job-industry/’ in the url to something bespoke?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mark Wilkinson

    (@wpmarkuk)

    You should be able to do this using the register_taxonomy_args filter, which is documented here:

    https://developer.www.ads-software.com/reference/hooks/register_taxonomy_args/

    Thread Starter danjbh

    (@danjbh)

    When you say I should be able to do it? Is there a simple method of changing the url of ‘job-industries’ to ‘jobs’? Im not sure what I am filtering you see and I don’t want to mess around with the plugins code.

    OR

    Can you drop ‘job-industries’ and append the industries slug with ‘-jobs’ at the end?

    • This reply was modified 7 years, 9 months ago by danjbh.
    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    You can’t change the URL of the job industry terms to use the slug jobs. This is because the /jobs/ is used by the plugins custom post type archive for showing all of the jobs. You could alter this by using the filter register_post_type_args.

    https://developer.www.ads-software.com/reference/hooks/register_post_type_args/

    You could then make the post type archive for jobs use a different slug, for example alljobs.

    The custom post type archive for jobs will use archive-wpbb_job.php from your theme.

    The taxonomy for job industries needs its own slug. By default the plugin uses /job-industry/. Therefore if you had a job industry of accounting then the URL of the archive page which shows all the accounting jobs would be:

    domain.com/job-industry/accounting/

    If you want to change the job-industry part of that URL to something else (remember you can only use /jobs/ if you have altered the main post type archive – see above) you can do this by using the register_taxonomy_args filter. This is core filter and will not modify the plugin at all. You can add a function to your themes functions.php which filters the slug argument. It is also worth noting that different taxonomies cannot have the same slug. Therefore if you are using /jobs/ for the job industry taxonomy you can’t use it for the type, skill or location taxonomies.

    You mentioned appending the name of the industry with -jobs. You can do this in the WordPress admin area when you edit the terms. One of the options as well as editing the name and the description is to edit the slug and append -jobs to the end. You would then end up with:

    domain.com/job-industry/accounting-jobs/

    The custom taxonomy archive for job indsutry will use taxonomy-wpbb_job_industry.php from your theme.

    Thread Starter danjbh

    (@danjbh)

    Is there a way to simply have the url like:

    domain.com/accounting/

    So completely remove the /job-industries/ part of the url?

    Plugin Author Mark Wilkinson

    (@wpmarkuk)

    A quick Google has found this plugin which claims to do just that.

    https://en-gb.www.ads-software.com/plugins/remove-taxonomy-base-slug/

    Not sure what happens if you have a page with the same slug as a term though. One must overwrite the other.

    Thread Starter danjbh

    (@danjbh)

    Hi Mark,

    So I installed the plugin, it did exactly what I needed it to do, can you advise me though how to stop any links from including the /job-industries/ in the url so for example when I print out the industries from this custom post type it includes this as part of the url?

    **UPATE**

    Ignore this it had cached. It works perfectly.

    • This reply was modified 7 years, 9 months ago by danjbh.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change the url of /’job-industry/’’ is closed to new replies.