popular post weekly and monthly

These $args is what you need and you may also use that in query_posts(); $args = array( ‘post_type’ => array( ‘post’ ), ‘post_status’ => ‘publish’, ‘posts_per_page’ => 9, ‘cat’ => $link1, // try better variable name ‘meta_key’ => ‘post_views_count’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, ‘date_query’ => array( array( ‘after’ => ‘1 months ago’, ), … Read more

How to display popular posts in page?

If I call the popular posts below “the content” it works without any problem. If I call it before it (like in the code above), the actual content of my page won’t show up and instead the last blog post in the list of popular posts will be displayed. If I understand you, that is … Read more

Most commented / popular posts and offset

Here’s your code wrapped up in a plugin. The important thing is that it prepare()s the input, so the query is safe. You can define 2 arguments: Offset & Limit. Those are basically just the SQL LIMIT. If you don’t have any use for the plugin, just deactivate it, as it won’t do anything – … Read more

How to get popular post from across a network?

simple list all last post about the network, not the popular posts; for popular posts you must use an plugin or track via Google Analytics etc. <ul class=”postlist no-mp”> <?php $blogs = $wpdb->get_results( “SELECT blog_id,path FROM {$wpdb->blogs} WHERE blog_id != {$wpdb->blogid} AND site_id = ‘{$wpdb->siteid}’ AND spam = ‘0’ AND deleted = ‘0’ AND archived … Read more

How to display most viewed post in my sidebar?

As per @userabuser comment: <?php /* Plugin Name: Simple Post Views Plugin URI: http://en.bainternet.info Description: Simple And lightweight plugin to track post views. Version: 0.1 Author: Bainternet Author URI: http://en.bainternet.info */ if ( !class_exists(‘PostViews’)){ class PostViews{ static $meta_key = “_post_views_count” //class constractor public function __construct(){ //auto count view on the_content function. add_filter(‘the_content’,array($this,’setPostViews’)); //add shortcodes add_shortcode(“TOP_VIEWED”,array($this,’top_viewed’)); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)