Change comments count text

Content Views helps you to show comments count of WordPress posts easily without coding. By default, Content Views uses the default WordPress comment counting function.

If you want to change comments count text, please add this code to file functions.php of your WordPress theme:

// Content Views - customize comments count output
add_filter( 'pt_cv_comments_count', 'cvp_theme_comments_count', 100, 1 );
function cvp_theme_comments_count( $args ) {
	comments_popup_link( 'No Comments', '1 Comment', '% Comments' );
	$args = ob_get_clean();
	return $args;

You can modify ‘No Comments’, ‘1 Comment’, ‘% Comments’ as you want.

This is available for both Free & Pro version of Content Views (since free version

Thank you,

Shuffle Filter – show Dropdown options in 2 columns

If you have a lot of options, it will be friendly to show options in 2 columns, to help visitors to select filters without scrolling too much.
To do it, please add this code to Custom CSS field in Content Views >> Settings page:

.pt-cv-wrapper [id^="pt-cv-filter-bar-VIEWID"] >.dropdown-menu {min-width:400px}
.pt-cv-wrapper [id^="pt-cv-filter-bar-VIEWID"] ul.dropdown-menu li {width:48%!important;display:inline-block}

(replace VIEWID with ID of your View).

To make it works with ALL dropdown filters, please use this code instead: .pt-cv-filter-bar >.dropdown-menu {min-width:400px} .pt-cv-filter-bar ul.dropdown-menu li {width:48%!important;display:inline-block}

Best regards,

How to add “NEW” icon after recent post title?

You might want to show a “NEW” icon after your latest posts’ title.
Please add this code to file functions.php of your active theme:

// Content Views Pro - Show custom icon in title
add_filter( 'pt_cv_field_title_result', 'cvp_theme_title_new_icon', 100, 3 );
function cvp_theme_title_new_icon( $title, $fargs, $post ) {
	$hours	 = 24; /* TODO: change this value to number of hours to calculate */
	$diff	 = time() - mysql2date( 'U', $post->post_date );

	if ( $hours * 60 * 60 > $diff ) {		
		// 1. To show a "New" icon/image, remove the 2. below
		$title = $title . "<img src='IMAGE_URL_HERE' />";
		// 2. To show a "New" text, remove the 1. above
		$title = $title . "<span style='padding:2px 8px;color:#fff;background:red;margin-left:5px;'>New</span>";

	return $title;

Thank you,

How does Content Views Pro get the thumbnail?

With Content Views Pro, you can show featured image, image/video/audio in post content, image custom field as thumbnail. Here is how:

  • By default, Content Views Pro (CVP) will look for the featured image.
  • If no featured image found (or if you select CVP setting which forces to replace featured image), CVP will look for image/video/audio URL in post content (how to insert image/video/audio URL).
    If one of these things found, it will be shown as thumbnail (see demo).
  • If nothing found, CVP will display a default image (how to replace default image by your image).
  • Also, You can show an image custom field as thumbnail (read document).

Best regards,

Add new social share buttons (WhatsApp, Tumblr, Parler, Email)

Content Views Pro helps you to show social share buttons easily. By default, you show sharing buttons of Facebook, Twitter, Google +, Linkedin, Pinterest.
To add more social share buttons, please:

  • enable “Social Sharing” in the “Display Settings” tab of the View
    Content Views Pro - social sharing
  • add this code to file functions.php of your active theme:
    // Content Views Pro - Add new social buttons
    add_filter( 'pt_cv_social_links', 'cvp_theme_social_links', 100, 3 );
    function cvp_theme_social_links( $buttons_html, $url, $title ) {
    	### whatsapp ###
    	$social_link	 = sprintf( 'whatsapp://send?text=%s', $url );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-whatsapp' ) );
    	### tumblr ###
    	$social_link	 = sprintf( '', $url );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-tumblr' ) );
    	### parler ###
    	$social_link	 = sprintf( '', 'Check%20this%20out', $url );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-parler' ) );
    	### email ###
    	$email_link	 = sprintf( 'mailto:?subject=%s&body=%s', 'Hello, check this post', str_replace( array( ' ', '+' ), '%20', $title ) . ": $url" );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $email_link, esc_attr( 'pt-cv-social-email' ) );
    	return $buttons_html;
  • add this code to Custom CSS field in Content Views >> Settings page:
    .pt-cv-social-whatsapp {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAZlBMVEVWuGFXumFXuWNWuWJXumP////t+O5fvmv6/vva8N2EzY11xn/P7NPM6s+/5cS6479rw3ZbvGfE58mz4Lma1qGr3bGQ0piJz5L0+vXw+fHj9OXV7tjH6Muj2qp7yYSp3K+f16aV1J0/49wtAAAABHRSTlP7+IB8OxNwCAAAANtJREFUOMvNk90SgiAQhak4C6SigD9ZavX+L5nUMNMg2kxXcrUDH+zZsws7HfjGYkcWn8cE4z/W/oDzvdTNeRV4Ei5K9aA6CRiLYfJBZlGIBDDINoSdzJdAjfZLCx4xYMhyXlJ4uryICOiQ8Qrh4hy2EeBoVge48PK1jAB787uoAlDkETB4YJK5WQMcfUpR2USNCCkikd5MCQnUCZGm1x/5jnATiTK5kyG98EaNCydV8WVkwuoK91HZt45Mp5o1ArIg9EpRut257nzuRs8DY/Y91X98TsaOmwQ7vQBKsRaFijPuWgAAAABJRU5ErkJggg==) no-repeat !important;
    .pt-cv-social-tumblr {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAATlBMVEU5WXb///9adY7u8fPq7fC8x9FYc4v5+vva3+XJ0tpzip9HZYD4+frw8/Xe4+jS2eDN1d24w86frrySo7OPobKClql2jKBVcIlOa4U/XnoLzaiKAAAAXklEQVQ4y+XKNxKAMAxEUclBTuTM/S+KXVBKVIwL/2pn9kGTLT7IYEAj/hFFkHYnA3yzvwE68tkrRRcwqQx0GZVBJwHCXAQ4OXC7IrxB4AqIJR6Q/gCQVjtO8wbN9QDT4gH/kQUgiwAAAABJRU5ErkJggg==) no-repeat !important;
    .pt-cv-social-email {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAllBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8oKCjExMTc3NzY2Nj8/PyYmJg8PDwrKyv4+PjV1dWmpqaFhYVqampiYmJXV1dFRUUvLy8FBQXx8fHt7e3b29vFxcWpqamSkpKJiYl2dnZnZ2cdHR0LCwv09PTi4uLg4ODHx8fDw8O4uLizs7Orq6uLi4t7e3tubm5NTU0lJSUn0fMjAAAABnRSTlP6+/iAfXyEjkPGAAAAs0lEQVQ4y93Sxw6CQBSF4VF0DsLQe6/2/v4vp8YQGSCwMjH+2/NtbnLJYk5HmgmE2/sRQif6KxCIvQIOaBd0KjQOyI6ro5XuOgYHJFhq9Nkj1YLcATArqdljLUUfYE937z0REwwBxNUJz1JfwjCAQs9AThVgGFiqodqlZ/j5IGCvS5ltM6xvJeuD0CvQxK5e2AVbX0GrTNvwwLwfwHWsTQ7UyqpTFvzcR30VzCZ2IpDRffkA0EEfRcjCR6IAAAAASUVORK5CYII=) no-repeat !important;
    .pt-cv-social-parler {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAflBMVEW/Hi3///++GirAHy7FMj/BJTPruLvnq67RW2Tz1NXkn6TAIjHmqKzLSVT89PTjnKLeiZHz1tjpsLTlo6jilpzcgIfWbXbDKzjCJjT02Nvwy87vx8nsv8Hei5LTZG3QWmPPVF/ELjv67+/56uv34uT24uPy09TdiZHTZm/HO0c6oKDXAAAAtElEQVQ4y+XRWRaDIAwF0CQ4UEWt86y1c/e/waLl+EO6Au8vjxc4gYMRi2PUgriAq9LT5tmrqWECTY+7WDnMiEjOs9SmsUNUTAftHB9jSUwCxAbo02IClvCd+ysVkfDRC637VYw/FUGAg2sVZHjzAy3RDRnT4HqYCFMWPbAAJvAiIE1EA14vxATOBLIsy/yOmITABvTwVRws8CdQtGna5dJ8gRlRm23ygdEc8MKqsF5u7eLAvh4nCLfcRZZNAAAAAElFTkSuQmCC) no-repeat !important;

If you are using another plugin to add social buttons to your site, you might integrate that plugin to grid/list View using the code here (see document).
The code for // Put the text, HTML or PHP code here is the PHP function (or shortcode) to shows social buttons for a post of the social plugin (you might contact their support to know that function).

Best regards,

Show an image custom field as thumbnail

Content Views Pro version 5.5.0 and higher

Since Content Views Pro version 5.5.0, you can easily show image custom field as thumbnail without coding.

Here is the configuration in Display Settings >> Fields Settings >> Thumbnail of the View to show any image custom field as thumbnail:

Content Views Pro version 5.4.1 and prior

For previous Pro versions, to show the custom field as thumbnail, please follow steps below:

  • In the View where you want to show the custom field as thumbnail, select the Show Thumbnail checkbox in Display Settings >> Fields settings.
  • Under Display Settings >> Fields settings >> Thumbnail >> Substitute, please configure as below:
    CVP - show custom field as thumbnail
  • Add this code to file functions.php of your active theme:
    // Content Views Pro - Use custom field as thumbnail
    add_filter( 'pt_cv_field_content_excerpt', 'cvp_theme_custom_field_as_thumbnail', 999, 3 );
    function cvp_theme_custom_field_as_thumbnail( $args, $fargs, $post ) {
    	if ( empty( $fargs ) ) {
    		$custom_field = 'CUSTOM_FIELD';
    		$fval = null;
    		if ( class_exists( 'CVP_CTF' ) ) {
    			$ctf = new CVP_CTF( $custom_field, $post, true, '' );
    			if ( !empty( $ctf->field_value ) ) {
    				$fval = $ctf->field_value;
    		if ( empty( $fval ) ) {
    			$meta = get_post_meta( $post->ID );
    			if ( !empty( $meta[ $custom_field ][ 0 ] ) ) {
    				$fval = $meta[ $custom_field ][ 0 ];
    		if ( $fval ) {
    			$args = sprintf( "<img src='%s'>", $fval );
    	return $args;

    (replace CUSTOM_FIELD with slug/key of your custom field).

Notice: If you created custom field with Toolset plugin, you may need to add prefix wpcf-. For example, you created a custom field post-image with Toolset plugin, then the value of CUSTOM_FIELD should be wpcf-post-image.

Thank you,

Show multiple languages (multilingual) posts with WPML, Polylang plugin

This feature is only available in the Pro version.

Content Views Pro will help you to show posts in all languages by WPML (or Polylang) plugin in your WordPress site easily.
You only need to create one View to show content in ALL languages.

For example, your content is available in 3 languages: English (default), Spanish, Russian. And you want to show some posts in an English page (this page has translation pages in Spanish, Russian).

Please do simple steps below:

  • Click Content Views > Add New to add new View, or edit an existing View
  • In admin toolbar at top of the page, switch to the default language:
    WPML - Change language in admin
    (mouse over the language bar, click the default language)

    For Business users, the WPML language bar (until version 4.0.6) doesn’t show at top. To switch to the default language, please append
    to the end of current URL, then press Enter.
    With CODE is the code of default language in the WPML languages table.

  • Adjust View settings to filter and show posts in your desired way
  • Save the View
  • Paste the View shortcode to the page of the default language, and all of its translation pages.

Thank you,

Get Content Views Now!