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

learn more… | top users | synonyms

0
votes
0answers
8 views

Display list of most recent grandchild (third tier) pages

I currently have a piece of code I'm using to display a list of the three most recent 'special' custom post type posts which will display an image, title and content of these posts. I'm trying to ...
0
votes
0answers
11 views

Query for distance OR taxonomy term

I'm using a custom query to retrieve posts with geo-coordinates within 10 miles of user coordinates and order them by distance. The query works as intended without issue. However, my client now ...
3
votes
1answer
29 views

WP_Comment_Query pagination, delving into the unknown

I am aiming to pagination WP_Comment_Query(). It appears this is either taboo or there is no viable information about it online, not anything. Why? Is it possible? If so, how?
0
votes
0answers
4 views

how to get Tag in menu populated with recent posts submenus

I would like to know if it would be possible to implement an option to "populate" each tag menu items of my WordPress site automatically with links to recent post as submenus. In other words, when ...
0
votes
2answers
15 views

Different values for get_author_posts_url and get_the_author (posts 2 posts)

Caveat- I'm not a programmer, I'm a designer that has taught myself basic php/wordpress theming. This is a very specific question, I realize, but I'm hoping the experts can help me find some ...
0
votes
1answer
22 views

How to convert query sql to shortcode in wordpress?

I want to make a shortcode like this [myshorcode:2:drinks], and query-wrangler I have managed to get the following query that shows me 2 products of a certain taxonomy PHP WP_Query: $query = array ( ...
0
votes
0answers
12 views

How can I show latest posts from certain tags menu items as submenu?

I have the following order of menu in the menu dashboard: Category1 ->tags(related to category1) category2 ->tags(related to category2) etc.. when you hover a tag menu item I want to get the list of ...
-1
votes
0answers
11 views

Show all subcategories post on parent cat page using wp_query

I am trying to display the children categories post. $wp_query = new WP_Query(); $wp_query->query('post_type=post&posts_per_page=12&paged='.$paged.'&category__and='.$cat_id); <?php ...
0
votes
1answer
10 views

Issue attempting a wp_query_posts with tags

Having an issue trying to query the most recent posts using the tag, in this case, trending. I used the following code but I get no results. If I switch out 'tag' to 'post_type' it will work: ...
-3
votes
0answers
16 views

How to change wordpress default search without plugin [closed]

how can i display wordpress search results based on user input, users input are from and to dates from the datepicker.
0
votes
0answers
11 views

Delete duplicate posts (events) for The Events Calendar [closed]

we have a small WP site primarily built as a Calendar for local newspaper. The client wants to be able to delete genuine duplicate events from The Events Calendar. However recurring events are ...
0
votes
1answer
20 views

Function returning queried meta value based on current post ID

I have written several queries which sums download counts grouped by the post they are associated with, and other relations. They work great for exporting to CSV and other uses outside of WordPress, ...
-1
votes
0answers
15 views

Woocommerce display only specific categories in the store and widget [closed]

I am trying to hide all but two specific product categories from the store. I found this code (http://docs.woothemes.com/document/exclude-a-category-from-the-shop-page/). It sucessfully hides ...
0
votes
2answers
48 views

Wordpress SQL injection

How to make below code safe from sql injection ... I am working in wordpress. global $wpdb; if($wpdb->insert( 'votes', array( 'votes' => ...
0
votes
0answers
5 views

Custom short code pulling all tag IDs instead of selected ID

My server host recently detected malware in a script and deleted the files, causing the audio player plugin on my website to go bye-bye. I'm trying to restore but now the custom short code I wrote is ...
0
votes
1answer
19 views

Missing posts in a query

I've got this loop where I need to grab a custom post type, get a taxonom, then for each term in taxonomy I need to output all posts. They are all output in a gallery, where taxonomy term is the ...
0
votes
0answers
6 views

MySQL database insert no more works

I am working in wordpress and below is my code which has a form tag in a for loop and the submit button. When submit button is clicked an insert operation needs to be performed but the insert function ...
0
votes
1answer
25 views

Wordpress loop not working on static front page

I have a static wordpress front page. I want the code that works on my regular blog template to work on the homepage too. Currently, it only shows one post. The code in the main index.php is this... ...
0
votes
1answer
25 views

get query() without post content?

Is there a way to get query with post information (thumbnails, id, etc.) but without the_content()? I already have plugin to show recent posts in sidebars at homepage and when it is for example 20 ...
0
votes
0answers
16 views

Strange problem with wp_get_attachment_image_src database (db) query count

I have a purchased theme that has a custom WordPress loop in it that looks for image attachments via wp_get_attachment_image_src. It does this by doing the following: $image = ...
1
vote
2answers
60 views

Get next and previous 3 posts in a term in single post page

I have a the following Custom post type: episode Custom taxonomy: series sub terms real deal -> season 1, season 2, season 3, etc. The terms are hierarchical, and the entire thing is ...
0
votes
0answers
9 views

Create multiple taxonomy archives from the same tax and link term-links to them based off of the unique query

I have a CPT called "Clinical Trials." There are three taxonomies associated with "Clinical Trials" —"Locations", "Cancer-Types", and "Status". I have a query set up to return a list of all ...
3
votes
3answers
151 views

The correct method to pass query vars in AJAX using ajaxurl

OK, I had no idea how to title this topic. I'm trying to override the default behavior with ajax. The problem here is not actually a problem, but a wish more. I have this url: <a ...
0
votes
1answer
32 views

Finding the next 5 posts

On my single.php where I am calling my post I am wanting to run a query where I can catch the next 5 posts (chronologically). I know how to do everything except figure out a way to specify the 5 ...
0
votes
2answers
22 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
15 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
2answers
52 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
51 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
33 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
13 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
34 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
16 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
14 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
33 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
1answer
47 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
23 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
58 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
27 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
9 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
33 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 ...
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
48 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
50 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
58 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
26 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
87 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
27 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
37 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 ...