Bring Your Business to Life › Support › WordPress: Popular Widget Plugin 100K downloads
Forum Replies Created
- AuthorPosts
- sangParticipant
Ignore my last post! The plugin is working fine…it’s not a problem with the query. I’m using a “in the last days” setting of 30 days and all of my posts were backdated to a date over 30 days ago. Once I changed the X days to 90 days it worked fine.
I was under the impression that the widget queried for views in the last X days, but it’s just reading a running count # for posts that have a publish date within the timeframe.
Thanks again for the plugin!!!
SangsangParticipantHax —
I think the problem with Most Viewed posts not display is caused by a bad SQL query in the included.php file:
In the query around line #182 it says: “AND post_date >= ‘$time'”. If you echo $time to the screen, you’ll see that $time is being returned as the current time on the server, thus there are no search results that match the query. The result set will always be 0.
I believe you need to calculate the a different $time variable based on the “In the last days X days” setting from the widget and update the SQL query.
I hope this helps. I love the widget otherwise and hope that you can keep it going.
Cheers,
Sang - AuthorPosts