Specific html within wordpress loop

Use rewind_posts() to reset a loop and run it multiple times: <?php $my_query = new WP_Query(‘cat=49&showposts=4&orderby=RAND’); ?> <div id=”carousel”> <?php while ($my_query->have_posts()) : $my_query->the_post(); // output each slide endwhile; ?> </div> <?php $my_query->rewind_posts(); ?> <ul id=”carousel-descriptions”> <?php while ($my_query->have_posts()) : $my_query->the_post(); // output each desc endwhile; ?> </ul> <?php $my_query->rewind_posts(); // etc.

Determining Author post count

This thread on the wordpress codex shows how you can scope your SQL query: $author_post_count = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_author=”” . $$username->ID . “” AND post_type=”post” AND post_status=”publish””);

For what queries is conditional tags informative?

is_category(‘apple’) might give a false response if “banana” AND “apple” has been queried you’re using is_category incorrectly in this context. From Codex: is_category(); // When any Category archive page is being displayed. A category archive page is for a single term, if a query is a for more than one term, it’s not a term … Read more

Use Ajax To filter posts?

I’d go with @Vinicius’ answer with the following changes: Change type: ‘GET’ to type: ‘POST’ Change ajax: 1 to action: ‘filter_posts’ Replace add_action(‘init’, ‘check_ajax’); with: add_action(‘wp_ajax_filter_posts’, ‘check_ajax’); add_action(‘wp_ajax_nopriv_filter_posts’, ‘check_ajax’); Remove: if (!isset($_POST[‘ajax’])) return false;

sort and display posts by custom field (wp-query and the loop))

I believe the meta_query part should be a nested array, so your query should be like this: $query = new WP_Query( ‘post_type’ => ‘post’, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘ENDS’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array ( ‘key’ => ‘ENDS’, ‘value’ => date(‘Y-m-d H:i:s’), // now ‘compare’ => ‘>=’, ‘type’ => … Read more