Title: Display Format
Last modified: September 11, 2021

---

# Display Format

 *  Resolved [teeragit](https://wordpress.org/support/users/teeragit/)
 * (@teeragit)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/display-format/)
 * Is there a way to show only the views number, without anything else? I’d like
   to customise the text around the number myself.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [4 years, 8 months ago](https://wordpress.org/support/topic/display-format/#post-14862340)
 * Yep, it’s possible. There are different ways to do that, but you could for example
   filter the output of the plugin, by adding a code snippet to your site [using a functionality plugin](https://jetpack.com/support/adding-code-snippets/).
   Here is the code snippet you could use to only display the number:
 *     ```
       /**
        * Customize the output of the post views counter.
        *
        * @see https://wordpress.org/support/topic/display-format/
        *
        * @param string $view    Original phrase outputting the number of views.
        * @param array  $views   Number of views.
        * @param string $post_id Post ID.
        *
        * @return string
        */
       function teeragit_custom_post_views_text( $view, $views, $post_id ) {
       	if ( ! empty( $views ) && isset( $views['total'] ) ) {
       		/*
       		 * Here we'll build a string
       		 * with a div container and the number of views inside,
       		 * as an example.
       		 * You can of course create your own string, with whatever html you want.
       		 */
       		return sprintf(
       			'<div class="teeragit_post_counter">%1$s</div>',
       			$views['total']
       		);
       	}
   
       	// Fallback to the original default text.
       	return $view;
       }
       add_filter( 'jp_post_views_output', 'teeragit_custom_post_views_text', 10, 3 );
       ```
   
 * You can of course customize this to display things before or after the number.

Viewing 1 replies (of 1 total)

The topic ‘Display Format’ is closed to new replies.

 * ![](https://ps.w.org/post-views-for-jetpack/assets/icon-256x256.png?rev=1518414)
 * [Post Views for Jetpack](https://wordpress.org/plugins/post-views-for-jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-views-for-jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-views-for-jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/post-views-for-jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-views-for-jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-views-for-jetpack/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/display-format/#post-14862340)
 * Status: resolved