Hello,
Please can you add a feature to display the post views count for this plugin(https://wordpress.org/plugins/post-views-counter/). Some sort of analytics would be helpful in giving content creators feedback on the views of their post.
see example image below
https://ibb.co/f9KxjjRAlso same feature can be added in the post layout feature I suggested at https://buddydev.com/support/forums/topic/buddypress-user-blog-post-manager-layout-suggestion/
Thanks
Hi Tosin,
Thank you.We haven’t checked the plugin but it should work fine for BuddyBlog Pro.
If it is not, Please let me know and we will investigate/add custom support.Regards
BrajeshThe plugin works fine in single post pages as seen here https://imgur.com/a/MMlNhhu
But displaying it in the post management section is the issue (A setting option to enable the display would be awesome when buddyblog detects the installation of the post views counter plugin)
Thank you Tosin.
Please allow me to check and get back to you in next 2 days. For the time being, I/Ravi will be supplying some custom code to achieve it. In future, we will be happy to add support inside the plugin.
Regards
BrajeshHello Tosin,
Try the following code:
add_filter( 'pvc_display_views_count', function( $display ) { if ( ! function_exists( 'buddyblog_pro' ) ) { return $display; } $pvc = Post_Views_Counter(); if ( empty( $pvc->options['display'] ) || empty( $pvc->options['display']['post_types_display'] ) ) { return $display; } $current_post_type = bblpro_get_current_post_type(); if ( ! $display && $current_post_type && in_array( $current_post_type, (array) $pvc->options['display']['post_types_display'] ) ) { $display = true; } return $display; } ); add_filter( 'the_excerpt', function ( $excerpt ) { if ( ! function_exists( 'Post_Views_Counter' ) ) { return $excerpt; } return Post_Views_Counter()->frontend->add_post_views_count( $excerpt ); } );
It will append the view count on the archive page.
Regards
RaviHello Ravi,
I added the code to functions.php file but it does not display the count like this https://ibb.co/f9KxjjR
The count does not display at all in users page.
Thanks
Hello Tosin,
Thank you for your acknowledgement. I have rechecked this on my local development server and it is working fine for me. Please have a look:
https://www.awesomescreenshot.com/image/25345015?key=d592c187c63529f4afc2015e70945eeb
Please try after switching to the default theme temporarily and let me know if it is showing there or not.
Please make sure you have selected the post type under plugin settings > Display > Post Type.
Regards
RaviHello,
The issue came from > Display > Position= Manual. When I changed it to either After Content or Before Content the count displayed.
The problem now I want to use the Manual position because I added the post views code (<?php echo pvc_post_views(); ?>) directly into my theme’s content-single.php file.
Can you make the code to work for manual position
Thanks
The topic ‘ [Resolved] Buddyblog post views counter’ is closed to new replies.