Tell us what you are trying to do?
Show Name instead of ID
Is there any documentation that you are following?
Following the thread: 'Yoast primary taxonomy : displaying something else than the ID' with Minesh.
What is the link to your site?
It's restricted
I added in the view: [wpv-post-field name='_yoast_wpseo_primary_wpdmcategory'] ... and it shows the ID of the primary category in WPDM = WordPress Document Manager. Sofar, so good.
But I want to show the name.
In functions.php I put the following code and tried to adapt it to the Custom Post Type of Document Manager:
function func_get_yoast_primary_category( $atts ) {
global $post;
$cat_id = get_post_meta($post->ID, '_yoast_wpseo_primary_wpdmcategory',true);
$term = get_term( $cat_id );
return $term->name;
}
add_shortcode( 'get_yoast_primary_wpdmcategory', 'func_get_yoast_primary_wpdmcategory' );
What is it I do wrong?
Greetings,
Charlotte
Yoast is not a Toolset Product. It seems that you are achieving this display with Custom Code related to Yoast's API and WordPress API, and as such, it's not something we can do for you.
Usually, in a view displaying terms, all you need to do is insert a ShortCode to display the Term name:
[wpv-taxonomy-title]
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153462
Now, if you can link me to Minesh's thread and update me how this relates to Toolset and it's supported features as seen on our Support Policy (https://toolset.com/toolset-support-policy/) I might be able to have a look and tell what needs to change.
However looking at the Custom Code you outline, this is not something we support because it's not related to Toolset or it's API.
Solutions, in this case, can be to ask Yoast for assistance or the listed and trusted contractors here https://toolset.com/contractors/
Thank you!