Hi there,
Add this PHP snippet to create a shortcode:
add_shortcode( 'comment_number', 'tu_comment_number_sc' );
function tu_comment_number_sc() {
ob_start();
comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
return ob_get_clean();
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Then you can use [comment_number]
inside page hero content.
Let me know if this helps 🙂