Articles of popular posts

Query posts by views on category page

I’m having trouble trying to create a second query on the category.php pages, what I’m trying to achieve is displaying the most popular posts from the current category archive page being viewed. This is what I have so far. <?php // The Query global $wp_query; $term = $wp_query->queried_object; $args=array( ‘meta_key’ => ‘views’, ‘orderby’ => ‘meta_value_num’, […]

How to show Best Selling WP E-Commerce Products

I’m trying (but failing) to create ‘Best Sellers’ and ‘New Releases’ pages for my website. I’m using WP-Ecommerce 3.8.4 with WP 3.1.3 and I’ve gotten close but can’t seem to get it right. Any help on this would be greatly appreciated… I’ve added the following code to wp-ecommerce>wpsc-includes>product-template.php (original code from here): //Popular products function […]

wp query for popular post with simple field

I used simple-fields plugin for one addition field(premium posts) and now I need to change the popular post widget. I need to get all popular post exclude premium post. What I have tried so far, original query, $popularposts = new WP_Query(‘showposts=5&meta_key=post_views_count&orderby=meta_value_num&order=DESC&ignore_sticky_posts=1’) edited query, $args1 = array( ‘showposts’ => 5, ‘ignore_sticky_posts’ => 1, ‘meta_query’ => array( […]

WordPress popular posts by week code

I m trying make a code that list the popular posts by week. Until now i was able to creat a veiws counter and display the 4 popular posts. So what i still need is to make this query more accurate. I would like get the thumbnails and links and get the most popular of […]

Can't get post thumbnail to display in foreach loop

I’ve been trying to get the post thumbnail to display in the foreach loop for a few hours now and I can’t figure out how to make it work, any help would be greatly appreciated! <div id=”home-posts” class=”col-sm-3″ role=”complementary”> <div class=”recent-post-sidebar”> <h3>Popular Posts</h3> <?php $popular_post_object = new WDS_JetPack_Popular_Posts( array( ‘count’ => 5, ‘days’ => 200, […]

Display most popular posts of category

Right now in my slider I’m showing most popular post by views. However, I want to shop most popular post by views only for a certain category? The category id I want to use is “10”. How would I achieve this? Thanks in advance. <div id=”slider-food”> <?php $carousel_cat = get_theme_mod(‘carousel_setting’,’1′); $carousel_count = get_theme_mod(‘count_setting’,’4′); $month = […]

Popular posts by view with Jetpack

I’m using Jetpack to retrieve the number of views for each blog post. Is there a way to use this to generate a call to the most viewed posts and list them? I’ve been wanting to do that for a long time now and I’ve looked into various plugins, but I’d prefer to hardcode this. […]

Show most popular post of last 12 months

I use the Ribbon theme that has a nice tabbed widget showing the most popular and most recent posts. I would like to limit the most popular posts to the last 12 months. I would rather not use a plugin for that but change the code in the theme file. The query is like so: […]

Display most popular in the past two days

Hi I’m using this code below to display the most popular post on my wordpress site. It works great! I was wondering if there was anyway to show the most popular post of the current day? This in my functions.php function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, […]

How to display most viewed post in my sidebar?

Hey i wanted to display the 5 most popular post by view count in my sidebar, but i don’t want to use a plugin, i want the php function so that i can edit it manually such as adding thumbnails next to the title, any idea where i can find this code