Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1113433
    macknum
    Participant

    Hi,

    I found some entries but no solution right now. I am using WPML on a dual language site. I would like to translate the portfolio slug using WPML. Is this possible right now?

    #1113445
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    add_filter('option_x_custom_portfolio_slug','translate_portfolio_slug');
    function translate_portfolio_slug( $content ) {
    	return __( $content, '__x__' );
    }

    After that navigate to WPML String Translation then scan all the texts again.

    Hope it helps πŸ™‚

    #1113454
    macknum
    Participant

    thx, this basically works, I now have the issue that the permalink of the portfolio item did not change. the generated link is “/produkte/” which is the german original I entered in the x-theme configuration. This is translated when browsing to “/products/”, which is correct, the english version of the item still shows “/produkte/product-item/”, and I cannot change this manually with the item since this only allows me to chante “product-item” and not “/produkte/produkt-item/”

    #1113460
    Thai
    Moderator

    Hi There,

    In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1113465
    macknum
    Participant
    This reply has been marked as private.
    #1113469
    Thai
    Moderator

    Hi There,

    Can you set that account to the Administrator?

    Thanks.

    #1113473
    macknum
    Participant

    done

    #1113643
    macknum
    Participant

    did admin work?

    #1113755
    macknum
    Participant

    fyi: I set the string translation to the original “produkte” so the site is working currently. after you have checked it I would like to set it to “products” again

    #1115855
    Rad
    Moderator

    Hi there,

    It can’t be done without direct coding. Slugs are identifications of a page and changing it while running will detach them to the page it identifies which will result to 404.

    There are two possible ways, but we can’t provide deeper customization.

    1. Please check this https://wpml.org/documentation/getting-started-guide/translating-page-slugs/ and the file responsible for post type registration is this wp-content\themes\x\framework\functions\global\admin\custom-post-types.php

    2. Or using .htaccess rewrite to redirect the request to translated slug then internally forward it to its respective WPML query variables. This is tricky and hard, I would contact WPML as they are more familiar with it.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1113433 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>