Why is the loop not empty on some 404s?

You may be surprised, but there is nothing strange there. First of all let’s clarify that in WordPress when you visit a frontend URL you trigger a query. Always. That query is just a standard WP_Query, just like the ones run via: $query = new WP_Query( $args ); There is only one difference: the $args … Read more

Multiple WP_Query loops with Pagination

Yes, it can be done. The key is to make the format parameter different for the two queries: <!– Cats –> <div class=”animals”> <? $paged1 = isset( $_GET[‘paged1’] ) ? (int) $_GET[‘paged1’] : 1; $paged2 = isset( $_GET[‘paged2’] ) ? (int) $_GET[‘paged2’] : 1; // Custom Loop with Pagination 1 // http://codex.wordpress.org/Class_Reference/WP_Query#Usage $args1 = array( … Read more

How do I get posts that have a thumbnail in WP_Query?

You should be able to call posts with a featured image with the following code: $thumbs = array( ‘posts_per_page’ => 5, ‘meta_query’ => array(array(‘key’ => ‘_thumbnail_id’)) ); $query = new WP_Query($thumbs); The code checks each post for the custom field _thumbnail_id, which is where the thumbnail image is stored.

Wp_redirect and sending variables

I’m afraid that you can’t do it this way. wp_redirect is a fancy way to send header Location and the second argument of this function is request status, and not custom variable. (404, 301, 302, and so on). You can send some variables as get parameters. So you can do something like this: if ( … Read more

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