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

learn more… | top users | synonyms

3
votes
1answer
22 views

Query Custom Meta Value with Increment

I have a Query searching for a meta value I have added to my posts (meta-select). I have it feeding out in a loop with 4 results. Let's say I want this loop to start with the meta value "2" and work ...
-1
votes
0answers
6 views

help to generate dynamic controls based on database records [on hold]

i am doing my project in vb.net.my project title is grade sheet system.i get an number of subjects from users and also course,semester details..,. my problem is generating an controls during run time ...
0
votes
2answers
2k views

Using $wpdb to query posts with meta value containing current post_id

I am trying to to use $wpdb to retrieve a list of posts from the Database where the meta_value in the wp_postmeta table contains the current post_ID in inverted commas. eg. "10" The inverted commas ...
0
votes
1answer
26 views

Can't update multiple rows with $wpdb query

it seems that I cannot update multiple rows to change the post_type of posts having a specific tag. I follow different method, even if it seems the good one is this one : global $wpdb; $result = ...
0
votes
1answer
34 views

post__in not working with pre_get_posts, but post__not_in does work

I have an action setup on pre_get_posts which I would like to use post__in on. I used the following code as a test: $query->set('post__not_in', array(74485,1528,71460)); This works, the total ...
0
votes
0answers
11 views

Incorporating a meta query into a mysql query in wordpress

I'm trying to find a way of inserting a meta condition into this bit of SQL below... $query = "SELECT COUNT( ID ) as num_events " . "FROM $wpdb->posts " . "WHERE ...
1
vote
1answer
369 views

How to retrieve attachments from child pages of a specific Page?

How would I retrieve attachments from all subpages of a specific Page ID? Example: SPECIFIC PAGE Child (with attachments) Child (with attachments) Child (with attachments) I'm currently ...
0
votes
1answer
21 views

Only show upcoming event or current events

I've been working on this website event page http://aishaarab.com/events/ everything is working but I have 2 problems: I can't get it to only show upcoming event meaning when an event is ...
0
votes
1answer
514 views

meta_query on a date range using an array of values

How can I do a query to return the post if the custom field array contains a date that is within the specified range? The query below is basically what I am after but it does not work... // the ...
0
votes
1answer
23 views

Custom MySQL Query for Post and Post Meta

I have a custom table called "tags" that contains a charity_id that is a reference to a post ID ... I need to query the "tags" table to grab this charity_id and then pull in the post title and a few ...
-1
votes
2answers
29 views

What's wrong with my $wpdb prepare

I can't get my head around this. I get this error: Parse error: syntax error, unexpected '"' in 224. The line is this between foreach $html: $html = ''; foreach ( $recent_across_network as $post ...
0
votes
2answers
24 views

Why in this archive page that call query_posts() function show only the last 10 posts?

I am pretty new in WordPress theme development and I am finding 2 problem with this posts archive page: http://lnx.asper-eritrea.com/archivio/ The previous page have to show ALL the blog posts into ...
0
votes
1answer
11 views

How to get link and title of next and previous post on single page

Guys How can I get the link and title of both next and previous post on the single page? Just like in the screenshot below. I try to use this but nothing shows up. $prev = get_previous_post(); ...
0
votes
0answers
348 views

Query multiple taxonomies plugin with ajax, archive loading posts outside filters

I have a custom post type called jobs and within I have several taxonomies: Job type (full-time, part-time, practice, etc), Country, Job Area (design, development, etc). I'm using the plugin from ...
0
votes
2answers
178 views

Get first comment link on the post itself

