The WP Postviews plugin is one of the most used to record post views.
Then you can sort by amount by;
<?php if (function_exists('get_most_viewed')): ?>
<ul>
<?php get_most_viewed(); ?>
</ul>
<?php endif; ?>
Or pass in the variables to the URL:
http://example.com/?v_sortby=views&v_orderby=desc
Or even run a custom query that sorts by the post_meta value.
Related Posts:
- How to Change Order of Posts in Admin?
- Get current menu_order
- Different post sort order within different categories
- what types of order can I pass to get_posts() via orderby?
- How do I reorder (pop and push) items from WP_Query?
- How to put last edited entry on top of the blog-post list?
- Sort post by attributes ‘order’
- How to sort posts by last name (2nd word) on ONE category only?
- Query posts from current year
- Reverse chronology of post listing
- Order Posts by Alphabetical for Each Letter
- Set number of article per number of page
- Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- Order post by year DESC and month ASC
- Display custom post types by date field
- orderby=meta_value_num creates duplicate posts
- Change Order of Admin Posts Depending on Meta
- Display posts in alphabetical order for a particular category
- post re-order on my site
- Display posts from #6 to #20 on archive page
- Why orderby=”date” does not support manually changed posts?
- WP_Query orderby not working with meta_value_num and menu_order
- How can I sort posts by the date and a custom meta field?
- Sort WP posts by span value
- How to sort posts inside categories
- Any way for get_next_post() to use the actual post order instead of publish order?
- Custom order for Mysql array
- How to order posts by meta_value and title
- Order posts alphabetically: how to set order=asc in mysql query?
- how to get post order by post id wp_query?
- How Do I Get My Post Tags to Alphabetize?
- While loop articles – if statement order
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- Create a list of posts with topic headdings
- How can I add a box to edit Order on a regular post?
- get_previous_post() while accounting for sticky posts
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Posts and order
- Adjust the order for returned posts
- Order posts by date
- query posts with selected post ids first
- How do I display posts ordered by a date custom field?
- WP_Query sort by meta_value_num or date
- Allow reader to reorder posts for themselves (oldest first)
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Get query result according to merged array
- How to make post button to a random post
- Where is object, property or label in the database that controls the order of the posts being displayed?
- Last three posts not being put in order by date. How to fix this?
- Order by ‘s’ using WP_Query()
- Custom Admin Post Column change order
- How to sort posts alphabetically based on a specific parent category
- WP_Query offset argument does not work
- Attach pdf file to custom post type
- Count singular post views automatically
- Looping through posts per category gives same posts for each category
- how to hide specific post from google search
- Accessing $post variable from template part
- Programmatically inserting page breaks
- get_terms parent for current product only
- Link button is not working while editing a post in Firefox [closed]
- How to get future ID for post which haven’t been created yet?
- Limit Gutenberg blocks available to users to choose from
- Display a post by ID attribute with shortcode
- how to get posts ids inside pre_get_posts filter?
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- Custom Posts Query and meta_query Sort Order
- limit to months rather than by number of posts
- Simultaneous admin updates causes custom fields to not update
- is_page Funtion for Posts ?
- Modify posts listing at back end
- How to update all posts at once?
- Random posts that always include a particular post?
- Show number of posts by logged in user
- Insert data from custom created PHP page into wp_postmeta table
- Add Text Domain To Post Navigation
- Internal linking to posts permalink fail because of spaces and stripe at postname
- How to implement a WordPress comments function?
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- Shortcode for Comments and Comment Boxes in Post Loop
- Weird problem occurs while using WordPress REST API to create new post
- Centre Blog Index (Posts Page) on Home.php
- Dropdown Select Post Filter
- Add postmeta to all blog posts
- How to give priority to page than to posts permalink structure?
- Add category information beneath post?
- how to remove entry meta from wordpress archive category and change its display
- Save/retrieve form data best practises for theme development
- How to handle a post before publishing?
- Changing permalink of custom category
- Error establishing a database connection
- How to limit the number of posts a user can publish based on user type
- posts_per_page – Repeats only first posts ‘post__in’ array
- Send post to remote wp site from post edit window with all data excerpt image
- Parameter for pagination posts_pagination
- What is the best way to publish News articles?
- Is it possible to create dynamic templates for block themes directly from the site editor?