ID, "ab_postview_views", true); if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) { $current_views = 0; $content .= "Broj čitanja: ".$current_views; } else { $content .= "Broj čitanja: ".$current_views; } return $content; } } function abpost_add_view() { global $post; $current_views = get_post_meta($post->ID, "ab_postview_views", true); if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) { $current_views = 0; } $new_views = $current_views + 1; update_post_meta($post->ID, "ab_postview_views", $new_views); return $new_views; } add_action("wp_head", "abpost_add_view"); add_filter( "the_content", "ab_postview_counter" ); ?>