Not in core. You can use post meta to store this information on page loads. If you have caching plugins enabled, you might want to increment the hit counter with an AJAX call, otherwise you can just add this directly in your single.php and page.php templates:
//Add to functions.php
function get_hits(){
global $post;
$hits = get_post_meta($post->ID, '_hit-counter', true);
return $hits;
}
function update_hits($count){
global $post;
$count = $count ? $count : 0;
$hits = update_post_meta($post->ID, '_hit-counter', $count++);
return $hits;
}
//Usage within the loop
update_hits(get_hits());
Related Posts:
- How can I delete orphan keys in WordPress database tables?
- How to safely sanitize a textarea which takes full HTML input
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- How to not allow users to create new tags, but allow to them to use existing ones
- Why activate_plugin is not working in register_activation_hook
- Archive list with only years and months
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- How do I fix the “sorry, you are not allowed to access this page” error I get on the “plugins > settings” links?
- Display (and manage) webcam images?
- Overwrite textdomain of plugins by default – Lost Translation
- jQuery plugin only in one page/post
- Google Analytics post views in WordPress? [closed]
- scheduled event not getting executed
- How can I limit functionality in one version of a plugin?
- Any way to use a custom Parameter for youtube embed without using an iframe?
- Hook (upgrader_process_complete) running moment
- How do I add a template to a theme using a plugin?
- Can’t see login page after migration
- How to import 55k images (uploaded via FTP) into WordPress Media libary? [closed]
- Debugging Technique Question re: functions.php
- Custom Taxonomy Tag Search
- Advanced Custom Fields
- Retrieving plugin options value saved through setting
- An issue with SEO Ultimate
- How do I modify the position of a plugin?
- Add a custom form on the post-new.php admin page
- how to give a user a role?
- looking for navigation plugin (accordion) [closed]
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Trouble with editing template for “List category posts” plugin
- Upgraded to latest version – 3.0.3 and Now I get a “sufficient permissions to access this page” error
- How to show WP addon installation path during installation?
- Replace default og:image tag YOAST
- Automatic plugin updates not working
- Fromcraft Plugin On click submit button [closed]
- A include_template Question
- Notify comment author upon reply
- WordPress get_avatar function not correct working
- Should I not update the plugin?
- Improving the perfomance of a plugin action
- How do I create a Client Logos section in admin menu?
- Support information in backend
- Can I use Symfony components in a plugin that I want to submit to the WordPress plugin repository?
- UpdraftPlus installed malware – scared to download or update plugins now! [closed]
- Is there any plugin which enables users to rate comments in thumbs up-down way?
- Plugin Repostitory Questions
- How to update a local development plugin on a separate machine
- How do I convert my WordPress website to be domain agnostic?
- Get Image Having the ID [closed]
- WP::is_main_query() Not Working
- Show media-uploads to all users
- post_content is empty
- Widget where it can make changes to the container
- I want to reset user’s post meta after successfully login
- Widget Screen Locked
- W3 Total Cache plugin chronic message
- How to prevent plugin, theme installation failures on WordPress?
- How to make a slider hearder?
- Warning: Attempt to read property “ID” on null in C:\xampp\htdocs\Nnamdi1\wp-content\plugins\elementor\core\base\document.php on line 250 [closed]
- Adding CASE in WP_Query
- why I cannot activate elementor plug in?
- How to find the following specific WordPress variables?
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- Get all image in media Gallery with alt/title?
- WP Function does not trigger on Webhook API Call
- How to add specific script to WordPress webpage that will working with user input and databases
- Displaying different content depending on variable
- After reading 3 story by user ask for subscription popup
- Pay Employee via WordPress
- Edit plugin’s HTML output with Hooks
- How to echo a PHP Code After the Content
- How to find out programmatically whether any cache plugin is installed in the WordPress website?
- Show custom taxonomy in theme
- errno: 150 “Foreign key constraint is incorrectly formed” [closed]
- Implementation to count page visits of unique visitors based on a cookie
- Create Biographies
- How to differently style pages that display posts of different category in WordPress?
- Social sharing plugin directing to blank page after post sharing
- Which One Is Better For Managing Add Ons For Extensible Plugin?
- WP REST API Access-Control-Allow-Origin response is cached
- How to build a navigation menu for long-form texts like this one
- Like/Dislike Bar not working when updating
- Posts are deleted everyday at night
- how to change/remove/hide menu under installed plugins
- Get Core Functionality from Within a (Secondary) Plugin File
- Single dash converted to double dash
- WordPress plugin add_filter returning a link does not work. What is the correct way?
- Screen Options drop-down does not show
- onclick open window [closed]
- How to create separate shop pages in woocommerce for each product category [closed]
- WooCommerce Cart not showing up [closed]
- $wpdb selects wrong database
- Plugin update warning
- Can’t use updated variables in handle function
- Am having issues intergrating this api into my wordpress site, any help please?
- How does one add numbers to an admin menu?
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- _sold_individually value change when add to cart
- Draft standard post by ACF Data picker
- Change WordPress Username maxmimum length