"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to Wordpress which allows users to query the posts database using a number of criteria. 2) $wp_query is the default object that holds the main query object on each WordPress page.

learn more… | top users | synonyms

3
votes
1answer
133 views

BP Multi Network & Members Directory

With bp-multi-network it appears members are shared across all networks. Example - networks based on location. newyork.mydomain.com, losangeles.mydomain.com, vancouver.mydomain.com At present a ...
1
vote
1answer
347 views

Why does querying on post_tags (which has been applied to custom post types) only return posts?

So I've created a little jquery cycle based feature rotator that pulls from the post_tags. I added the post tags to my other custom post types like this: register_taxonomy_for_object_type('post_tag', ...
0
votes
1answer
338 views

Replacing global wp_query

I have a site that uses a custom query to search for posts by country. The search results come back fine, but the pagination at the bottom reflects the total number of posts in the site, instead of ...
0
votes
1answer
552 views

paginate_links() with Custom Taxonomy

I have a custom taxonomy that is pulling in a list of posts assosciated with it. Previously - in the $posts_args array, I set the post_per_page option to -1 but realized pagination should be added to ...
1
vote
0answers
1k views

Filter wordpress post categories with jquery/ajax and pagination?

Currently I have a website working with Wordpress and Jquery Quicksand (http://razorjack.net/quicksand/). However I don't want to show all posts at the same time. I wish to show e.g. 6 posts and then ...
-1
votes
1answer
364 views

How to query posts from single post format on Genesis framework

How to query posts from single post format on Genesis framework? I want to just show posts from gallery post format only. I tried this query: <?php $recent = new WP_Query( ...
0
votes
1answer
549 views

Adding custom field and querying from post table

I've been trying to figure this out for a while now. So I'm trying to add a custom field call "counter" to every single post. I try simply inserting the field "counter" to the post table. Every time a ...
-2
votes
2answers
2k views

WP_Query only ONE post, won't work

No matter what, I CANNOT figure out why WP_Query pulls in all posts, and completely ignores posts_per_page ... I only want to show one post. <?php $args = array( 'post_type' => 'post', ...
1
vote
0answers
340 views

How to order posts by meta_value and title

How do you order products in WooCommerce so that products are random, but at the same time featured products show first? Here is my code: $args = array( 'post_type' => 'product', ...
0
votes
2answers
1k views

How to run WP_Query to retrieve attachments to posts only from a particular category?

I have a WP blog with a few pages and posts and several categories. I want to write a loop to retrieve images attached to the posts (not the pages) and only those from a specific category and it's ...
0
votes
1answer
330 views

Show multiple tax_query from 2 or more post_type in a single code

i've been trying with no success to show 2 custom taxonomies from 2 post_type, here's my code: <?php /** * Display a list of the most recent news in 'Avisos' ...
0
votes
1answer
64 views

Checking url from plugin

I'm trying to change the login url from wp-login.php to simply 'login'. I'd been looking through another plugins source to find ways of doing it. Some of the applicable parts that I've got so far: ...
2
votes
2answers
1k views

WP_Query in functions.php

I've got some code that I want to turn into a function. It works great until I wrap it in said function: $args = array( 'posts_per_page' => -1, 'post_type' => ...
0
votes
2answers
238 views

WP Query Returning All Posts

I have a custom WP query that is returning every post, instead of just the ones being specified by the query. I can't seem to find anything wrong with the code, so I must be missing something: ...
4
votes
1answer
805 views

next_posts_link not working for loop called with ajax

On my homepage I display a loop of posts that I allow to be replaced by ajax search results and other custom loops. Those results are returned in a template with a custom wp_query. The issue is ...
0
votes
2answers
720 views

Display featured posts for a custom post type by taxonomy

Ok, the quick explanation: I'm using a custom post type, 'lakes'. And, using custom taxonomies to organize them. They are: state, watertype and county. I've created a 'page' for each state that ...
0
votes
1answer
42 views

WordPress Query Returning Every Post

I have a custom WP query that searches a single custom field, using an array. The custom field is for the country of origin of a post. The array I'm using are the names of the various countries in a ...
0
votes
3answers
85 views

Creating Custom Query

I've hit some sort of stumbling bock here, and I can't find my way over it. I'm trying to craft a custom WP query that searches for posts by country of origin, selecting multiple countries at once. ...
0
votes
2answers
218 views

Parsing External Table Arguments

I have a client project that has posts assigned to their country of origin. The client wants to be able to search the posts by continent and or region. I have a separate table that assigns each ...
0
votes
1answer
174 views

Having trouble using this post category query on multiple pages?

I have three pages on my site (Listen, Read, Watch) which each query a different post category: "listen", "read", and "watch" respectively. I created three separate php files with their own unique ...
0
votes
1answer
203 views

Pagination broke after updateto Wordpress 3.4 [duplicate]

Possible Duplicate: Custom Post Type Pagination Doesn't Work in Wordpress 3.4 I updated to wordpress 3.4 and after so my pagination broke showing not found on page/2 etc. I am using ...
0
votes
1answer
303 views

wp list pages using meta box value

I am using the following meta boxes on services page but how would I get the page(s) which have value of this meta box? For example, list all pages where service_type = 'web' I am using the ...
1
vote
1answer
385 views

Sorting multiple custom post types without a meta key/value pair by sort order

At this current moment. is it possible to sort multiple custom post/page types without a meta key/value? I'm looking to just sort the posts by page attribute order: What have i done so far? I've ...
0
votes
2answers
1k views

Orderby menu_order doesn't work

My code is: $sliders = new WP_Query(array('post_type' => 'sliders', 'showposts' => '10', 'orderby' => 'menu_order', 'order' => 'ASC', 'countries'=> 'Default', 'supress_filters' => ...
1
vote
2answers
269 views

Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request

This is my first attempt at modifying the main query using the pre_get_posts action/filter This is the function currently hooked to it: function advanced_product_search_filter($query) { ...
0
votes
1answer
2k views

Add AJAX “Load more” on custom query block

I have a index,php with various new WP_Query all working ok, but in this block I need to implement that "AJAX thing people love - the load more posts": <h2>Latests articles <?php ...
0
votes
1answer
709 views

Custom query, works, but I get a “Notice: Undefined offset: 0…”

My custom query works, but in debugging mode I get this error: Notice: Undefined offset: 0 in /storage/content/24/150624/mydomain.com/public_html/wp/mysite/wp-includes/query.php on line 2232 This ...
0
votes
1answer
221 views

Query Posts to fetch Posts with Unique Tag

I am trying to write a query post such that it returns a list fixed list of posts from a category along with any of the one tag associated with it. For eg: <?php $arg = array('cat' => ...
1
vote
1answer
146 views

recent posts for different categories

I'm developing a theme that will have two recent posts section on the home page- one section for recent portfolio updates and the other for recent blog posts. I'm struggling with implementing these ...
0
votes
1answer
1k views

Conditional arguments for WP_Query and tax_query depending on if $somevar has a value

I've created a new query for a custom post type of 'courses'. Those results are then to be filtered using tax_query, querying 3 custom taxonomies matching 1 or several term ID's. These are passed from ...
-2
votes
2answers
193 views

Query page: preserve page formating

dose anyone know how to get this query (or a different query) to preserve the page formatting? Thanks <?php $my_postid = 663;//This is page id or post id $content_post = get_post($my_postid); ...
1
vote
1answer
459 views

Compare post-IDs within WP_Query? (Less than / Greater than)

Can I use WP_Query to only query posts less than (or greater than) a given post ID? $filtered_query_args = array( 'post_type' => 'projects', 'order' => $prev_next=='next' ? 'DESC' : ...
0
votes
2answers
173 views

Custom Query Fields - Altering Meta Value

I'm giving Custom Query Fields a shot for filtering/sorting posts on the front-end of a site. The instructions seem pretty self-explanatory, but I do have another layer that I'm trying to figure out. ...
0
votes
2answers
413 views

How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?

I am using the Starker Theme as a foundation to build my custom WordPress theme. The Starker Theme comes with a loop.php file for setting up the main loop. I decided to use the loop.php file to ...
0
votes
1answer
207 views

How to display the 5 latest post titles but allow only 1 in there of a specific category

The question probably needs some clarification so here I go: I'm building a carousel displaying the titles of the 5 latest articles. However, from a specific category (called schaft in my case) it ...
0
votes
2answers
2k views

Can i merge 2 new WP_Query($variable) 's?

I am running a multisite network and i have setup a sql query that uses swith_to_blog(); and queries the posts. Is there a way that i can declare the query inside a new WP_Query and actually merge ...
0
votes
1answer
116 views

Exclude All Posts Which Do Not Have A Tag Assigned

Basically I have regular Category Listings that include posts WITH tags and posts WITHOUT tags. I need to modify the loop so that it ONLY includes posts which have one or more tags assigned to them. ...
0
votes
2answers
288 views

Disable (or limit) queries when certain content (or data) is not needed (or showed)

Currently I am making a custom design for a site. The problem I'm seeing in Wordpress is about almost all data pulled out from the database. While in certain pages - like front-page.php - it only ...
2
votes
2answers
460 views

How to order posts tag by tag?

I want to order my posts by tags with only one WP_Query() In my WP_Query I would like to display 2 posts with tags portrait 2 posts with tags paysage 2 posts with tags portrait 2 posts with tags ...
0
votes
1answer
928 views

Issue with front page navigation after upgrading to 3.4

I upgraded to WordPress 3.4 and am having an issues with showing a different amount of post on the first page versus the rest. The first page is still showing 5 posts but when I go to /page/2/ I'm ...
0
votes
1answer
435 views

Determining Author post count

This is more of an efficiency question as the following code does do what I want. $user_name = get_the_authour; $query = new WP_Query('author_name=JustinH'); $author_post_count = ...
0
votes
1answer
66 views

Change content off every sixth element

I would like to create custom post query where i will list all my posts in the list. Then the tricky bit is to add different content to sixth element off that list. So something like this ...
0
votes
1answer
160 views

get_var is neither a string, integer, or array …?

$vote_count = $wpdb->get_var($wpdb->prepare("SELECT votes FROM wp_mytable WHERE product = %s AND company = %s", $product, $company)); ...
3
votes
2answers
168 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) ...
0
votes
1answer
202 views

Taxonomy order exception for specific term

I want to make an exception for my custom taxonomy order. Sometimes you need to put "Other" option as last option but when calling taxonomies with "orderby=name", sadly "Other" term is not listing as ...
2
votes
4answers
85 views

Get list of WP Updates Across Sites

Is there a way to query a WP site to see the number of updates currently available? I'm not really looking for a list of the actual updates, just the number. This would be the total number of ...
0
votes
1answer
844 views

How to make WP_Query not to show irrelevant posts?

I'm using the following WP_Query arguments array: $args = array( 'post_type' => POST_TYPE, 'tax_query' => array( 'taxonomy' => ...
0
votes
1answer
1k views

Posts limit on homepage (genesis framework)

in home.php // NOT working query_posts('show_posts=3'); // NOT working add_action( 'pre_get_posts', 'set_posts_per_page' ); function set_posts_per_page( $query ) { $query->set( ...
1
vote
2answers
2k views

How do I use wp_query for WordPress search?

I would like to create a custom search form to search posts based on the values of about 4 custom fields. I tried using wp_query to achieve this but so far my biggest problem is that the I don't get ...
0
votes
3answers
2k views

Query with pre_get_posts to get pagination

After pretty much getting everything working with query_posts, I noticed my pagination wasn't running. I was told pre_get_posts should be the solution. My problems: I don't know how to pass all my ...