Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @harkad17,

    Are you using a plugin to create the service post type or custom code? Changing the “slug” as mentioned in here should help:
    https://wordpress.stackexchange.com/questions/41988/redeclare-change-slug-of-a-plugins-custom-post-type

    Please do check and see whether the above helps.

    Kind Regards,

    Nithin

    Thread Starter harkad17

    (@harkad17)

    No I am not using any plugins. My website contains “Pages” which are basically all website apart from section where I have my Services that I offer. – https://imgur.com/a/V0W5Ce0

    And that services, I created in “Services” – and thats why its says Services in my URL. – https://imgur.com/a/gZBDW6J

    So I just want to change it to other word (other language-not english) but I am not too advanced with coding etc.

    Hi @harkad17,

    And that services, I created in “Services”

    The “Services” is called a custom post type, which isn’t a default feature in WordPress. It’s either part of the theme or plugins which has added “Services” as a post type.

    The initial reply was to update the code if it was added by you using a custom code, but it doesn’t sound like that.

    The “Services” is only present because a specific plugin or theme is activated, so what could be suggested to modify it is limited since I’m not sure how it was added.

    However, could you please try and see whether the following snippet helps:

    <?php


    function change_service_post_type_args( $args, $post_type ) {

    if ( 'service' === $post_type ) {

    $args['rewrite']['slug'] = 'servis';

    $args['rewrite']['feeds'] = true;
    $args['rewrite']['pages'] = true;


    $args['rewrite']['with_front'] = false;

    }

    return $args;
    }
    add_filter( 'register_post_type_args', 'change_service_post_type_args', 10, 2 );

    You can implement the above code using mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Please make sure you have a backup before you make the recommended changes.

    Once the snippet is added, you’lll have to refresh the permalink in your WP dashboard under Settings > Permalinks and by clicking the “Save Changes” button and then check whether that changes the slug.

    The current code changes the slug from service to servis, you can update the snippet according to your need.

    If you still face issues with the above method then most probably it would mean the existing plugin/theme is preventing the snippet from working and it’s something you’ll have to check with the respective plugin/theme support on how to update within the plugin or theme.

    Kind Regards,

    Nithin

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.