07/04/2016 at 12:55 pm
#381461
Guest
Hey,
thanks for the hint.
It worked, but I think you mixed something up :-)
if ( ! empty( $text ) && in_array( 'meta_key', $categories ) ) {
echo '' . esc_html( $text ) . '';
}
->meta_key must be the categories name where I want to show the custom field, not the custom field name.
Furthermore I’ve added:
if ( $atts['show_title'] && !in_array( 'trainer', $categories ) ) $entry->getTitleBlock();
So the title is always shown except in category “trainer”, and the “mannschaft” custom field is shown only in trainer. Did the trick, perfect!! Thanks
