跳过导航

Resolved by author

Topic Tags: Compatibility

Overview of the issue

When using the Themify Ultra theme alongside the Post Type Builder (PTB) and performing a search through the top header search form, the dynamically displayed Custom Post Type (CPT) tags in the search results are not appearing translated.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/themes/themify-ultra/themify/includes/search-box-result.php file.
  • Look for line 3.
  • Replace this:
                        $title=$type_obj->labels->singular_name;
    
  • With:
                        $wpml_default_lang = apply_filters('wpml_default_language', NULL );
                        $wpml_cpt_name = $type_obj->name;
                        $title= get_option('ptb_plugin_options')['cpt'][$wpml_cpt_name]['singular_label'][$wpml_default_lang];
    

2 条回复 至 “Themify Ultra - Search Box Results CPT Tags Not Translated”

  1. The translation for CPT labels in PTB is done through PTB > Post Type edit. Under PTB > Post Type edit, you can choose the language translation input by clicking the flag icon. We’ve confirmed this is not a bug.

    • Thanks for the heads up. It seems that you need to activate first the languages in Post Type Builder > Settings > Enabled Languages for that purpose.