get_pages not returning any results or error when get_posts works
get_pages not returning any results or error when get_posts works
get_pages not returning any results or error when get_posts works
get_posts() and ‘posts_per_page’ arg
$draft = wp_count_posts()->draft ? : 0; $sheduled = wp_count_posts()->future ? : 0; echo “There are $draft draft posts and $sheduled scheduled posts”; See Codex for wp_count_posts
I think I understand your questions, so here’s how I would achieve what I think you are looking to do. The function is set up so that you can send it any category slug or ID and how many posts you’d like to retrieve from that category. EDIT: I removed the_permalink() because I actually meant … Read more
Try This : <!– Category Archive Start –> <ul class=”catArchive”> <?php $catQuery = $wpdb->get_results(“SELECT * FROM $wpdb->terms AS wterms INNER JOIN $wpdb->term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = ‘category’ AND wtaxonomy.parent = 0 AND wtaxonomy.count > 0″); $catCounter = 0; foreach ($catQuery as $category) { $catCounter++; $catStyle=””; if (is_int($catCounter / … Read more
How To Use get_posts & get_the_post_thumbnail Outside The Loop
‘category_name’ => ‘slides’, that appears to be all that is needed. Not sure if there is a more appropriate way but it is working. The WordPress documentation has to be some of the worst formatted and organised out of any major software documentation. Plenty of information just so hard to navigate.
I think this can ve achieved using hidden fields if the single post form Add a field like this in your form <form> YOUR CODE GOES HERE ——————- <input type=”hidden” name=”mypostid” value=”<?php get_the_id(); ?>” /> </form> And the page where this form is posting the data you can get the data for the field mypostid … Read more
As you are looking at post IDs, you should be using meta_value_num instead of meta_value as your key. This will indicate to WP how to handle the comparison.
Per @Milo’s comment: probably post_status, which defaults to publish – Milo 53 mins ago So I just set ‘post_status’ => ‘wc_completed’ in my args and I’m good.