A generic term referring to the process of retrieving information from a database.

learn more… | top users | synonyms

0
votes
2answers
19 views

Include both default and Custom Post Type in query modified inside pre_get_posts

I want to include custom post type in the author arhive page. I tried the method discussed in this post: Including post_type = 'wiki' in author archives add_action( 'pre_get_posts', ...
0
votes
1answer
58 views

Run search query again without pagination gives no results?

Update: This question isn't really relevant anymore. I switched some code, so now the filtering works. Looks like the query wasn't working, because I triggered the indexTaxonomyCounts function from ...
0
votes
1answer
102 views

Run again current query via ajax but changing a var

I have custom query which is $query. The input is based on form input. The query has already run on a page, but after that I'd like to run it again without a page reload, so with AJAX (when the users ...
0
votes
2answers
245 views

When/why does '$query->get( 'tax_query' );' return empty?

First the code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); ...
0
votes
1answer
133 views

Query set using tax_query with relation 'OR' modifies category object?

(Update: Please see the edits far below.) The code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( ...
0
votes
2answers
41 views

How to display lastest post date in the homepage?

I'm looking forward to display, somewhere in the homepage of a WP site, a legend saying: Last updated: XX/XX by grabbing the date from the most recent post, but not showing any of its content, ...
0
votes
1answer
343 views

date_query seems to be ignored by wp_query

I'm altering my main wp_query in a pre_get_posts filter in order to improve my site search capabilities. I've successfully achieved searching in taxonomies, but I fail when it comes to the post date ...
0
votes
1answer
198 views

How to display posts from specific category using get_option function?

I try to display posts from specific category only in a author page, using get_option function like in the code below but it does not work: <?php query_posts('cat='.get_option('admin_cat')); ?> ...
0
votes
3answers
120 views

search through post-type attachments titles

I have a page where I show all the attachments of a page in a table which has id=10. I have hundreds of attachments and I would like to implement an AJAX search form that uses the title of attachment ...
0
votes
2answers
1k views

$wpdb returns no results with SELECT query on custom post type, works on default post type

EDIT: Adding more background info. I've coded a plugin that adds a meta box to the post page. When the post is published, the plugin will generate a random ID for the post, and insert the random ID ...
0
votes
0answers
85 views

get_query_var('paged') giving same result

I have a custom page, in that page i am using a custom select query for my search functionality. The problem is pagination not working. I used $on_page= get_query_var('paged'); for pagination. When ...
0
votes
1answer
590 views

Upcoming Event: How do I sort database by custom date field, but ignore past dates?

I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do: Query the "events" custom post type ...
0
votes
2answers
726 views

Using dynamic conditions in 'posts_where' filter

I have the following code which gives be posts that are published in the last 100 days function smbd_cats_by_days ($where = '') { $where .= " AND post_date < '" . date('y-m-d', ...
0
votes
1answer
251 views

show posts only on homepage but using custom post type and taxonomy for query posts via url

I would like to do the following: I have a index.php file in which I query all posts from the existing post_types. Like the code below. <?php if (is_home()); { ?> <?php global ...
0
votes
2answers
1k views

All in One Calendar Plugin Custom Post Type Query

Hi I'm trying to write a query which will pull the events out from the All in One Calendar Plugin. This is what I have so far: <?php query_posts('post_type=ai1ec_event');?> <?php while ( ...
0
votes
1answer
186 views

wp remove query

i want to remove a certain query in wp 3.1 add_filter( 'query', 'remove_delete_7_day_draft_queries' ); function remove_delete_7_day_draft_queries( $query ) { global $wpdb; $q = "SELECT ID ...
0
votes
1answer
454 views

How to Check if a Child Category is Being Queried

I need to change the number of posts queried for specific categories 'Recipes' or 'Product Reviews'. The below code works great for this, I have it in functions.php: function ...
0
votes
2answers
343 views

How to extract all ID variables from a query string?

What is the best php method to extract all IDs from a query string and display them in a comma separated list? I have a function that grabs specific posts from the database and am trying to enter ...
0
votes
2answers
251 views

bulk post_content update

I need to replace all post_content in a particular tag/category to the desired one i have. is their a plugin to accomplish it or is their a query to finish this. Iam sick of doing this manually, is ...
0
votes
2answers
905 views

Different Main Navigation per category

I have a client who has the categories listed in the right-hand sidebar. He came to me today requesting a different "navigation" in the header for each category. So basically, if you click on ...
0
votes
1answer
422 views

Query the Loop without breaking it

Im trying to make different querys in my category like one with a offset of post and one that shows one post but while it continues to go through the loop, this is what i have but the loop keeps ...
-1
votes
1answer
1k views

WP insert post PHP function dynamically generated Custom Fields

Further to my previous question WP insert post PHP function and Custom Fields We have a working insert post function that can also send over custom fields without yet knowing the ID. Please see the ...
-3
votes
2answers
85 views

Query parsing only author ids

I need array only all author ids from the loop, each one only once if possible and out of all posts in the loop. Any suggestions?