WordPress loop in post admin view
WordPress loop in post admin view
WordPress loop in post admin view
you can use the ‘category__in’ in WP_Query; example: $feed = WP_Query(array(‘category__in’ => array(102), ‘posts_per_page’ => 3, ‘order’ => ‘DESC’));
The problem was due to a secondary loop in the page—before this loop, the page knows it’s a page; but after the loop (and in the footer, where the Admin Bar and my code would be rendered), the page thought it was the last post of the secondary loop. Neither wp_reset_query() nor wp_reset_postdata() worked; I … Read more
you might wanna try wp_reset_query(); at the end of your loops
Have you tried using meta_query? More details at http://codex.wordpress.org/Class_Reference/WP_Query.
First thing is that your query syntax is correct so the problem is either that there are no tshirt posts under the category term id your querying for or the post type was not registered properly to use categories: ‘taxonomies’ => array( ‘category’ ) You can test for this by adding a var_dump() to your … Read more
I came up with a way using two post queries. The first one runs through the loop and adds 1 to a variable called $counttest. Then it echos that value and resets it to 0 to begin the count for the next date. This probably isn’t the most efficient way to do things. If anyone … Read more
I ended up solving this by doing essentially one thing in a couple places. WordPress doesn’t let you specify a particular type for your meta data and stores everything as strings. As such, I added an extra meta data field that I used as the actual timestamp (using strtotime to convert it to a unix … Read more
My issue was with nginx, specifically: location / { index index.php index.html; try_files $uri $uri/ /index.php; } Which I changed try_files $uri $uri/ /index.php; to try_files $uri $uri/ /index.php?$args; as outlined here which also fixed another issue that I was having with URL parameters.
As I said, I was just missing the declaration to use the global $wp_query, so it wasn’t accessing my filters. Here’s what worked incase it helps: global $wp_query; // pull variable from url if (isset($wp_query->query_vars[‘country’])) { $this->user_country = $wp_query->query_vars[‘country’]; } else { $this->user_country = ‘your country’; } if (isset($wp_query->query_vars[‘lat’])) { $this->user_lat = $wp_query->query_vars[‘lat’]; } else … Read more