Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Changing comments title with ACF

Home / Forums / Kadence Theme / Changing comments title with ACF

This topic is: Not Resolved
[Not Resolved]
Posted in: Kadence Theme
November 18, 2021 at 3:16 am

Hello,
I use Generatepress on a daily basis but thinking of switching. For now, I try to move some functions from it e.g.

I’d like to have different comments title for each post/page using advanced custom fields. On the edit post/page screen I have a field where I put the title of a new comment and when a post has at least 1 comment it shows.

SO for example I see “New comment title” instead of “One Comment”.

I tried to modify the old theme code but no luck here.

Could you take a look?

add_filter( 'comments-title', function() {
// Get ACF Field
$acf_comment = get_field( 'new_comment_title' );
if ( !empty($acf_comment) ) {
return $acf_comment;
} else {
// Fall back text if ACF is empty
return 'Comments:';
}
} );

  • The forum ‘Kadence Theme’ is closed to new topics and replies.