"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.
0
votes
1answer
33 views
next_posts_link returns same content of 1st page
Pagination seems to work fine... I have 21 posts... and it will go to 3 pages... however... every page shows 10 posts and the same content as the first page....
<?php
$temp = $wp_query;
$wp_query= ...
0
votes
2answers
75 views
Custom search: Search posts but display parent page in results
I'm using Wordpress 3.5.1 with a modified twentytwelve theme.
My main site structure is based on the Smooth Slider plugin (jQuery Cycle).
I have Pages that contain only a shortcode (for example, ...
0
votes
1answer
29 views
Highlight post in sidebar on single page
When you have a menu for say pages, it's easy to highlight your current page, since WP puts a class on it.
But what I have is a sidebar with the 20 latest posts in a loop and a separate main content ...
0
votes
1answer
76 views
wp-query Shortcode in Gravity Forms Notification
I have the following code that runs two wp-query loops upon form submission to display specific posts depending on the users choices in the form (The form fields are radio buttons with values that ...
0
votes
1answer
38 views
Can you order posts from wp_query by two custom meta fields?
I'm working on a site that lists events. Right now this query lists events by date:
$args = array(
'post_type' => 'espresso_event',
'post_status' => ...
0
votes
1answer
38 views
404 on Pages for Custom Post Type & Query_Posts
It took me quite a while to find a good solution for ordering a custom post type by two custom meta keys. When I finally got it working, I found out the pagination no longer works. I've tried dozens ...
0
votes
0answers
26 views
Custom Post Query Combined with Conditional Tags
Is it possible to combine displaying a list of custom post types on a single page depending on conditional tags?
Below is what I have so far, basically if there are 4 posts or less show the posts, if ...
1
vote
1answer
40 views
creating wp query with posts with specific category
Im running a specific wp_query to show the thumbnails in a slider of a specific category.
<?php $the_query = new WP_Query ('showposts=2', 'category_name=Events'); ?>
This doesnt appear to be ...
0
votes
1answer
20 views
Finding a post's slug
I'm using wp_query() to get custom posts from the database. I want to list these out as links to the entries, so I'm thinking I could use the slugs. Sadly these don't seem to be included in the ...
0
votes
1answer
35 views
wp_query in a shortcode
I am trying to put several queries in a shortcode so that I can call them in a page instead of using custom templates. I got my query going but I only see some of the content on the page. The image ...
0
votes
1answer
40 views
How to use WP_Query in a CPT achive page?
I can't get WP_Query to work in my custom-post-type archive page. Can someone please tell me what I'm doing wrong? I would appreciate any help.
Here's the code in archive-bulletin.php:
<?php ...
0
votes
1answer
41 views
Cant' Display Custom Post Type Title Base on Tax Terms
Trying to list all Custom Post Type titles based on filtered Custom Taxonomy Terms I am getting the list of all post titles instead of getting the list of Queried post.
Here is the code I am using:
...
0
votes
1answer
31 views
Problem with is_tax in WP_Query loop
The code below is the 2nd of 4 loops in "page-balls.php". Everything else is working correctly.
I'm trying to display a tennis ball graphic if the post being retrieved has a the term "tennis-ball" ...
5
votes
1answer
165 views
Multiple relationship for multiple tax_query in WP_Query
I want to use the WP_Query class to filter some of my posts. The problem I facing now is handling the taxonomy query. Normally, the wp_query only handle one relationship for tax_query (either AND or ...
0
votes
1answer
47 views
WordPress | WP_Query does not return anything with s=a
I have the following code:
$data = new WP_Query('s=a');
and the print_r returns the following data:
WP_Query Object
(
[query_vars] => Array
(
[s] => a
...
1
vote
2answers
46 views
Next/Prev posts on same page
Hello WordPress Users,
I'm stuck with a problem building my wordpress website and I can't figure out what to do about it.
Currently I'm showing 2 posts form the category 'News' at the page 'News'. ...
0
votes
1answer
39 views
WP Paginate not working properly
Im creating a WP for a custom type post in a page template:
<?
global $paged;
global $notquery;
$temp = $notquery;
$notquery = ...
1
vote
1answer
15 views
Query “Category A” + 1 post from “Category B” - how?
It's pretty easy to query posts from one category but what if I need also one single post from another category?
$query = new WP_Query( 'cat=4' );
I'm looking for something like this:
$query = new ...
0
votes
0answers
39 views
$wp_query empty on my home page
I've got a Multi-user install set up with several sites, each with a few posts. I recently added a new user, made it a super-admin, and then deleted the original super-admin. I transferred all the ...
0
votes
1answer
32 views
WP_Query calls all posts?
I have this code that picks a random testimonial post.
<?php
$quote_args = array(
'post_type' => 'post',
'category' => 'quote',
'orderby' ...
1
vote
1answer
58 views
Gravity Forms field entries into wp_query loop
I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)...
add_action("gform_after_submission_18", "set_post_content", 10, ...
0
votes
0answers
25 views
Display Category Navigation wp-navi
I am writing here because after hours and hours I can't fix my problem.
I am using a Custom Theme
I am using the plugin wp-navi
My pagination works fine.
The problem is to display categories when ...
0
votes
2answers
45 views
How to apply filter inside a single wp_query?
I've got a special query on my homepage that returns posts from a custom taxonomy.
I'm trying to apply this filter for it.
add_filter( 'post_limits', 'my_post_limits' );
function my_post_limits( ...
0
votes
0answers
28 views
Adding New attribute in wordpress
I'm using Wordpress to implement the website:
The pages in my templates should be sliding vertically, so there is a 'Next' button in the end of each page. Now my problem is in the admin section ...
0
votes
0answers
47 views
Posts 2 Posts, losing connection in template parts
I am using the Post 2 Posts plugin to connect different post types. My code works perfectly when it's all in one file (archive.php). The problem I have is taht I want to split out the part that does ...
0
votes
1answer
42 views
What is wrong with this wp_query?
I need to query posts by two meta fields and the wo_query I'm doing it with is returning nothing. Obviously, it's broken. Can somebody tell me what I'm doing wrong?
$args = array(
...
0
votes
3answers
96 views
Get count of custom post type created by current user
I'm trying to get the count of published posts in a custom post type for the current user (to display on a profile page).
I found this here on the forums:
<?php
global $wp_query;
$curauth = ...
0
votes
1answer
37 views
Exclude an array
I'm moving edit post dashboard to front end.
So here is a case, I have to queries, one for product attachments and other for ALL.
Now, I want to exclude product attachments from ALL attachments query
...
0
votes
1answer
15 views
Randomly pick one testimonial post
I want to show one randomly picked testimonial on a page.
Each testimonial is a post with a category of 'quote'.
Each post has a custom field named 'who' with a name.
I'm trying to use this code.
...
0
votes
1answer
34 views
WP_query exclude a category unless it has more then one catagory
I have this category exclude_cat with id 39 I want to exclude it from the home. So I use for WP_Query args like this:
$args = array (
'category__not_in' => array( 39 ), //exclude ID
);
Works. ...
1
vote
0answers
17 views
How to output topics and replies in bbpress as table?
I need to output the bbpress topic and reply loop in a table format. I'm having trouble finding how one might do this Are there any suggestions on how one might do this? Can this be done using ...
0
votes
1answer
56 views
wp_dropdown_pages with tax_query clause
I'm display a dropdown list of custom post types in wordpress. This first block of code uses WP_Query
$houseQuery = new WP_Query(
array(
'post_type' => 'house',
'order' ...
0
votes
1answer
62 views
How to get first post in a category of a custom taxonomy
I'm attempting to make a list of categories bound to a custom taxonomy, but using the featured image of the first post in each category.
Getting the categories was simple enough, but when I try to ...
0
votes
0answers
23 views
is_front_page conditional problem [closed]
Either of these two conditions work by themselves, but when I put them in this if/else statement, I always receive an error:
Parse error: syntax error, unexpected '}' in ...
1
vote
1answer
130 views
WP_Query with ajax handler returns the same posts
I have a problem that is getting me bald atm. I have a ajax call that handles a loop that handles some querys and returns posts for me.
So far so good, but the first time the user sees the page we ...
0
votes
1answer
22 views
Query for first 3 posts to change the look and feel
Is there a way to query for the first three recent posts and then change how they display on the front page?
I want the first three posts of my blog to show differently than the rest of them i.e. ...
0
votes
1answer
115 views
WP_query multiple custom fields not working
I am currently using WP 3.1 and trying to get WP_QUERY to work with the custom fields. My argument is as follows:
$args = array(
'post_type' => 'post',
'meta_query' => array(
'relation' ...
0
votes
2answers
112 views
How to get only ONE category of “Portfolio” posts to display on main page rather than ALL categories?
I have a section on my main page that displays a new “Portfolio” post each time I write one no matter what category I assign them to. What I want to do is make the main page only display one specific ...
0
votes
1answer
54 views
Better wordpress attachment query then this
I have a site with more then 10.000 posts and images, its classipress site. I need somehow to show all images from posts that are on pending status, and who havent expired(post meta). This is the code ...
4
votes
1answer
181 views
Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
I've registered custom rewrite rules and query_vars to use for displaying a list of events based on ISO date format. For example when a user requests the URL, http://site.com/by-date/2013-04-04/, my ...
0
votes
1answer
34 views
Cache issue with WP_Query and custom field filtering
I have three separate WP_Queries on a page. Each of them return custom post type items that have a certain checkbox checked and then display one of those randomly. The checkbox has been added using ...
0
votes
0answers
66 views
wp_query orderby value not from meta_value
I'm using the myreviewplugin to add ratings to posts. I'm now working on the posts loop and customising the query using wp_query.
Everything is working fine, but I need to expand the orderby ...
0
votes
0answers
88 views
Advanced Search Wordpress
I am trying to create an Advanced Search in Wordpress. The advanced search form is made of 3 dependent dropdown boxes (category: type, sub-category: brand, sub-sub-category: model).
It also has 5 ...
0
votes
0answers
62 views
Multiple Wp-Query Loops inside index.php
The site url is: http://aachurch.org/reborn
I'm trying to achieve multiple wp-query loops inside my index.php, showing different categories of posts. The first loop works but nothing shows up for the ...
0
votes
1answer
59 views
Select from wp_post and multiple meta_value from wp_postmeta
My lack of SQL skills has stopped me in my tracks here.
I'm trying to select post_id, post_title and two postmeta values - the first has the meta_key of 'search_country' and the second a meta_key of ...
0
votes
1answer
35 views
Custom loop won't work, can't find problem
I can't figure out why this custom loop isn't displaying for me:. I've tried removing the if statement and removing certain query parameters but it just won't display. If I delete the loop entirely ...
0
votes
0answers
39 views
Scheduled Post Meta Update in Wordpress
I have a system that sums up values from various sources and pass those to post_meta in order to query posts in accordance with the order of meta_value_num.
I was successful at passing those value to ...
0
votes
0answers
77 views
custom Wp_Query / permalink + wp_pagenavi = not working
Testing it in my WAMP environment (with default permalinks), next/previous/page number(s) (links) pulls up the appropriate information - pushing it to live with a custom permalink structure results in ...
1
vote
2answers
67 views
Query for posts in 2 taxonomies
I am currently using the following code to display a list with links to posts in a specific CPT and taxonomy:
<?php
$custom_terms = get_terms('videoscategory');
foreach(array($custom_terms as ...
0
votes
0answers
38 views
No results for my WP_Query array
I have to get related posts via keywords/tags, and I found a ton of examples elsewhere on how to do it, but the query doesn't seem to produce any results. Can anyone point out how to do this, and is ...
