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

learn more… | top users | synonyms

0
votes
2answers
13 views

Media Query - Display Upload Author & Get Uploaded Yo Post ID

Working on a project with a lot of galleries & "attachment" post type queries. It's all working great except I noticed in the Attachment Details box in the admin dashboard that Wordpress stores ...
0
votes
2answers
53 views

Ignore sticky posts if post is not in meta query

I have such a wp query args: $args = array( 'post_type'=> 'myposttype', 'posts_per_page' => 10, 'meta_query' => array( 'relation' => 'AND', array('key' => ...
0
votes
2answers
82 views
+50

Create a post builder skin in a plugin

Currently I'm working on a plugin that will display a grid based on post type with many settings to customize it. One of the settings will be to choose between different skins available to display ...
0
votes
1answer
25 views

Filtering custom posts by custom fields (ACF)

I'm working on a site with photo contests. Each contest has a lot of additional info, which I store in custom fields (thanks to Advanced Custom Fields). Now I want to search through contests filtering ...
0
votes
1answer
33 views

Search Functionality broken by the wp 4.2 update

I run a blog site with posts by authors, and I implemented a search that would return results if the search was like an author's name or the search term was contained in a story. I was functioning and ...
0
votes
0answers
13 views

How to move posts in featured category on top and keep pagination

I want to move every post from category_id = 11 and 10 on top of the list and then query every other post which is only in 10th. I thought that making two loops will do the trick but there is a ...
0
votes
0answers
6 views

Command to make Woocommerce product variation price the same as its parent product price

The variations are stored in the wp_posts table like the products, but they are related to the parent product itself somehow. I just wanted a command to make all products variations prices same as ...
0
votes
1answer
20 views

When add_query_arg() is necessary?

considering this code, both solutions seems to work fine. What I don't get is, is there any difference between the two solutions? general_plugin.php function add_custom_query_var( $vars ){ $vars[] ...
0
votes
1answer
57 views

add_query_arg() XSS Vulnerability

I've created a personal plugin and now I'm worried about this vulnerability: https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html This is how ...
0
votes
0answers
11 views

Wordpress URL strings for filtering posts by category

I'm working on quite a large blog based site specifically on creating a category navigation system designed to display posts based on multiple category queries. I'm doing this using URLs such as ...
0
votes
0answers
22 views

Override default posts per page in taxonomy template

I am using the following code to show ordered list of posts in taxonomy page: <?php $mypage = (get_query_var('paged')) ? get_query_var('paged') : 1; $ppp = get_query_var('posts_per_page'); ...
1
vote
2answers
51 views

Looping through posts per category gives same posts for each category

For a specific section on my website I loop through some categories and get the three latest posts in that categorie and list them. Like so: <?php $categories = get_categories(array('exclude' ...
1
vote
1answer
16 views

Are database queries created using WordPress filters protected from SQL injection?

I'm using the WordPress 'posts_where' filter (https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where) to alter my queries as below: function filter_my_search($where=''){ ...
0
votes
1answer
23 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
15 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
39 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
8 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
24 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
17 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
12 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: ...
0
votes
1answer
22 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, ...
0
votes
2answers
54 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
8 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
11 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
32 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
26 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
18 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
66 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
10 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
169 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
26 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
58 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
57 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
34 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
19 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
37 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
16 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
34 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
24 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
62 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
28 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 ...