I am trying to: To return the Custom Post Type description in the frontend.
Is there a function or shortcode?
Can Descriptions be translated as well?
Thanks,
Aldo
Hello.
Thank you for contacting the Toolset Support.
In order to be able to answer this question properly, I need to know where exactly you want the Custom Post Type description to appear. You want it displayed in a View or in a Content Template?
About the translation of the custom post type description, you can do it using WPML but for further queries, regarding translation issues, you'll have to contact WPML support here https://wpml.org/forums/forum/english-support/
If you have any further issues, please let me know.
Regards
Hello.
In order to achieve this, you need to create a custom shortcode.
Insert the following code into your functions.php, that creates the shortcode.
// Add Shortcode [get_post_info post_type="[wpv-post-type show='slug']" attribute="description" ]
function get_post_type_info( $atts ) {
// Attributes
$attri = shortcode_atts(
array(
'post_type' => '',
'attribute' => '',
), $atts );
// Code
$obj = get_post_type_object( $attri["post_type"]);
$array = get_object_vars($obj);
return $array[$attri['attribute']] ;
}
add_shortcode( 'get_post_info', 'get_post_type_info' );
Now, inside your Content Template use the following shortcode
[get_post_info post_type="[wpv-post-type show='slug']" attribute="description" ]
If this doesn't resolve your issue or you have any further issues or questions, please let me know.
Regards