0
votes
1answer
18 views

How to query the custom fields by language?

For each post, there is a custom field name "Function", the key/value pair is like this: Key : Functions Value : <!--en-->Nourishing Yin and invigorating the vital essence of ...
0
votes
1answer
39 views

Action hook “wp_insert_post” works but not for last imported post

I want to run a custom function whenever posts are imported to my custom post type. I am currently running this code - function on_post_import($post){ global $wpdb; $results = ...
0
votes
0answers
13 views

Meta query not working with pre_get_posts

This works $q->set('meta_key', 'available-date_%_from'); $q->set('meta_value', '20140701'); This doesn't $q->set( 'meta_query', array( array( 'key' => 'available-date_%_from', ...
0
votes
1answer
24 views

WP_Query Date Filtering Inclusive Being Ignored

I'm currently working on a plugin that contains a shortcode which allows users to filter a custom post type by date. They could choose "Date From", "Date To", and "Date From with Date To". When ...
0
votes
0answers
40 views

How can I search the post title and tag using WP_query of wordpress?

I am currently implement a search function to search the post from wordpress I would like to search the post by Tag , by title and return it as JSON I found a plugin that generate the result as JSON ...
0
votes
3answers
236 views

ACF: post query, hide duplicate values [closed]

I'm querying an ACF field, and displaying all the results on the front-end like so— PHP: <ul class="category-menu-items"> <?php // args ...
0
votes
0answers
75 views

Second foreach loop breaking (Posts2Posts)

I've read about a couple of similar issues that Google gave me (1 & 2), but I can't quite get to the bottom of this problem. Using Posts 2 Posts, I'm building a table of posts and their related ...
0
votes
0answers
34 views

How to re-run the main query based on meta data value?

When a user requests a custom post url like */books/best-book-eva, I want to (with a plugin) hook in before the page is displayed (and the main query run if possible) check that posts meta value ...
1
vote
1answer
112 views

How do I “get the next 10 posts after post_id == x”?

I am building a mobile application that is pulling the json feed from a blog. I can easily query to get the latest 10 posts for example. But next, I want to be able to query the next 10. This presents ...
0
votes
1answer
211 views

Advanced Custom Fields (ACF) Plugin - Random Image in Sidebar

I’ve created a Custom Post Type, “Slide”, and I’m attempting to load a random slide image, with title and caption, in my sidebar. I’m using the Advanced Custom Fields Plugin for the post/slide ...
0
votes
1answer
60 views

Ger posts from similar tags and categories

I want to retrieve 5 posts using any given post ID with following criteria: If the post with the ID has any tags, then select the posts having same tags. If the post does not have any tags, then ...
0
votes
1answer
21 views

wp_query for more fields plugin

I use this plugin : http://wordpress.org/support/plugin/more-fields/page/2 How use WP_QUERY for this inputs ?!
0
votes
0answers
144 views

All In One Event Calendar show event category and post category in loop

I'm using time.ly's All-in-One-Event Calendar and I'm creating a theme where I'd like to display featured items from both ai1ec events and posts in the same loop. Here's what I've tried so far: 1) ...
0
votes
1answer
43 views

Wordpress filter function using query modifications

I'm trying to build a filter function for the main query on a custom post type archive page. The custom post type is named "Hotel". For this custom post type i have a custom taxonomy named ...
0
votes
0answers
197 views

Passing multiple variables in wp_rewrite / wp_query

i need to be able to append a custom url for my page in wordpress so far i can get it to return the first query var, but i cannot get it to return the second or third im at a loss of what to try next, ...
0
votes
0answers
67 views

tag_slug__and not working as expected

