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

learn more… | top users | synonyms

0
votes
2answers
17 views

Sort Wordpress Posts Meta value by Week not Day

Right now I have a metakey called 'epicredvote', it sorts my posts by this epicredvote number. It is doing it on a daily basis at the moment, so if I have 2 posts the post with the highest epicredvote ...
0
votes
0answers
13 views

WordPress Query Count

So I've used get_num_queries() and the "debug bar" plugin for a while to monitor the number of queries running against the database. Earlier today I turned on the MySQL query log for an unrelated ...
0
votes
0answers
15 views

meta query always fails even if data is correct

I've following query - $query = array( 'post_type' => 'accessory', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'accessory-bike', ...
0
votes
0answers
17 views

Exclude Product Category From Query [closed]

I have found quite a lot of thread talking about excluding categories from query but most of them are related to general posts, not product categories from WooCommerce. The closest thread to what I'm ...
0
votes
2answers
43 views

list all categories that have a certain word in title

How to list all the categories that have a certain word in title - first word of the category? in category.php so, for example, if I am viewing the category "Green Apples Sells", it will list all the ...
0
votes
0answers
40 views

Include data from custom table in WP_Query

I'm building an Estate Agent website. They have a system where they add their available properties and sends them all to the main property portals. As part of this, the system also sends all the ...
0
votes
1answer
32 views

How can I display a number to represent the order of post?

I want to display the numerical number next to the_title of my WordPress posts. For example, I have 10 posts already: 001 - First Post 002 - Second Post ... 010 - So on... I have tried it with a a ...
0
votes
0answers
10 views

group search results by post type with relevanssi

I have 3 post types: post lesson series When a user searches on my site, I want the results to be sorted by post type into different containers. I am using the Tabs from Zurb Foundation for my ...
0
votes
0answers
27 views

Very slow queries on production server but faster in xampp

this seems a rebus to me. I have some queries very slow in a dedicated server (8-9 sec) and much faster in an xampp environment (0.00035595893859863 sec). Further if I execute that query in phpmyadmin ...
0
votes
0answers
14 views

Adding Database Tables for Reviews functionality that incorporates Tags/Categories

I'm wanting to build onto to the Wordpress database in order to give myself the functionality to create/retrieve customer reviews based upon tags/categories. More specifically, the reviews are not ...
0
votes
1answer
13 views

Show popular post by category code

