Skip to content

zerobyt/Most-View-Post-Wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Most-View-Post-Wordpress

GET THE COUNT VIEWS IN POST
USE IN THE WP LOOP: get_post_view_count($post->ID);

USE IN WP QUERY:
    $args = array(
    'numberposts' => 4,
    'orderby' => 'meta_value',
    'meta_key' => 'post_views_count',
    'order' => 'DESC',
    'post_type' => 'post',
    'post_status' => 'publish'
    );

ADD A VIEW TO THE COUNT
    set_post_view($post->ID);

About

Get & Set the most view post in Wordpress

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages