There are many great code snippets in their Gitlab. You might find more on their…
Custom Category Shortcode
// Add Custom Category Shortcode
function enym_statusx( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'label' => '',
'class' => '',
'link'=>''
),
$atts
);
global $post;
//$terms = wp_get_post_terms( $atts['post_id'], $atts['taxonomy']);
//$term = get_term( '24', 'objektart' );
$terms = wp_get_post_terms( $post->ID, 'projektstatus' );
//print_r($terms);
$tax = $terms[0]->term_id;
$name = $terms[0]->name;
return $name;
}
add_shortcode( 'category_status', 'enym_statusx' );
Dieser Beitrag hat 0 Kommentare