How do I show popular post by category code I have add code <?php $popularpost = new WP_Query( array( 'cat'=> 2, 'posts_per_page' => 1, 'meta_key' => ...
0
votes
1answer
30 views

How to query different categories on index?

I'm new to WP and I want to know how can I show latest posts on different categories separately in blog index ? one section for latest post on Fashion category, one on Health posts, etc. I know about ...
0
votes
0answers
16 views

query rewrite directing to correct page but not performing the query [closed]

I am attempting to rewrite the urls of a plugins custom search. i have the url "correctly" displaying the search results page, but it is not posting the query to the page(as i type this i am ...
0
votes
1answer
39 views

How to query post into a complex slider

I'm trying to query post into a slider. Here is the HTML Markup for the slider. Each slide has slide and a relating thumbnail. <div id="example1" class="slider-pro"> <div ...
0
votes
2answers
20 views

Query post category & remove any post id

I have category_id=3 and have 10 post in category_id=3 with post_id= 1=>10 How to show list post category_id=3 with no post_id=1,3,5 value as query_posts('cat=3& -p=1,3,5 &showposts=30
1
vote
2answers
27 views

Which custom query am I in and how can I access its properties & methods?

Sometimes there's no way around creating a custom query, but when I do and then loop through it, I often want to use get_template_part() within the custom query loop to pull in a template I already ...
0
votes
1answer
40 views

WP_Query() with custom post type and taxonomy — get all terms?

I have the following custom post type: lesson custom Taxonomy: subject which contains terms like math, reading, etc.) I have configured my page so that the user may filter the results by ...
0
votes
1answer
24 views

Plugin will sort users by usermeta

As I refine my most popular plugin it will store a special number decoded from the user's birth date, which is an extended BuddyPress field in bp_xprofile_data. All users get a number between 1 and ...
0
votes
0answers
8 views

additional query string appended to the landing page which is causing a redirect

I run a website for the company i work for, and am a 'self' taught in the website world.. We have signed up with a company called Reach Local, and they are doing some marketing etc.. and they need to ...
0
votes
0answers
21 views

Display Users by usermeta using foreach loop with multiple relationships

I'm getting a real headache trying to sort this one out. Here's my problem: I'm working on a feature for a site that requires Users to be displayed according to their association with a common ...
-2
votes
0answers
16 views

Which is the get_the_terms effective sql generated by wordpress?

For some heavy process about one project I'm working at, I need to access the database directly with mysql connections and not with WP_Query or wordpress functionalities. So I need to know for ...
0
votes
1answer
39 views

Sorting of coupons in the right way

I´m using custom post types on my site and i need to sort these coupons in this way: New Coupon ending TODAY --- New Coupon ending 05.03.2015 New Coupon ending 06.03.2015 New Coupon ending ...
1
vote
1answer
40 views

problem with sql query in wordpress plugin

I've got this and I dont know why its not working. It's not returning the ID from the first query so I can use it in the 2nd query. Nevermind the REFERER, its an external link it will refer from. ...
0
votes
1answer
37 views

Display most viewed post from last 30 days is not working correctly

I've try several different loop to display the most viewed post from the last 30 days . . However its just showing the post from 30 dasy ago . . not from the last 30 days . . not the most viewed . . ...
0
votes
1answer
38 views

Wordpress Insert not working with ajax

I am trying to enter insert data with form in wordpress and want to use ajax for that. Without ajax it works fine but when I use ajax pressing the submit button gives 0 in result and the data is not ...
0
votes
0answers
21 views

Query posts by date - category and custom field

I have this scenario: Categories: 23Feb2015, 24Feb2015, 25Feb2015, 26Feb2015......30Jan2099 Every day i add 5-6 posts in to a different category (today posts are in category 26Feb2015, yesterday ...
0
votes
0answers
68 views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', ...
0
votes
1answer
23 views

WP_User_Query orderby meta_val_num

I know that normal WP_Query's can have an "orderby" parameter of "meta_value_num", but when I try to user "orderby" => "meta_value_num" on a WP_User_Query, it doesn't seem to work. Anyway I can ...
0
votes
1answer
31 views

Query posts using meta_key

I am trying to rank results based on the value of a meta_key. This is my form <form action="<?php echo home_url('/');?>" method="get" data-javo-patch-form-for-result> <input ...
0
votes
1answer
22 views

show posts found in multiple categories via category_name query string?

I am attempting to allow visitors to filter posts in an archive to show posts that are found in two categories. The code is building the URL as follows: domain/?category_name=slug1+slug2 Previously, ...
0
votes
0answers
80 views

Ajax Form data is not posted back to the get_results()

I am trying to run a wordpress wpdb->get_results select query and I want to get the search criteria from a textbox. I want to do it form and with ajax without refreshing the page. No matter what I do ...
0
votes
1answer
35 views

Ajax Query returns zero

I am doing simple wordpress select query and want to do this with ajax jquery and do not want the page to refresh when I press search button and writing text in search textbox. As soon as I press ...
0
votes
0answers
14 views

$wpdb->get_var returns nothing,

I don't see any errors, but there is no output from: global $wpdb; $tablename = $wpdb->prefix.'postmeta'; $field = "wpcf-image-".$imgnum."-after"; $id = 1910; $single_result = ...
0
votes
1answer
79 views

Get all user meta by meta key instead of ID

I'm trying to compare user meta values to find highest and lowest values. I have a user meta value set up called "hourly_rate". I want to get the hourly rate for all users and then run PHP's min() and ...
2
votes
2answers
109 views

get_the_foo() in the loop - does it perform another query?

I'm unclear on the get_the_foo() style of functions, for example get_the_permalink(). My main question is: when this is performed in The Loop, is another SQL query executed (besides the original ...
0
votes
2answers
50 views

$wpdb->query can't insert data

I Write Code to Save data in the Wordpress database table (table name is wp_fafa) But Can't Save data in $qry = $wpdb->query( "INSERT INTO `wp_fafa` ...
0
votes
0answers
32 views

Using $wpdb (WPDB class) 'replace' with multiple WHERE criteria problem

I have two fields that are used to identify a particular row (acting as a composite key). If it does not exist, I wish to insert a new row. The REPLACE function ...
1
vote
2answers
31 views

Query posts if meta key starts with

I need to find posts with a meta key that starts with the current year + the current month (i.e. 201502), but the actual value could also contain any day within that month (i.e. 20150214). The ...
0
votes
0answers
39 views

Pagination not working in custom post page

I have this theme that I created which is a mix of code copied and mixed from different themes, and I have a custom post page in the theme where pagination isn't working for some reason. <div ...
0
votes
1answer
38 views

You have an error in your SQL syntax - Help with query

I have a programmer that developed a custom plug in for a client's website and after moving the site to client's server, some parts are not working. Looking at the error log, there is an issue with ...
0
votes
1answer
64 views

3 Posts in Loop, Show Stickies First

Okay I am starting to wonder if it is even possible to do this! As I've found very little info on the matter online. This is a fresh WP install that I've been experimenting on so that I can work in a ...
0
votes
0answers
30 views

wp_query - Modify $query to include duplicate content

I'm setting some featured content through the customizer (it's saved in theme_mod); Using the pre_get_posts hook, I'm retireving the feature pages in this way: ...
3
votes
2answers
110 views

Return only Count from a wp_query request?

Is it possible with the standard build-in tools in Wordpress to get wp_query to only return the count of an query? Right now, I’ve a query which has several meta_queries but what the only thing I’m ...
0
votes
1answer
23 views

Query Set Order By Author

I am attempting to orderby the author_name when you click on the Author arrow on a list of tickets. When you click the arrow, the names are ordering by something I cannot identify. I want them to ...
0
votes
1answer
177 views

WooCommerce search products between price range using WP_Query

I am currently building my own custom advanced search functionality for a WordPress website with Woocommerce. You should be able to search using: Category Min/Max price My current progress is ...
0
votes
1answer
68 views

WP_Query custom order and pagination

I am seeing some strange behaviour when combining a custom order with pagination when using WP_Query. The arguments for my query are as follows: $args = array( 'post_type' => 'news', ...
0
votes
2answers
47 views

Make a WP Query search match exactly the search term

I'm using WP Query and the results coming back when using the search term aren't working as I wish. For example searching for 'art' returns also results for words containing 'art' such as 'part'. How ...
-1
votes
1answer
22 views

query grandchildren taxonomy terms

I have a function that queries the children of each taxonomy terms, I'd also like to query the children of these children terms too, my markup is as follows: <?php $terms = ...
0
votes
0answers
15 views

how to create advanced search [duplicate]

I'm really stuck in this and i cant find any tutorial or article about this topic. How about if we have this pattern for search: [country] AND [category1 OR category2] AND [city1 OR city2] AND ...
1
vote
1answer
26 views

How to add a post or page tag to the list of classes appearing in the body tag's class attribute?

Good day, Perhaps you are willing to help out a php-beginner. I'm trying to add a post or page tag to the list of classes appearing in the body tag's class attribute. These classes are printed onto ...