Questions tagged [meta-key]

109 questions
0
votes
1 answer

Combine meta values into a new key (PHP/WordPress)

Here's what I need to do, in laymen's terms: For each wordpress user, find every meta key that starts with "FOO_" then combine all the meta values into a new key named "FOO_COMBINED" My question refers to WordPress, but I think applies generally…
LBF
  • 1,133
  • 2
  • 14
  • 39
0
votes
0 answers

Wordpress meta_key with checkboxes

I have a custom post type which contains a checkbox group "areas" which allows the user to select multiple areas covered by their service. On the frontend, I have a custom search query in place which allows the user to refine by basic criteria. It's…
Graham
  • 162
  • 1
  • 16
0
votes
1 answer

WP-Query | Order a query two times by different custom field values

I've been trying to pull the query off but I can't manage to do it. I want to query all the post in the category 'locales'. Then sort them by custom field value 'provincia', and then sort them by custom field value 'localidad'. I dont know if I'm…
Mr. G
  • 101
  • 5
0
votes
2 answers

WordPress - List Custom Type With Specific meta_key value

So I have the following SELECT wp_posts.ID, wp_posts.post_author,wp_posts.post_date,wp_posts.post_content,wp_posts.post_title,wp_posts.post_excerpt,wp_postmeta.meta_value FROM wp_posts INNER JOIN wp_postmeta ON wp_posts.id=wp_postmeta.post_id WHERE…
pee2pee
  • 3,619
  • 7
  • 52
  • 133
0
votes
1 answer

WP_Query Alter archive page Query

I have a scenario where i want to get featured property first then other properties which are not featured. I have saved a meta_key with _property_featured with 1 if the property is featured. For this i'm using pre_get_posts hook, here is the code …
Touqeer Shafi
  • 5,084
  • 3
  • 28
  • 45
0
votes
1 answer

mysql query doesnt work

I have a problem with a query in mysql. It's from a wordpress blog and a try to set the title of each post als meta_key and meta_value INSERT `wordpress_postmeta` (`meta_id` ,`post_id` ,`meta_key` ,`meta_value`) VALUES ( '',`ID` ,…
Joern
  • 3
  • 1
0
votes
0 answers

Wordpress wp_query and custom fields

I have a category, where posts are listed by this wp_query: 'post', 'stage' => 'process', 'paged' => $paged, ); $query = new WP_Query(…
0
votes
2 answers

Sort events using date, month, year values using meta_key and meta_value

I need to sort upcoming events ascending from today, and then past events descending from today. This is what I have so far, but I'm not sure what to set the meta-key as to make it the date sorting work (or could the meta_value be wrong?). The date,…
0
votes
2 answers

Order post by meta value

I have a custom post type called: business, each post has a metabox with meta key country. I want to order posts by meta value and only display 3 posts for each meta value: New york: post title has meta value new york another post title has meta…
user3137766
0
votes
1 answer

how to get postmeta key value for all post?

I want to get post_meta value of all the posts. For the database table wp_postmeta, I want to get meta values of key '_job_hourly_fee' for all the posts, not only single post. Don't know how to do. thanks in advance.
Riz
  • 185
  • 3
  • 7
  • 14
0
votes
1 answer

What is [@requested = 1] in a meta tag?

I found a snippet of code on a website that i have never seem before. I searched and couldn't find an answer for it, and even tried contacting the webmaster... So lets see if someone here can. It is a meta tag that says "seo/seo[@requested =…
0
votes
2 answers

Wordpress WP_Query with meta_query get values by Like

I'm building a custom search. On this i'm trying to get posts where the searched text should be used as a wild card to compare within 2 meta_key. Below is my code, 'registration', …
Vin_fugen
  • 581
  • 3
  • 19
  • 38
0
votes
0 answers

get_user_meta returns value twice

I have a very simple function that grabs a user's uploaded avatar from usermeta in order to resize it, however, the value is returned twice? I can't for the life of me understand why. $img = get_user_meta($user_id,'user_avatar',true); print_r…
0
votes
1 answer

How to customize the search.php in wordpress so it can search the keyword in meta keys too?

I am trying to customize the search.php in a way so it can also show the posts which has search keyword in meta key values. Please note: I am using Advance Custom Field Plugin which uses meta keys. For example I have a meta key called "treatments"…
Imran
  • 1,094
  • 1
  • 21
  • 41
0
votes
1 answer

wordpress dont show post if no custom field value

I am trying to hide posts in a loop which has NO custom field value present, this is what I am doing, but it doesn't show any post at all.. http://pastie.org/8082255
Patrick S
  • 87
  • 5
  • 11