I am trying to fetch all posts which has been tagged with particulars tags.here is code i am trying to use $args=array( 'tag_slug__and' => $categories_array, 'posts_per_page'=>10, // ...
0
votes
0answers
197 views

WP + woocommerce search with specific attribute

I have a problem. When I am adding a product in php code I need to check first if the product with the same code does not exists. I am using attribute in woocommerce and set new attribute code. In DB ...
0
votes
1answer
85 views

Find out if request is for custom post type archive before query runs

I am writing a plugin that is modifying the RSS2 feed for a podcast that uses a custom post type. After the query runs (on action hook template_redirect; See this question for why), I'm checking to ...
1
vote
1answer
103 views

How use %like% in sql statement wordpress

i use a like %text% statement in wordpress: SELECT * FROM location WHERE name LIKE "%on" OR name LIKE "%on%" i tried anything but it's not run: $wpdb->get_results($wpdb -> prepare("SELECT ...
-1
votes
2answers
118 views

query only direct child and sub-terms of a current term archive

i'm using woocommerce on my theme, and it comes with a proudct_cat term as a defualt catagory on the shop proudct. I need to show on every proudct_cat archive its direct child and the sub-tems, but ...
0
votes
0answers
234 views

Displaying database data as pages (or similar)

I have a friend that has a big database of cars (lets say 4000 entries). Now he wants to add this info to his website. Initially I played with the idea of creating a page for each car, but this ends ...
-1
votes
1answer
165 views

Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce

I have a shop page that displays a product (chairs) for a retailer in multiple cities. Each city is a tag for each product. What I want to be able to do is narrow down a category page like (chairs) or ...
0
votes
1answer
256 views

wpdb get_var is not returning any result (verified mysql query returns only one value)

I'm trying to modify a wordpress plugin to make it more adaptable for our needs. I have a custom user_meta called practice and we separate our users based on practice, so we need to separate quiz ...
0
votes
1answer
265 views

WP-Snap too slow (caused by WP_Query?)

I have a website with 10.000 posts... WP Snap alphabetizes the posts and puts it out with WP_Query, but it is slow as hell, which is very frustrating. My question would be: what can I do about it? ...
0
votes
1answer
1k views

WP_query parameters for date range

I'm using the events manager plugin to create custom posts for events. I do not have a need for a blog, so I modified my theme's index.php file (using a child theme) for its query to retrieve the ...
1
vote
1answer
6k views

Woocommerce custom loop to show all the products

I'm currently working on an e-commerce website and I met an problem. My client want a page e-boutique with all the product categories displayed, followed by 3 promoted products and a button "show ...
0
votes
1answer
246 views

WordPress Meta Query: Relation is not working correctly

I make a custom search box and let user do search. I have added required field to my editing panel by custom meta box. I have a post which have some meta data like London as place and 13021 as post ...
0
votes
3answers
76 views

Wordpress ultra slow if I click on posts?

I have 5000 posts on my website, which I have uploaded from a CSV file. This all went well and the website is fast on the back-end and frankly on any other page. There is one exception: if I click on ...
0
votes
1answer
385 views

Delete data from custom table when deleting a post

I want to delete post id form my custom table, when deleting a post. I have tried this way, nothing happened. Please help. add_action('delete_post', 'delete_data'); function delete_data($post_id) { ...
0
votes
1answer
340 views

Insert data in custom table during new post creation

I want to in insert data in my custom db table when creating a post. Suppose there are three categories (php, wordpress & jquery). When i create a post in wordpress, i want to insert post id and ...
1
vote
1answer
674 views

Combine two taxonomies in a hierarchical tree

For example, I have WooCommerce products that have taxonomies: brand (e.g. Converse, adidas, D&G) (taxonomy id: product_brand) category (e.g. Boots, Sneakers, Sandals, Heels) (taxonomy id: ...
0
votes
1answer
553 views

Display products from specific category in shop page

I know many people asked for this question but I didn't find a proper way to do it. How to add a simple meta_query (product_cat) before the execution of the shop page's query. Maybe by using a filter ...
0
votes
1answer
161 views

How to extract images of post and pages excluding header and logo image in wordpress?

I have tried this code to get all images from media library and i am sucessfully getting the source urls of all the images but now i want to exclude all the unwanted images like logo, header images ...
5
votes
3answers
1k views

Query Posts by Custom Field 'Price'

I'd like to display all posts within a given price range. For example: When a user inputs 100 and 1000 (in two separate form fields) - my site will display all posts that have a custom field called ...
0
votes
2answers
9k views

Show all products on one page with WooCommerce

I have WooCommerce running on this store. Although the default is to show 12 products on a page the client has asked for a "show all" button that will prevent the user having to use pagination to get ...
2
votes
1answer
1k views

Advanced Custom Fields query

I have, hopefully easy question. I have my query here, which is using ACF <?php query_posts(array('post_type' => 'our-clients-list', 'posts_per_page' => 1, 'order' => 'DSC', 'orderby' ...
0
votes
1answer
306 views

How can i list random post from multiple category?

I have an author page, and I want to list posts from current author's categories. e.g. I'm viewing John's page, and John wrote in Sport, Tech, News, Computer categories. Then my code list from this ...
4
votes
1answer
104 views

Tracing the life of a query

I can't find documentation regarding this - but is there a way to see how a query might bounce around from one filter to another? I've got a list of possible wp_filters and their relevance but I ...
0
votes
1answer
1k views

How to insert multiple postmeta values with one query?

I have a custom script/plugin I am using for myself that creates a post along with some postmeta information. Right now, I have multiple $wpdb->insert, but I would like to condense this down into ...
0
votes
2answers
80 views

Do not show a custom post if it belongs to a certain custom taxonomy

I am trying to block the visualization of a custom post, of type 'product', if it is assigned to certain values of the taxonomy 'product_cat'. Strictly speaking, I would like to block the ...
0
votes
1answer
94 views

Making a Custom Post Type Publish Loop

I want to re-publish all previously published products of a custom post type. Let's say the post type is "events" This is what I was thinking something like this: $args = array( 'post_type' => ...
0
votes
1answer
251 views

Include subtitle display to slideshow

Thanks to Author for this plugin. But There is no option to display subtitle. There is only 2 options - Title and excerpt. Help me change excerpt to subtitle. I use this function to display subtitles ...
0
votes
1answer
392 views

Replacing global wp_query

I have a site that uses a custom query to search for posts by country. The search results come back fine, but the pagination at the bottom reflects the total number of posts in the site, instead of ...
1
vote
0answers
376 views

How to order posts by meta_value and title

How do you order products in WooCommerce so that products are random, but at the same time featured products show first? Here is my code: $args = array( 'post_type' => 'product', ...
0
votes
1answer
66 views

Checking url from plugin

I'm trying to change the login url from wp-login.php to simply 'login'. I'd been looking through another plugins source to find ways of doing it. Some of the applicable parts that I've got so far: ...
1
vote
1answer
281 views

switched from query_posts to WP_query, not working now?

So I had asked (in retrospect a pretty non-question) at A little help/cleanup from a real coder? and one of the comments was to not use query_posts and instead use WP_Query. So I did a little digging ...
1
vote
1answer
458 views

how do i remove posts from a WP_Query so the pagination is right?

I'm using a custom post type and showing 20 of them per page on the homepage. I'm using QP_Query. One custom field for the custom post type (called mixtapes) is a checkbox called "unreleased" (set ...
0
votes
1answer
188 views

Pagination not working

$paged for pagination is awlays returning 1, so no matter what page i click "1" is always highlighted and it always shows the same posts. i have tried a million different combinations of things to fix ...
1
vote
1answer
485 views

AJAX search posts and pages

Im trying to make a plugin where i need to create an AJAX search. Im using the method described in http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ to perform the ajax calls. So far ...
1
vote
1answer
498 views

Thumb rating for wordpress - top user

I am currently using gd star rating (thumb rating) to rate posts (articles - no rating on comments). What I really want to do is show a table of the top 5 users and their number of votes based on the ...