Support » Plugin: Google Analytics Post Pageviews » Ultra Excellent

  • Thiago Miro

    (@thiagomiro)


    Incredible what it does, I’m satisfied.
    I mage one function to show the views in the edit.php page. Use the following code in your functions.php file. 😀

    // Add it to a column in WP-Admin - (Optional)
    add_filter('manage_posts_columns', 'posts_column_views');
    add_action('manage_posts_custom_column', 'posts_custom_column_views',6,2);
    function posts_column_views($defaults){
        $defaults['post_views'] = __('Views');
        return $defaults;
    }
    function posts_custom_column_views($column_name, $id){
    	if($column_name === 'post_views'){
            echo gapp_get_post_pageviews(get_the_ID());
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ultra Excellent’ is closed to new replies.