WordPress.org

Ready to get started?Download WordPress

Forums

Post Views Count
[resolved] Feature request: counting page views but exclude pages from the widget (6 posts)

  1. WPwebbouw
    Member
    Posted 1 year ago #

    I would like to have the possibility to let the plugin count views on pages, without them appearing in the widget. I see the most viewed posts list as a marketing tool to inspire visiters to read those posts. In the back end the counter serves as a simple monitor for the views of posts and pages. So I don't have to check my Google Analytics to get a quick However, I don't want pages to display in the widget.

    I think a simple checkbox "show pages in widget" on the settings page would suffice.

    http://wordpress.org/extend/plugins/baw-post-views-count/

  2. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Hello
    haaa you made me laught ^^
    1 week ago the widget only worked for "posts", i forgot to add the posts types settings.
    Now it includes all post types from settings and you want to, keep tracking of page count but not show it in widget XD
    I will add a filter hook for that ok ? This is too special, so for you, i'll do this filter ;)
    See you

  3. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Added in 2.19.10, the filter name is "baw_count_views_widget_post_types".
    So you can add this in your functions.php from theme:

    add_filter( 'baw_count_views_widget_post_types', 'special_post_types_for_bawmrp_widget' );
    function special_post_types_for_bawmrp_widget( $post_types )
    {
      return array( 'posts' );
    }
  4. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    My bad:

    add_filter( 'baw_count_views_widget_post_types', 'special_post_types_for_bawmrp_widget' );
    function special_post_types_for_bawmrp_widget( $post_types )
    {
      return array( 'post' );
    }
  5. WPwebbouw
    Member
    Posted 1 year ago #

    Thank you!

  6. Shunarjuna
    Member
    Posted 1 year ago #

    Thanks for this, it is just what I needed too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic