Randomly pick one testimonial post

Assuming – you saved the post in the “quote” type – you actually set and save a “who” meta for those post – you forgot to paste the close section of the loop, as s_ha_dum stated, your code should work. Like this <div id=”introBottom” class=”group”> <?php $quote_args = array( ‘post_type’ => ‘post’, ‘category’ => ‘quote’, … Read more

WordPress | WP_Query does not return anything with s=a

It’s okay here. My request: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%a%’) OR (wp_posts.post_content LIKE ‘%a%’))) AND (wp_posts.post_password = ”) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status=”publish”) ORDER BY wp_posts.post_date DESC LIMIT 0, 10 I tried changing the a to other strings and it worked the same – the query … Read more

wp Query Posts to display in Nivo Slider

Take a look at your code now that I have formatted it. You are opening <div class=”slide-caption”> inside the Loop but are not closing it until after the Loop, and you are missing two closing </div> tags altogether (though that may be a copy/paste error). That means the markup is going to be badly broken, … Read more

Advise on Templates for Custom Queries

I don’t really see anything wrong with what you’re doing; globalizing $post and using setup_postdata() are very standard, well-established techniques for dealing with posts that don’t come straight out of the standard loop; they’re not usually considered hacks.

Limit number of posts in WP_query per month

WP_Query is not going to be able to perform a query of the complexity required to do this in one shot. What it would take to pick 10 from one month, ten form another, then 5 from another, then 3, then 1 like that is a number of UNIONs and WP_Query can’t do that. You … Read more

WP_Query loop doen’t work with my custom taxonomy

Your taxonomy and term arguments are incorrect. The preferred method is via tax_query $args = array( // … other args ‘tax_query’ => array( array( ‘taxonomy’ => $term->taxonomy, ‘field’ => ‘slug’, ‘terms’ => $term->name ) ) ); Please see WP_Query for all valid arguments and their correct formatting.

Phpmyadmin – post editing

Mysql allows you to run queries that apply to all post, see example : UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, ‘<a href=”http://mysite.com/my_link”>mylink</a>’, ”); This code allows you to delete <a href=”http://mysite.com/my_link”>mylink</a>on all posts. But in your case I doubt all links are the same so you need a pattern. Perhaps it can be done with … Read more

Remove from array in WP_Query loop

This is happening because you are re-initializing the phrases array on each iteration. Define that array outside the loop and this code will work. <?php $frontAgrs = array( ‘post_type’ => ‘page’, ‘tag’ => ‘word’, ‘order’ => ‘ASC’ ); $frontLoop = new WP_Query($frontAgrs); /*—-Phrase————-*/ $phrases = array(‘Hello Sailor’,’Acid Test’,’Bear Garden’,’Botch A Job’,’Dark Horse’, ‘In The Red’,’Man … Read more