Tag: shortcode

The shortcode to display quantity of post comments

The shortcode to display quantity of post comments

function get_comments_quantity( $atts, $content = null ) { $atts = shortcode_atts( array( ‘postid’ => ”, ), $atts); $num_comments = get_comments_number( $atts[‘postid’] ); if ( comments_open() ) { if ( $num_comments == 0 ) { $comments = __(‘No Comments’, ‘rehub_framework’); } elseif ( $num_comments > 1 ) { $comments = $num_comments . __(‘ Comments’, ‘rehub_framework’); }…

Read More Read More

Inline
Inline