Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:04:22+00:00 2026-06-18T11:04:22+00:00

The woo tabs widget display the popular posts based on comment counts rather than

  • 0

The woo tabs widget display the popular posts based on comment counts rather than page views. The code from the widget than enables this is

$popular = get_posts( array( ‘suppress_filters’ => false, ‘ignore_sticky_posts’ => 1, ‘orderby’ => ‘comment_count’, ‘numberposts’ => $posts ) );
foreach($popular as $post) :
setup_postdata($post);
?>

Can anyone help me modify thsi so that it works with page views rather than comment counts???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:04:29+00:00Added an answer on June 18, 2026 at 11:04 am

    I had the same issue and after a bit of research came up with the following:

    I added this snippet to my functions.php file:

    Track post views without a plugin using post meta

    Then from step 2 of that link I pasted this code snippet above the widget code:

    <?php setPostViews(get_the_ID()); ?>
    

    And finally changed ‘orderby’ => ‘comment_count’ to ‘orderby’ => ‘post_views’ as below:

    $popular = get_posts( array( 'suppress_filters' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'post_views', 'numberposts' => $posts ) );
        foreach($popular as $post) : setup_postdata($post);
    

    Hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I got my ActiveMQ to receive messages from another location woo hoo -
I have code: api_result = '{response:[{uid:1969258,first_name:Walle,last_name:Woo}]}'; var myobj:Object = JSON.decode(api_result); So, how I can
I am getting the latest posts of all categories using the code below. I
Woo, I have a doozy of a problem (might even be one for the
For example (in my case) here's some code, <?php woo_post_inside_before(); if ( $woo_options['woo_post_content'] !=
I am using Woo-commerce for online shopping. I create some variable products, but when
http://ableworkforcetraining.com/ I have a Wordpress 3.5 with the Woo Themes: White Light It appears
I'm trying to connect to a SQL server from VB. The SQL server is
I have a tag like this <order>foo,bar,goo,doo,woo</order> that I need to validate with an
I am using which code which returns taxonomies which match 2 values. Everything works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.