I have this function and a link to a post: <?php foreach ($results as $id) { $post = &get_post( $id->ID ); setup_postdata($post); <li><a <?php href="<?php ...
0
votes
0answers
29 views

Horizontally paginate through sets of blog posts?

I have my posts set up like this: I would like users to scroll through the posts using the left and right arrows. So when users click on the right arrow, for example, the next six posts would slide ...
2
votes
2answers
1k views

Get category slug and display it on a query_post

I just read "How to create option page for wordpress theme" in wp.tutsplus.com - I have a problem with getting categories . there is two parts to my question - Part A - Get category slug and ...
0
votes
2answers
354 views

How to exclude custom fields from search queries?

I'm building a hotel search engine and I've first created a custom content type "hotel" with Types & Views Toolset. I'm using "Search everything" plugin to query custom fields and custom taxonomy ...
2
votes
2answers
3k views

WordPress Paginate $wpdb->get_results

Due to a complex multisite config, I have a query which combines the posts from two blogs and I would like to paginate the results. I am grateful for any help. I have posted my query. ...
0
votes
3answers
664 views

How to delete all posts, categories and tags from Wordpress database

I have WP website with over 40,000 posts. Now I'll like to delete all posts, categories and tags. So All content and related meta. All I want to keep is static files. Is there a easy way to do this ...
0
votes
1answer
32 views

Some doubts about how the loop work (trying debugging it)

I am very new in WordPress development (and also in PHP development, I came from Java and C#). Today I have installed Aptana and configured XDebug to inspect what happens into the TwentyTwelve theme. ...
1
vote
1answer
299 views

How to reduce the number of queries?

I have meta key "Due" for posts....if a post has expired (past the current date or not equal to it) then it will not be displayed in the count. This is my code, which works perfectly. My only problem ...
0
votes
0answers
16 views

Title outside of the loop in page template

I have a page template, with a very simple default query. The problem is that the title is outside of the loop, because of the layout. What do you think, is it problem? Or do you know an other way? ...
0
votes
1answer
439 views

Load more posts with multiple queries

I've been developing a theme which uses the load more ajax plugin, everything is setup and working great with the main query. But, once I setup a new query for popular posts, the load more posts ...
0
votes
1answer
699 views

Displaying Portfolio Filter by Category Order (alphabetically)

I have created a custom post type to display churches in Europe. I used this tutorial to make it filterable: http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/ ...
2
votes
2answers
292 views

Grouping related postmeta data via SQL query

I am using someone else's WP plugin which stores lots of related data in wp_postmeta using an "artificial key". So effectively we hijack wp_postmeta to create a nested relational database. So one row ...
0
votes
0answers
31 views

Problem with correctly registering query variable

I have an admin page for my plugin, which lists records from database. I want to sort them under some conditions. To call different sorting options, I've decided to use query string. Step 1: At ...
0
votes
0answers
16 views

Cron Job to Delete over 30 days old post from post type

This is my first time creating a WP cron job and I would like to have someone else review it for mistakes. I wrote this cron job to delete temporary wishlists that are over 30 days old. The wishlists ...
-1
votes
0answers
7 views

Display current user posts (Multi author)

I want to display the posts author when he is logged. So I use : wp_get_current_user(); $args_my_items = array( 'author' => $current_user->ID ); query_posts($args_my_items); The problem ...
2
votes
1answer
29 views

Filter Media Library by author or post_parent

I am trying to filter the Media Library so only media items that are uploaded by the current user OR children of the post being edited are visible. I've had no problem doing it if the conditions are ...
1
vote
2answers
284 views

Sticky post appears twice

I am trying to modify the number of posts_per_page in the loop. This way: function posts_per_page($query) { $query->query_vars['posts_per_page'] = 3; } add_filter('pre_get_posts', ...
2
votes
1answer
234 views

Show All Posts Insert Edit Link

When I click to insert/edit link in the tinyMCE rich editor for a post, then click "Or link to existing content", it shows only posts that are live and published. Is there a way to get the list that ...
0
votes
2answers
39 views

How to orderby meta_value_num with dollar ($) sign

The custom fields all have prices including $ signs, and a dot as separator. $theQuery = new WP_Query(array( 'orderby' => 'meta_value_num', 'meta_key' => 'price', 'order' => ASC )); All ...
0
votes
2answers
583 views

How to display only one category in a custom post type?

I have a custom post type called 'portcat' and I want to display the results of only one portcat category ('games' - which has an ID of '3') on my page. The below code displays all of the categories ...
0
votes
1answer
13 views

how to insert missing tags into the posts through mySQL?

I am looking for a SQL query to insert a tag to multiple posts from a specific category. A pseudo query looks something like this: INSERT INTO POSTS VALUES TAG = "tagName" where Posts ...
0
votes
1answer
469 views

Custom Search Query

I'd like to set up a custom search page that does the following: User checks off several items in a form that he'd like to see returned in his search (essentially choosing from a list of tags). ...
1
vote
2answers
919 views

Specific Loop For 2 <div> Within Each <li>

I need to create a loop that can logically be described as the following for a carousel: Requirements: 3 Loops 2 Posts Per Loop No Duplicates Order by Post Date Visual: < Start Loop #1 > ...
-1
votes
2answers
35 views

show all custom posts types in home page

Hi i am working on custom post types in wordpress presently we are using below code to display the custom posts, but the thing is the custom post types are keep on increasing, add_action( ...
0
votes
1answer
26 views

Apply ordering args to newly merged queried

I have two queries with arguments and then I merged them to form my new query - $wp_query. I would like to now apply arguments to the new query to show the merged pages/posts by meta_value_num. This ...
0
votes
0answers
59 views

SQL query for converting post meta image url to featured image

WordPress guru, we have a question: We work on a website, which was not updated a while. Most of time it have wordpress 3.2 installed. We've updated it to the latest wordpress version, but ...
6
votes
4answers
14k views

Query multiple meta key values?

How to query for mutiple meta key values with the same key $querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta WHERE ...
1
vote
1answer
558 views

Sort posts based on multiple custom fields

I have a three custom fields Meta Key → YOUR_PREFIX_newcar_body_type Meta Key → YOUR_PREFIX_newcar_transmission_type Meta Key → YOUR_PREFIX_newcar_variant and I have to sort posts ...
0
votes
0answers
34 views

Can I use multi (sub) levels of relation (AND | OR) on custom query?

I'm tryng to do the equivalent of: $args = array( 'post_type' => 'post', 'tax_query' => array( 'relation' => 'OR', array( 'relation' => 'AND', ...
0
votes
0answers
33 views

How to organize a WP_Query's list of posts by category and display category title?

If I run a query with some args and get a list of posts, how can I organize the posts separated by category and display the title of each category? $array_out = array(); $args = array( 'orderby' ...
0
votes
2answers
42 views

How many Wordpress SQL Queries per page?

I am on a shared hosting which has a limitation at MySQL queries per hour. My shows unable to connect to database because of this. Can anyone tell me how many queries are per page on a wordpress site ...
0
votes
0answers
25 views

Get a list of the last posts grouped by author and filtered by category

i need a list of the latest post published by various authors, but filtered by category, like for example the latest posts of author that write about music. i wrote this query and looks like working ...
0
votes
0answers
27 views

Can I query another data table on a multisite with the single.php template?

Here's a quote from a thread on this forum showing exactly what I'm trying to do: blog 1 gets = wp_post table blog 2 gets = wp_2_post table Small multisite setup, two very different sites, both ...
0
votes
1answer
106 views

Custom post type posts don't show in archive widget

I have a custom post type called 'Podcasts' but none of the posts are showing in the archive widget. Only the main query (blog posts) are being shown. I've tried adding this code below to include the ...
0
votes
1answer
34 views

WordPress SQL query to tag all posts containing a specific word on title

Is there a way to bulk tag all posts which have for instance "bottle" in their titles? Thanks!
0
votes
0answers
16 views

Tax Query not working

I'm having some trouble with my tax query. Im getting some values by GET, but it seems my tax query refuses to work: $args = array( 'post_type' => 'imovel', ...