Hello, i found some code, which outputs an arbitrary field in the announcement.
//dispay acf field in excerpt
function custom_field_excerpt() {
global $post;
$text = get_field('filedname');
if ( '' != $text ) {
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$excerpt_length = 60; // 20 words
$excerpt_more = apply_filters('excerpt_more', ' ' . '[Hello...]');
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters('the_excerpt', $text);
}
But a single field is displayed. Help please, bring a few fields in the announcement.
Hi @tapioka
I’m sorry I’m not sure what is the problem. Could you please share some screenshots of the issue?
Thanks!