• Resolved imax57

    (@imax57)


    Good evening!

    Relatively recently updated with wordpress version 3.7.0 to version 3.7.1, as well as updated theme wpzoom – onplay. After this became not work plugin.

    How to solve the problem?

    – Does not have a caching plugin
    – My theme has <?php wp_head(); ?> and <?php wp_footer(); ?> in your header and footer of your theme.
    – url www. sgt . su

    http://wordpress.org/plugins/wp-postviews/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Lester Chan

    (@gamerz)

    1. Check the individual custom post meta to see if there are 2 “views” field
    2. I would deactivate all plugins except WP-PostViews to see if it works.
    3. Try the default theme

    Thread Starter imax57

    (@imax57)

    1. In a typical post and static page no additional fields.

    static pages:
    http://www.sgt.su/feed-event/
    http://www.sgt.su/doc/

    2. Finished
    3. Finished

    The problem was not solved. Leave at the time of the default theme, plugins are off except wp-postvieschs to diagnose the problem.

    What else must follow the steps to resolve the incident?

    Plugin Author Lester Chan

    (@gamerz)

    I ran out of ideas. You will probably have to give me access to your server and WP to do some debugging. If you are not comfortable with it there is nothing else I can do

    Thread Starter imax57

    (@imax57)

    Sent to the WP login to your gmail.

    Access to the server what is needed? Via FTP?

    Thread Starter imax57

    (@imax57)

    Where there may be a problem in the subject with a wry update fields in table views wp_postmeta? This field is displayed normally, but after the opening post, the counter is reset to 1.

    Plugin Author Lester Chan

    (@gamerz)

    not that I am aware of, I am pretty sure there is something funky going on for your WP installation (themes + plugins) but I can’t pinpoint what is it.

    Thread Starter imax57

    (@imax57)

    Solved the problem by removing the file “/blog/wp-content/themes/onplay/functions/theme/functions.php” the following code:

    function entry_views_update( $post_id = '' ) {
      global $wp_query;
    
      if ( !empty( $post_id ) ) {
    
        $meta_key = apply_filters( 'entry_views_meta_key', 'Views' );
        $old_views = get_post_meta( $post_id, $meta_key, true );
        $new_views = absint( $old_views ) + 1;
        update_post_meta( $post_id, $meta_key, $new_views, $old_views );
      }
    }
    
    function entry_views_get( $attr = '' ) {
      global $post;
    
      $attr = shortcode_atts( array( 'before' => '', 'after' => '', 'post_id' => $post->ID ), $attr );
      $meta_key = apply_filters( 'entry_views_meta_key', 'Views' );
      $views = intval( get_post_meta( $attr['post_id'], $meta_key, true ) );
      return $attr['before'] . number_format_i18n( $views ) . $attr['after'];
    }

    I think this solution is suitable for all new themes from the team wpzoom.

    Plugin Author Lester Chan

    (@gamerz)

    nice. Thanks for sharing, now I know!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Views are not counting on WordPress 3.7.1’ is closed to new replies.