Tagged Questions
0
votes
1answer
20 views
How to add a prefix to existing custom fields over MYSQL query?
I've got the problem that after a plugin update I can make the custom fields on our directory site searchable, but only custom fields which get the prefix booking_ to them.
Now there are some pages ...
0
votes
0answers
32 views
List number of posts with a specific meta_key for each meta_value
I would like to list my posts by a specific custom field. At the same time, for each custom field, I would like to count the number of posts with a specific custom field value.
I have a custom field ...
0
votes
0answers
20 views
Complex WP_Query Using Post Date And Post Meta
I am using Wordpress as a CMS on a website which has standard posts, a custom advert post type and a custom event post type. The event post type has some custom meta which stores the event start date.
...
0
votes
0answers
12 views
sequnce in enter words in wordpss search using query
I have a problem in creating advanced search with custom query and using $wpdb->get_results($query , OBJECT);
In Normal search in wordpress when we search xxx yyyy or search yyyy xxx we have same ...
0
votes
1answer
138 views
Upcoming Event: How do I sort database by custom date field, but ignore past dates?
I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do:
Query the "events" custom post type ...
0
votes
2answers
59 views
How to exclude custom fields from search queries?
I'm building a hotel search engine and I've first created a custom content type "hotel" with Types & Views Toolset. I'm using "Search everything" plugin to query custom fields and custom taxonomy ...
0
votes
1answer
138 views
query posts and custom post type with meta key
I'm trying to query all-in-one-event-calendar's custom post type ai1ec_event and normal wordpress posts in a slider on my home page. That works pretty well.
Now I want to query only the posts with ...
1
vote
1answer
214 views
Trying to reorder posts by custom field
I'm running WooCommerce and am trying to get the default product display to be sorted by the sku field in ascending order. So far I've come up with this:
/* Order products by SKU */
function ...
0
votes
1answer
174 views
WP_Query () using taxonomy, custom post types
I want to implement this query using WP_Query().
SELECT *
FROM wp_posts as posts
LEFT OUTER JOIN wp_postmeta as postmeta
ON (postmeta.post_ID = posts.ID)
LEFT OUTER ...
0
votes
1answer
152 views
Loop to display random posts only if a custom field matches category
Working on a website and need loop that will show posts ONLY if custom field value is equal to the current category name.
I have category 'fun' and custom field 'genre'. I would like to show on ...
0
votes
1answer
521 views
$wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
I have a custom post type 'event', a custom meta field 'event_date' and a custom taxonomy 'locations'.
I want to query $wpdb to retrieve posts in this way
posts must be of the 'event' post type
...
1
vote
1answer
57 views
Limits, not all post are showen when querying for posts by view count
I'm having some difficulty getting a loop that gives me post by most viewed.
I started by following this tutorial
...
1
vote
0answers
58 views
Why orderbyb meta_value_num won't affect the generated SQL Query order?
I've exhausted myself with this and I couldn't figure out why when I do this
$myposts = new WP_Query( array('numberposts' => 5,
'offset' => '0',
'post_type' => 'noticias',
'orderby' => ...
2
votes
1answer
35 views
How do I query for a post by custom field?
I have a custom field called "song-id" and I'd like to lookup a post by a song-id value. Can someone give me the code snippet for it?
(bonus: also looking for a code to use the permalink in the post ...
5
votes
5answers
697 views
How can I make wp-pagenavi work on a custom query built upon a form submission?
I've also posted this on the wordpress support forums, for scribu's wp-pagenavi plugin:
http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1
My situation:
...
1
vote
1answer
349 views
Sort posts based on multiple custom fields
I have a three custom fields
Meta Key → YOUR_PREFIX_newcar_body_type
Meta Key → YOUR_PREFIX_newcar_transmission_type
Meta Key → YOUR_PREFIX_newcar_variant
and I have to sort posts ...
0
votes
1answer
84 views
Get post ids sorted by meta_key
I have defined a post_view_count meta_key to store the number of post views.
I would like to get an array of post ids sorted by post_view_count value to use in the
functions.php file.
Thanks.
0
votes
1answer
50 views
How to query for posts with either one or another custom field
Need help querying for posts with either one or another custom field.
Not sure how to use the 'or' operator here, but something like this the blow -
Have tried these:
...
0
votes
1answer
128 views
How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
I need to know the most efficient method to grab 3 pieces of data from from multiple posts:
Post title
Thumbnail
Custom Field
I am attempting to build a Google map of posts using data stored in WP ...
0
votes
1answer
70 views
Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
I´m building a real estate site where Estates is a custom post type. I want to be able to tick a checkbox or something similare on the edit page, where I can choose if the estate is for rent, if it ...
0
votes
1answer
308 views
Custom Query: query by post custom meta data
So I have a custom post called event, but I need to query only those posts which have a custom metabox(is a checkbox) called `Show On The Homepage: and only if that checkbox is checked.
<?php
...
0
votes
1answer
312 views
Get array of posts based on custom field values
I'm looking to pull up an array of posts based on custom field values:
function GetPrimaryLinks($product){
echo '<ul>';
$args = array(
'product' => $product,
...
0
votes
1answer
199 views
How to check if custom field exists in this widget query
How can I include this (or something similar)
<?php if ( get_post_meta($post->ID, 'url', true) ) { ?>
<a href="<?php echo get_post_meta($post->ID, "url", $single = true); ...
0
votes
1answer
221 views
query usermeta from custom field
I am using a plugin to create custom fields in the user registration.
I have created a check box field called g300 which is the name of the meta_key stored in wp_usermeta.
It looks like the value ...
1
vote
1answer
1k views
Meta Query with AND & OR?
I'm trying to do some filtering for some posts in WP_Query, but I can't seem to get the right condition. Basically what I wanna do, is get posts that have the custom field event_data (sorted by this ...
0
votes
1answer
184 views
How to query an out put value?
I have this custom query that Im working on and I need to be able to query output values as well as actual stored values.
Example:
$string = "This is #*&^% a test";
$string = ...
0
votes
1answer
233 views
Only show content slideshow if “slideshow” custom field exists
I am developing a theme for general release and there is a large content slideshow on the homepage.
I have included a checkbox meta box in the post edit screen that allows users to determine which ...
1
vote
3answers
171 views
query in category.php repeats itself
I'm need some help on my query.
I'm building up a category page where on top a post need to show where custom field key 'uitleg' has value 'ja'. Per category there is only one post with that value. ...
0
votes
2answers
389 views
How to rename a custom field?
I have 3000 posts with that custom field name 'refer' and i need to change it to 'ref' for theme needs, instead of doing it manually i need a query or technique to change them all.
Question 1
I am ...
0
votes
1answer
510 views
Searching with Multiple (Parallel) Criteria on Custom Fields?
I'm just an basic Wordpress user. I need to make search box with multiple criteria inputs (multiple conditions) to search inside various Custom Fields.
For example including following Custom Fields:
...
0
votes
1answer
532 views
How to query posts by month based on date custom field?
I currently created a custom field for a custom post type that stores a date in the format dd/mm/yyyy is there a way to query the posts by the month?
I "kind of" got the functionality I need using ...
0
votes
1answer
82 views
querying a custom field
I'm trying to hack a plugin to show the contents of a custom field where its currently showing the title.
how would I get this to show a custom field called restaurants instead?
Thanks,
...
1
vote
2answers
313 views
Conditional custom field query
I'm working on a job board-type site, and the client want to sell featured posts. They want the featured posts to expire from showing up in the "featured" section after a predetermined period of time, ...
0
votes
1answer
116 views
Query pulling a single post per month
I am trying to only show a single post per month on a query.
I can set the date as a variable and use something like the php array_unique function to check the dates and only echo out unique ones, ...
2
votes
1answer
335 views
Plugin similar to Taxonomy Drill-Down for custom fields?
Is there a plugin available that does for custom fields what Scribu's excellent Taxonomy Drill-Down (formerly called Query Multiple Taxonomies) does for taxonomies?
1
vote
2answers
584 views
Count how many posts have a custom field set
I've added some code to my templates which automatically adds custom fields to cache some data that each post pulls in. Is there a way that I can track how many posts have had this custom field set?
-1
votes
1answer
907 views
WP insert post PHP function dynamically generated Custom Fields
Further to my previous question WP insert post PHP function and Custom Fields
We have a working insert post function that can also send over custom fields without yet knowing the ID. Please see the ...
0
votes
2answers
287 views
How to get events using multiple custom meta fields?
I need to grab a list of current events. The events have a start and end date so I need to be able to select a range as opposed to just getting any list of events that have an end date that is after ...
0
votes
2answers
512 views
Custom Field Date Problem
I have a custom field called expiry_date with a value of let's say 2010-12-11 00:00:00.
What I would like to do is, in my query loop, only return posts with this expiry_date custom field attached to ...