How to refine WP-Query with further criteria
Have you tried using meta_query? More details at http://codex.wordpress.org/Class_Reference/WP_Query.
Have you tried using meta_query? More details at http://codex.wordpress.org/Class_Reference/WP_Query.
I’m pretty sure you can use get_pages (http://codex.wordpress.org/Function_Reference/get_pages) function to solve this. It has child_of parameter which does exactly what you wanted. The only problem is that it returns posts and not set $wp_query, so you can’t use it as loop, but you can always call setup_postdata and then use template tags as in normal … Read more
Can this help you? — http://wordpress.org/support/topic/query-post-to-show-one-post-per-author ps. I should add this as a comment, but I can’t, sorry.
See the offset argument: …&offset=5… And avoid using global variables, and query_posts. Use the pre_get_posts action instead.
Never tested this ,but i believe you need to add WHERE clause to your query with time difference like so : $timediff .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-2 days’)) . “‘”; you can find it also in the codex http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters If you do not want to use on query, but inside the … Read more
here’s what I ended up doing: <?php query_posts(array( ‘category__not_in’ => array($headline), ‘post__not_in’ => $postnotin, ‘paged’ => $paged, ‘posts_per_page’ => 5 )); if ( have_posts() ): $postCount = 0; ?> <?php while ( have_posts() ) : the_post(); $postCount++; if ($postCount < 6) { ?> [all my code] <?php } #end if ?> <?php endwhile;?>
there are two WordPress functions you could try: http://codex.wordpress.org/Function_Reference/get_page_by_title (as suggested by @t31os in the comments to your quoted link) http://codex.wordpress.org/Function_Reference/get_page_by_path if you have already tried them, please describe how these failed to do what you want.
I think I got it. You’re querying for sticky posts. Attachments can’t be sticky at least by default. Hence, you’re see the normal loop order when sticky posts are involved. So if you add this to your second args array: ‘ignore_sticky_posts’ => true I think your problem should be resolved. Here’s the relevant codex section … Read more
You could convert the string to an array using the php explode function. So if you used a comma as your delimiter, you could pass the string ‘153,154,87’ and that would and then use the explode function to convert it to array( [0]=>’153′ [1]=>’154′ [2]=>’87’ ) If you want to keep the p= you could … Read more
Perhaps something wrong with your incoming variable? try without $variable. simply with already setted value and check results. ‘value’ => array(100,10000)