Can't echo translated post-type name
-
Hi. I need to echo some labels of my custom post types, namely the ‘name’ and the ‘singular_name’, but the translation is not working.
I have created the custom-post-types with Types plugin, activated this custom post type in the Polylang > Settings section and added its correspondant translations for all labels (name, singular-name, etc.) in the String Translation section.
But when I do
$post_type = get_post_type(); $post_type_object = get_post_type_object($post_type); echo $post_type_object->labels->name
what is echoed is the base language name. How can I get the translation of the current language?Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Can't echo translated post-type name’ is closed to new replies.