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

learn more… | top users | synonyms

-1
votes
0answers
9 views

Customization in Wordpress Plugin - Search result page

I am using a WordPress plugin for travel search by Travel Grove. This is the url : http://www.designgridstudios.com/demo3/ . After filling the search form it points to Merchant site and compare the ...
0
votes
0answers
21 views

Loading posts from another wordpress database on the same server

I've searched quite a while and found several solution but apparently I'm doing a lot of stuff wrong. I'm having 4 different Wordpress sites and need to load the latest 2 posts of each site. For ...
0
votes
0answers
8 views

Mysql join 2 columns into 1

Hello i could really use a hand here.. the thing is i want to make 2 tables for a project - 1: Shifts: - which has: id, usr_id, date, start_time, end_time, and pending - 2: shifts_extra: - which ...
0
votes
0answers
32 views

Query post by meta key of another table

Im using event calendar plugin where I can set event date for posts and it shows in calendar widget. Everything is working as inteded but I would also like to query post by event date. I know how to ...
0
votes
1answer
18 views

Need help with custom rewrite rule

I have a CPT called presskit, and I need to add a custom query var named welcome_box. I have this code right now: function my_new_url_querystring(){ add_rewrite_tag( '%welcome_box%','([^&]+)' ...
-1
votes
0answers
18 views

How to add a query string to all url of a page category (woocommerce shop category)?

I need to display by default the list view activated by the query string "?product_view=list" only in certain category list pages of my choice (es: ...
0
votes
0answers
9 views

Search within multiple authors posts with Relevanssi

Is it possible to search within multiple authors posts? When I try to create a array and pass it to the query it gives me: explode() expects parameter 2 to be string, array given in ...
-1
votes
0answers
13 views

Anyone know how to create comparison table with filtering? [closed]

The thing that I want to do is something like this: Comparing product features The visitor want to compare two product at the one time: iPhone 4s Vs iPhone 5s --> will show up 2 table side by side ...
-1
votes
0answers
22 views

Getting Position of a post in a category with order ASC / DESC

I need to know if is there is a way to order DESC regarding this topic. Getting Position of a post in a category
0
votes
0answers
17 views

Creating a top and display the top position inside post

I've create a top of the best football players in the world with a custom post type and i added to each player a custom field for goals/salary/country etc. Now i need to know if you guys have any ...
2
votes
1answer
86 views

Why does get_the_time('F j') return November 30 for all posts?

Okay, so I'm making the blog page for my WordPress site. My front page is displayed as static, so my blog posts are on another page called "Journal." I want to display the posts in an archive-like ...
0
votes
1answer
32 views

How do I get the index for a custom post?

This is kind of a different request, but my client wants the index of a custom post type. Basically for a regular post, they can select 1 custom post from a list in a custom field to "attach" to the ...
0
votes
1answer
15 views

Sort / Filter Queries

I'm working on a website, that showcases products, and now I'm working on the query part. Basically I want to have one page, that displays a list of products as a normal query, and then on top of the ...
0
votes
1answer
42 views

Updating with $qpdb->query() always returns 0 rows affected

I'm experiencing an odd situation while running an UPDATE with $wpdb->query(). Given the users table, with columns user_id (Primary Key) and status, and the user 3 existing and with status 0, I ...
0
votes
1answer
20 views

Getting custom post types to properly display alphabetically

I'm trying to get the sub loop of custom post types to display in alphabetical order, but having no luck. I've tried applying ksort and asort to the $posts array, but it just reorders the ID display ...
-1
votes
0answers
10 views

WooCommerce - Product counter in categories on basis of tags

I was working on woocommerce and I am stuck at filtering the categories on basis of tags on products under that category. I have edited my category page to show all tags as filters now I want to ...
0
votes
1answer
20 views

Delete data from custom table in wordpress

i am trying to delete record from my custom table global $wpdb; $retrieve_data = $wpdb->get_results( "SELECT * FROM wp_paypal" ); echo '<table border=1 class="table table-striped"> ...
0
votes
1answer
30 views

Select query for a login

I'm trying to make a login form, but select query isn't working. Is there another syntax in WordPress and in which way is password hashed? My code is: if ( isset( $_POST['submit'] ) ) { if ( ...
0
votes
3answers
60 views

Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts

UPDATE: The hook is working with "classic" Wordpress filter (like post__in), so it's probably a Posts2Posts issue. I'm still looking for suggestions if someone has any idea. ORIGINAL POST I'm ...
1
vote
1answer
16 views

How can I apply a meta query for a single custom post type in the main query?

I have custom post type called event, which has custom fields for start_date and end_date. For the event archive, I'm filtering out "expired" events using the following meta query added to the main ...
-1
votes
0answers
8 views

how would i generate two drop down boxes to select an outcome?

I'm trying to create a product page, and I want it to have two drop down boxes to select the finish of the product and the length.(e.g eBay have a quantity and color) Both of these outcomes have a ...
2
votes
2answers
189 views

Conditional to modify query results

I'll admit, I'm not a PHP expert, nor am I familiar with all of the WordPress functions and hooks. I've been stuck on an issue, searching for help without much success, and I was hoping that someone ...
0
votes
0answers
11 views

WP Query - Group by relation (custom post type)

I have a custom post type Office. An office has an address, email, ... . An office also has a relation with a custom post type Region. So an Office must have a relation with a relation with one ...
0
votes
1answer
19 views

Create query for both custom post type and category

I have a custom post type called articles and have category = news I want to make a query from the two parts to get content from (cpt=articles, category=news) in the same query? How can I achieve ...
0
votes
1answer
24 views

Counter is skipping post when I still want it visible [closed]

I am showing the 5 latest posts on my homepage. I am using a count so that on the 3rd post it shows a div which will be completely seperate to the blog posts. However rather than the 3rd post ...
-1
votes
1answer
30 views

Showing specific post in order of array wp_query

I have displayed some specific post ID's in a custom template with wp_query. I am struggling to figure out how to make these in order. I want to show 1682 first and 1540 last. They do not show this ...
2
votes
2answers
55 views

Slow wp_enqueue_media()

I have developed a WordPress plugin for my site that utilises the WP Media uploader to store files... To do this my plugin contains the following code: function enqueue_scripts() { ...
0
votes
0answers
17 views

Search with array in Meta query

I have a meta key "group_roomtype" with value a:2:{i:0;a:2:{s:16:"roomtype";s:3:"265";s:11:"qty";s:3:"100";}i:1;a:2:{s:16:"roomtype";s:3:"266";s:11:"qty";s:3:"200";}} I want filter by qty, please ...
0
votes
1answer
16 views

Why the pre_get_posts hook can cause apache stopped working?

I'm having all my posts with a Custom Field named 'validity' where I'm assigning dates until the post is valid. My taxonomy archives are showing all the posts. Now I want to filter there, and exclude ...
0
votes
1answer
33 views

Is it possible to add query parameters on the archive page?

I have a custom post type (works), and an archive page (archive-works.php). I would like to hide the non-public posts from the archive page, so I added a custom meta box. I also modified the query to ...
0
votes
2answers
60 views

Custom search SQL Query to add custom field in result

I have to write my own MySQL query since I haven't found a good way to do it within wordpress functionality. I want the search query to search trough post_title / post_content & meta_key ...
0
votes
0answers
20 views

Category list with subcategories and terms

I have a problem that I cant figure out myself. Maybe I'm going in a wrong way and thats's why it won't work. So I need a list of categories (custom post type "products"). I have some subcategories ...
0
votes
1answer
36 views

Modifying date filter on admin page for custom post type to link to custom field

Apologies if a similar question has already been asked, but I can't seem to find the exact functionality I am looking for. Basically I have a custom post type (sermons) which has 'recorded_date' as ...
1
vote
1answer
27 views

Temporarily storing main search result

I have several different post types and when someone searches, it lumps all the post types together and then I have a drop down select for the user to refine their search by the different post types ...
0
votes
0answers
19 views

Search returning everything

<div class="page-head"> <h2 class="page-title"> <?php if ( have_posts() ) : ?> <?php printf( __( 'Search Results for: %s', ...
0
votes
0answers
32 views

Reorder results of select query by distance

What I'm trying to achieve is a store directory listing nearby stores, ordered by distance. I've managed to grab all the stores within the specified radius and display them, and also calculated the ...
0
votes
1answer
19 views

Filter query posts by the count of metas for a meta key

I know it is possible to filter queries to order posts by the numeric value of a meta. For example, I store the number of total likes for a post in a single meta key : ...
0
votes
0answers
26 views

Query post by category using only one custom page template

Is it possible to query a post by category using only one custom page template? Basically I created a custom post called "Vehicle" and each post are assigned to a different a category. Instead of ...
0
votes
0answers
24 views

wpdb giving different results then query in SQL Editor

I'm trying to read candidates and the relation with expertises from 2 custom tables in my WP Database. This is my WPDB query : $candidates = $wpdb->get_results(" SELECT * FROM ...
1
vote
1answer
33 views

Include posts from feature category in pre_get_posts

I have two custom taxonomy 'cities-taxonomy' and 'userfeed-taxonomy' and I am excluding all the post which has these taxonomies assigned in my blog page using pre_get_post(); Here is my query ...
0
votes
1answer
36 views

pre_get_posts with get_posts

So in the template I've multiple featured posts and sliders and 2 default loops. I use get_posts for everything except default loops (obviously). Now the issue I'm having is excluding get_posts ...
0
votes
0answers
41 views

MySql query to retrieve post_title, post_content and feature image link BASED ON A CATEGORY

I have been trying for quite a long time to retrieve post_title, post_content and feature image link for all posts BASED ON A particular CATEGORY, from a wordpress database. I have got a query: ...
0
votes
1answer
70 views

How to reset usual $query on search page to push custom $wpdb query there?

I, recently posted 2 questions (First, Second) with no answer. I found my solution for both of them. But now it's time to fine-tune things. If I can fine-tune here, I could answer both the questions. ...
0
votes
1answer
25 views

Why my query does not run with prepare

Hi Below is my query and it works with prepare keyword on the localhost but whenever I use prepare keyword with my queries on live server the data does not show up and as soon I remove prepare from ...
0
votes
1answer
29 views

How to pass menu slug as a variable to wp_nav_menu?

I need to show a menu depending on what user selects on Page Options. I take menu name from a user to a variable and now i need it to parse through wp_nav_menu. Im trying it like this but it doesn`t ...
0
votes
1answer
19 views

How to enqueue assets only on queried pages, excluding the page being queried?

How can I enqueue scripts and styles ONLY on admin pages that have a query attached to them? I have the code below which works, but it also enqueues on the native page of the query. I want to ...
0
votes
1answer
37 views

Multiple terms not working on taxonomy

I need multiple terms support my WordPress theme - $boards = get_user_meta($user_ID, '_Following Board ID'); $pboards = get_user_meta($user_ID, '_Board Parent ID'); $paged = (get_query_var('paged')) ...
2
votes
0answers
62 views

Custom WP_Query order by post_meta and (author) user_meta

I am having an issue that i couldn't find on google and elsewhere. To put problem in the context. I am making a wordpress site where user can put their tutor listing for giving a tutorials, and i am ...
1
vote
1answer
54 views

How to show only posts with images?

I want to hide posts without images on the front page, so I need get an array of ids of those posts. I know how hide posts on the home page by id, but I need to show only posts with images. This is ...
0
votes
1answer
12 views

query_posts that have custom taxonomy and limiting what shows based on the taxonomy

I have a custom post type, technologies, that has a custom taxonomy defined for it, importance. The idea is that a technology that has any significance will get importance tagged on it (featured is ...