Slugs

This support request was posted in Paeon by icokevicius

Request ID #29111 In Progress
  • Hi, the web is http://www.llanesclinica.com/, i need change the slug “service” to “servicios”.

    In general menu when i click in “servicios” all is ok, the URL is http://www.llanesclinica.com/servicios, but if i click in anyone service the URL is: http://www.llanesclinica.com/service/radiodiagnostico/ when i need this: http://www.llanesclinica.com/servicios/radiodiagnostico/

    And in “Especialidades” when you go to page: http://www.llanesclinica.com/especialidades/ and you click in anyone the URL is like this: http://www.llanesclinica.com/service/medicina-de-familia/ i need to establish http://www.llanesclinica.com/especialidades/medicina-de-familia/

    Thank you very much, regards.

    Juanfra Aldasoro

    Hi,

    Thank you for writing. I hope you are doing well.

    The “service” part of the URL is set when defining the “service” Custom Post Type.

    I’m pretty sure there might be a plugin in the WordPress.org plugin repository in order to get that changed.

    If not, it’s pretty simple. You can check how the menu custom post type is defined in /paeon/includes/custom-post-types/service.php

    You’ll need to change the “rewrite” parameter (You can learn more here: http://codex.wordpress.org/Function_Reference/register_post_type)

    Then, use something like

    'rewrite' => array( 'slug' => 'whatever-you-want-instead-of-service' ),

    Finally, reset your permalinks structure in “Settings > Permalinks”.

    With regards to having two different slugs for the same Custom Post Type, that’s not possible unfortunately.

    Best,
    Juan.

    This reply has been marked as private.
    Juanfra Aldasoro

    Hi,

    Thanks for the follow up.

    By doing that you have modified the slug for the service category taxonomy. What you need to do is change the

    'slug' => true,
    

    Present in the function add_nice_service()

    Best,
    Juan.

    This reply has been marked as private.

    Hi,

    Thank you for the follow up.

    Sorry, my bad, I meant to write rewrite instead of slug.

    What you need to do is replace:

    'rewrite' => true,
    

    with

    'rewrite' => array( 'slug' => 'servicios' ),
    

    You can find that in line #32 of that file.

    Please remember that this is an open forum and we only ask to mark messages as private if the person requesting for support needs to provide information such as wp login, ftp access or similar.

    Thank you,
    Juan.

    It works. Thank you.

    My pleasure 🙂

    Have a nice day,
    Juan.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server