Your account expired support, please renew to get your support.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #29676
    mih
    Support Expired

    Hello,

    how to change the slug for /accomodation/cotage and /whatwedo/activities?
    I would like to translate accomodation and whatwedo + others.

    Thanks!

    #29687

    Hello,

    Please send the admin web account for me, I will check and try to help you.

    #29693
    mih
    Support Expired

    Just advise us here. The client doesn’t feel comfortable sending admin passwords to 3rd parties at the moment.

    The question is pretty general though, maybe you don’t even need admin access.

    Thank you!

    #29701

    Ok, please follow the guide here:

    #1. Change slug: copy this code and paste it to file functions.php ( child theme):

    function activland_change_post_types_slug( $args, $post_type ) {
    
       /*item post type slug*/   
       if ( 'accommodation' === $post_type ) {
          $args['rewrite']['slug'] = 'your-slug';
       }elseif('activland_activities' === $post_type){
          $args['rewrite']['slug'] = 'your-slug';
        }elseif('activland_whatwedo' === $post_type){
          $args['rewrite']['slug'] = 'your-slug';
       }
    
       return $args;
    }
    add_filter( 'register_post_type_args', 'activland_change_post_types_slug', 10, 2 );

    #2. Translate:
    Please install Loco translate plugin: https://wordpress.org/plugins/loco-translate/
    and setup translate theme: https://localise.biz/wordpress/plugin/beginners

    #29762
    mih
    Support Expired

    Hi,

    thanks for the instructions. I have pasted the code from #1 to the functions.php of child theme.

    I see some changes in links, but only in the first link on the site for each slug. Other links are not affected. Also, when the changed link is clicked, it returns 404 error. Other links (with original slugs) work properly.

    Please help.

    #29764
    mih
    Support Expired

    Sorry, it’s not true about the links not changing. I was looking at static links. Dynamic links all change according to expectations.

    However, even if using the correct links or links from admin (for example Accomodation -> View) I always get a 404 error when opening a page.

    P.S.: My WP is installed in a subfolder – if that might be a reason?

    #29765
    mih
    Support Expired

    About #2 translating slugs
    I have installed Loco Translate and I can translate the texts found in the theme. However, I can’t find the texts for slugs. Where can I find them? What name are they stored under?

    #29769

    Not all customer guides can do it right, that’s why I asked for a customer account to look into and deal with the issue in person.
    You see, it took me a while to write a tutorial for you, then you solved it and had a problem… now it’s time for me to review and support this problem for you!!
    Please provide a web admin account so I can review and handle the issue for you.

    #29773
    mih
    Support Expired

    Well, you can’t blame me if I follow your instructions and they don’t work.

    Even if you fix the error, you will still have to tell what you did. Customer requires it.

    #29774
    mih
    Support Expired
    This reply has been marked as private.
    #29788
    This reply has been marked as private.
    #29803
    mih
    Support Expired

    Thank you, the slugs work now and don’t throw 404 error. What did you do to fix it?

    Can you also please help with #2 – Translation of the slugs. I will setup the page in other languages and the slugs need to be also in other languages. I didn’t find this option in Loco Translate. Where can I set them up for each language?

    #29818
    This reply has been marked as private.
Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.