Custom Content Slider stop duplicate

I fixed it by removing all the items in the item class and adding a little <?php $i=1; while ($i <= 1) { ?> <div class=”col-md-6 nopadding view view-ninth” style=”padding-left:4px; padding-right:4px;”> <?php the_post_thumbnail(‘large’); ?> <div class=”content”> <h2><?php the_title() ;?></h2> <p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . ‘…’; ?></p> <a href=”#” class=”info”>Read More</a> </div> </div> <?php … Read more

Query to get all the posts of more than 2 meta_value having same meta_key?

From the codex http://codex.wordpress.org/Class_Reference/WP_Query: $args = array( ‘post_type’ => ‘my_custom_post_type’, ‘meta_key’ => ‘age’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘age’, ‘value’ => array(3, 4), ‘compare’ => ‘IN’, ) ) ); $query = new WP_Query($args); Look at the meta_query section. you can define the key and then all the possible … Read more

How to Query Updated Post in WordPress

You can use this query from perishablepress.com to get post revisions. <?php $today = current_time(‘mysql’, 1); $number = 5; // number of posts if($recentposts = $wpdb->get_results(“SELECT ID, post_title FROM $wpdb->posts WHERE post_status=”publish” AND post_modified_gmt < ‘$today’ ORDER BY post_modified_gmt DESC LIMIT $number”)): ?> <h2><?php _e(‘Recently Updated’); ?></h2> <ul> <?php foreach($recentposts as $post) { if($post->post_title == … Read more

$wp_query when new WP_Query

You are slightly confusing $wp_query global variable with WP_Query class/objects. $wp_query is an object instance of WP_Query, but not every WP_Query object has anything to do with $wp_query global. Function version of conditionals, such as is_search(), always act on main global query. You shouldn’t use them inside filters, since global state might be one thing … Read more

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