Support » Plugin: Post Views Counter » Icons not showing up on non singular pages

  • Just installed the plugin for the first time today. I had to modify the source to get the icons to show up next to the count on any pages with the_excerpt. When I checked the plugins source it seemed to be commented out in front_end.php line 53. I fixed it by uncommenting line 54 and wrapping them in an if statement.

    add_filter( ‘the_content’, array( $this, ‘add_post_views_count’ ) );
    //add_filter( ‘the_excerpt’, array( $this, ‘add_post_views_count’ ) );

    if ( is_singular() ) {
    add_filter( ‘the_content’, array( $this, ‘add_post_views_count’ ) );
    } else {
    add_filter( ‘the_excerpt’, array( $this, ‘add_post_views_count’ ) );

    Seems to be working for me now, figured I would post this in case it comes up for anyone else or if there is a setting somewhere else I am unaware of. If there is a setting I am missing please let me know, I would prefer to keep the source files untouched if possible.

Viewing 1 replies (of 1 total)
  • I haven’t tested this myself, but maybe check the “Display” tab in the options menu. There you can check on which page types to display the post count.

    I assume it only loads the icon on page types that you select there (to prevent loading it unnecessary on all other pages)

Viewing 1 replies (of 1 total)
  • The topic ‘Icons not showing up on non singular pages’ is closed to new replies.