0
votes
2answers
38 views

w3 total cache and post__not_in

I'm using a modified version of the Recent Posts plugin together with WP Total Cache. I'm using post__not_in as I don't want to display the current post again. It works well, but if Object Cache is ...
0
votes
1answer
25 views

Meta query for comparing two dates

I want to list all users who registered in between the $start_date and $end_date.I have written a metaquery,but it returns empty.Please help. $start_date = 2014-08-16 09:28:17 $end_date ...
1
vote
1answer
28 views

How to create a custom shortcode based on the layout?

Hi I am developing a custom post type plugins. Which has shortcode support. Already i have created a shortcode which is going to use for default layout design. Again i have to create a onemore ...
1
vote
1answer
58 views

Using AJAX to generate front end / viewer end pages

I am currently trying to send certain data via POST method from code in the widget of my plugin to the theme's archive.php page. The code that contains the data for jquery/ajax is : <a ...
0
votes
1answer
26 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
110 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
19 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
32 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
57 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
286 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
88 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
35 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
124 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
255 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
65 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
22 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
192 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
46 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
1answer
89 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
119 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
135 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
260 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
200 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
282 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
268 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
2answers
8k 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
259 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
79 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
449 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
354 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
759 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
729 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
178 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
2k 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
11k 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
2k 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
336 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
106 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
82 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
95 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
257 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
453 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
389 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
68 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
285 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
497 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
199 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
529 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 ...