Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #783923

    Hi,
    We’re developing a corporate site and we are facing a big problem trying to translate the taxonomy base slug.
    Our thought was that if we registered our custom post and taxonomies the way u register portfolio post type we would be able to translate the base slug… but it didn’t worked. Later I tried translating the portfolio base and it doesn’t work either.

    I have the latest update of enfold and WPML installed.
    Example of our CPT & Tax:

    add_action('init', 'news_register_extended', 999 );
    function news_register_extended()
    {
        global $avia_config;
    
        $labels = array(
            'name' => _x('News Items', 'post type general name','avia_framework'),
            'singular_name' => _x('News Entry', 'post type singular name','avia_framework'),
            'add_new' => _x('Add New', 'portfolio','avia_framework'),
            'add_new_item' => __('Add New Item Entry','avia_framework'),
            'edit_item' => __('Edit News Entry','avia_framework'),
            'new_item' => __('New Entry','avia_framework'),
            'view_item' => __('View News Entry','avia_framework'),
            'search_items' => __('Search News Entries','avia_framework'),
            'not_found' =>  __('No News Entries found','avia_framework'),
            'not_found_in_trash' => __('No News Entries found in Trash','avia_framework'),
            'parent_item_colon' => ''
        );
    
        $permalinks = get_option('avia_permalink_settings');
        if(!$permalinks) $permalinks = array();
    
        $permalinks['news_permalink_base'] = empty($permalinks['news_permalink_base']) ? __('news-item', 'avia_framework') : $permalinks['news_permalink_base'];
        $permalinks['news_entries_taxonomy_base'] = empty($permalinks['news_entries_taxonomy_base']) ? __('news_entries', 'avia_framework') : $permalinks['news_entries_taxonomy_base'];
    
        $args = array(
            'labels' => $labels,
            'public' => true,
            'show_ui' => true,
            'capability_type' => 'post',
            'hierarchical' => false,
            'rewrite' => array('slug'=>_x($permalinks['news_permalink_base'],'URL slug','avia_framework'), 'with_front'=>false),
            'query_var' => true,
            'show_in_nav_menus'=> true,
            'taxonomies' => array('post_tag'),
            'supports' => array('title','thumbnail','excerpt','editor','comments')
        );
    
        $args = apply_filters('avf_news_cpt_args', $args);
        $avia_config['custom_post']['news']['args'] = $args;
    
        register_post_type( 'news' , $args );
    
        $tax_args = array(
            "hierarchical" => true,
            "label" => "News Categories",
            "singular_label" => "News Category",
            "rewrite" => array('slug'=>_x($permalinks['news_entries_taxonomy_base'],'URL slug','avia_framework'), 'with_front'=>true),
            "query_var" => true
        );
    
        $avia_config['custom_taxonomy']['news']['news_entries']['args'] = $tax_args;
    
        register_taxonomy("news_entries", array("news"), $tax_args);
    
        //deactivate the avia_flush_rewrites() function - not required because we rely on the default wordpress permalink settings
        remove_action('wp_loaded', 'avia_flush_rewrites');
    }

    Please help : ) and thank you for your effort with this theme.

    #785020

    Hey Abbe,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look.

    Best regards,
    Victoria

    #788297

    Hi Victoria,

    You can mark this post as resolved. We finally switched to Polylang that has an option to translate the tax base slug.
    Some filters and rewrite rules and now URL are working as expected.

    Anyhow, your theme has a little issue with Polylang. Theme settings panel won’t work for lang specific, instead it takes the highest level config, making imposible to define different href attributes for social icons menu.

    Should i start another post or we can work this out in this one?

    thank you.

    #789127

    Hi Abbe,

    Ok, we can do it here. So what is the issue and we might still need the temp admin access to be able to look closer and have more context.

    Also keep in mind this reply https://kriesi.at/support/topic/polylang-and-homepage-issues/#post-718671

    Best regards,
    Victoria

    • This reply was modified 7 years, 6 months ago by Victoria.
    #789462

    Hi Victoria,

    I write from my personal account on behalf of Contrapunto & Tiempo BBDO Barcelona. I’ll set up an account for you at our QA servers.
    I already found the link you provided on a previous search before posting. I also found around 10 post asking how to set up the home page with Polylang and some other threads about it.

    I kindly ask you to be honest with me and tell me if its worth the time im gonna spend in here with you or if everything is gonna end up on “hire a freelancer” which we will not do

    Another thing to keep in mind, there isn’t many good translating plugins out there. WPML and Polylang must be on the top 3 for this type and other theme devs, like T.Fusion are already supporting it.

    You do great work on your themes, that’s why I also add it to your request list.

    best regards.

    #789546

    Hi Abbe,

    You can place your request here:

    Unfortunately, I cannot tell you why Polylang is not supported, I just don’t know the story. I saw people using Loco Translate as well.
    And since you’re developing, I’m pretty sure that your developers will be able to come up with a solution for the issue.

    Best regards,
    Victoria

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