Having taken a quick look at the wp-postviews documentation, it seems you can change query_posts( 'posts_per_page=5' );
to query_posts( 'posts_per_page=5&v_sortby=views&v_orderby=desc' );
, but I haven’t tested that. Give it a shot and see how it turns out.
A cautionary note on doing this: What often happens when you sort by views is that the first page will NEVER change. Transient traffic will look at the first couple, boosting their numbers, but not click through. I suggest that you make other sort options available to your users, should they want them.
Related Posts:
- Jquery Slider for profile template
- if ( is_home() && ! is_front_page() )
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- Is including the loop necessary for page.php? [duplicate]
- What is best way passing variables to theme templates and using them different places like widgets?
- Page template not displaying
- How to add “time” data this?
- Loop through pages with specific template
- How to get_template_part using AJAX?
- wp alchemy multiple image uploader output images to template
- code suddenly appearing from my tempate second loop
- Get search.php results in header.php?
- WordPress Loop inside Loop?
- Template structure
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Order archive results by post id in custom taxonomy template
- Default ‘post’ post type archive slug?
- How do I make a variable available inside partials?
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- Count post views in loop
- Second Loop Showing Only One Post on Single Post Page
- How do I put my frontpage featured image in a page template for home.php?
- Get markup for post without loading into the template
- How to render the single post template with the post name?
- excerpt not showing up
- new custom theme – posts displaying on top of one another
- How do i create a list-posts-page?
- How to loop specific Category menu from archive page?
- How do I set the Stewart Search Template to return only published posts in the result
- Is it possible to set archive.php instead of index.php to display blog?
- Using is_page_template inside loop
- is it bad to copy the loop for a template?
- Is “the loop” a template tag?
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress with woocommerce custom query
- Alternative layout the loop
- Cant pull in featured Image
- Template included with plugin doesn’t return all posts for custom taxonomy
- Creating a archive for taxonomy terms, not the term results
- Secondary loop cuts off at 10 posts?
- Need a conditional to test if title of parent page matches title of child page
- get all page templates
- Load featured article once in a loop
- wordpress showing all posts instead of date range
- How to implement template file and the loop
- Same posts within a paginated page
- How can I create an entirely new, separate display of posts?
- Counting the posts of a custom WordPress loop (WP_Query)?
- Is there any difference between the_title() and echo get_the_title()?
- Pagination not working on home page
- Get ID of a page containing secondary loop in content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Exclude category by slug for for each loop
- WordPress Loop Through Particular Pages
- Display date only once for a each set of posts relating to that date
- The main Loop is not starting in a custom blog template page
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- Breaking the loop?
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- woocommerce stored variable
- Recent posts on a static home page
- Do I need to use The Loop on pages?
- Is wp_reset_postdata() redundant after the main loop?
- Exclude first post (sticky or not) from the loop using query_posts()
- How to add a specific div element to the first post in a row?
- While loop with bootstrap [closed]
- Need to add class to first element in a foreach loop
- Scrolling Posts with Ajax
- Sort posts by first letter in the title, not by first number
- how to replace get_template_part(‘loop’,’tag’) with explicit styled version?
- What PHP Needed to Make One Loop with Multiple Styling?
- Simple foreach loop help needed in wordpress “the loop”
- Grabbed Post ID under WP loop, but still couldn’t Print Post title
- How to separate posts loop in to two columns? [duplicate]
- Blank content php code not parsing advanced custom fields gallery add-on [closed]
- Three Column Loop
- Split loop into columns
- get_posts() forcing ignore sticky posts on main loop
- make diffrent template on last six post published
- Using jQuery .after inside loop
- problem with the loop
- Custom Header added within Dashboard pages, is this possible with custom template files?
- Loop order issue with Ajax filter
- Adding a second loop breaks everything
- Custom Query with Sticky Posts
- I want to load post in bootstrap Modal dynamically
- Return only one post format in index.php [duplicate]
- How to execute custom loop before loop content?
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- This webpage has a redirect loop issue with SSL page
- Buddypress Group Activity Loop Filter activity type [closed]
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- $do_not_duplicate is not working in genesis theme
- Loop displays current page
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?