Shortcode on index.php
-
Hi Hector. Thank for awesome plugins. I have in use for many year! Thank very much!
I see your snippet for show views in single.php this thread:
https://ww.wp.xz.cn/support/topic/show-wpp_get_views-with-shortcode/I use:
/** * Registers the shortcode [wpp_views_count]. * * @author Hector Cabrera (https://cabrerahector.com) * @return string */ function wpp_views_count_func() { if ( function_exists('wpp_get_views') && is_single() ) { $views_count = wpp_get_views( get_the_ID() ); return ($views_count == 1) ? '1 view' : $views_count . ' views'; } return ''; } add_shortcode( 'wpp_views_count', 'wpp_views_count_func' );I want show count views for index.php whit shortcode. But, this code no show views, except in single.php
How i can do?
Some way for do show coutviews in frontpage?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Shortcode on index.php’ is closed to new replies.