Questions tagged [meta-key]

109 questions
2
votes
1 answer

Magento search by using meta keywords

In my magento store need to make some modifications. I have a shop by list using meta keywords and also want to search the meta keywords in the top search bar. The product search works well. I want to implement the meta keyword search in the top…
Prabhu
  • 1,127
  • 1
  • 13
  • 30
1
vote
2 answers

wordpress $query->set to sort archive product pages, by *manipulated* ACF meta key value

I am trying to use the pre_get_posts action hook to sort products by ACF field for archive product pages. The ACF field is a string, that contains characters and numeric value My solution: to add missing leading zero's so that '040' < '180' will…
Mulli
  • 1,598
  • 2
  • 22
  • 39
1
vote
1 answer

Wordpress archiv loop with meta_key

i have a problem and can't find a solution. I would like to query in the normal Wordpress archive loop whether a certain meta key is available. This works with the following code, but then it shows me all posts with the meta key from all…
Bird
  • 21
  • 3
1
vote
2 answers

meta_query search names when they have middle initials - PHP, WordPress

I have to build a search form where I search members of the company by their Full Name (First Name + Middle Initial + Last Name). All the names are in this form: John B. Doe. The below code is working on these cases: John, John B., Doe, B., John B.…
ah92
  • 307
  • 5
  • 20
1
vote
1 answer

What is the meta_key for user registration date in WordPress?

I am pretty new to WordPress. I am setting up a profile page in WordPress, and I am trying to display the registration date using the meta_key in the profile page to show the date the user joined. What is the meta_key for user registration date, if…
Seesharp
  • 333
  • 2
  • 10
  • 24
1
vote
1 answer

get_users with a value in an array of meta_value returns empty array

I'm trying to query WP users that have the current post's ID saved in a meta_key (training_event_attending) with an array of values. When I do a print_r on the current user's training_event_attending where 10, 11 and 12 are the correct post IDs…
DakotaDC3
  • 67
  • 10
1
vote
0 answers

Meta Key on Windows 10 for R Command line editor

I am using Windows 10. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 15063) Matrix products: default locale: [1] LC_COLLATE=English_India.1252 …
Sowmya S. Manian
  • 3,723
  • 3
  • 18
  • 30
1
vote
1 answer

Wordpress Advanced Custom fields loop with multiple meta_value

I am running a loop which requires content from multiple meta_values. I have a meta key called 'content_type'. Attached I have three meta_values for the key. My code...
lowercase
  • 1,198
  • 9
  • 34
  • 56
1
vote
1 answer

WP query - sort by meta_key if exist, else title

I'm trying to get list of custom posts ordered by numeric meta_key first if such key exist, and than if there is no key, continue order by title. I mean: AObject (object_order => 1) FObject (object_order => 2) BObject (object_order => 3) AObject…
Denis Kirin
  • 11
  • 1
  • 4
1
vote
1 answer

Custom Field Filter by Role - Wordpress

Created a custom field and selected Filter by role "Subscriber" and assigned the custom field to the post type. Now when I add new post and assigned the subscriber (ie: Test Post and assigned the subscriber "grade 1") after I click on the update…
1
vote
1 answer

Wordpress Usermeta Select multiple keys and values

trying to retrieve all user_id's where those user_id's meet a 3 criteria. the code I have is $sql = " SELECT user_id FROM {$wpdb->usermeta} WHERE (({$wpdb->usermeta}.meta_key = 'job_title' AND {$wpdb- >usermeta}.meta_value = '".$job_title."')…
David
  • 31
  • 6
1
vote
1 answer

WooCommerce costum meta_key

I would like to add a custom meta_key value to each WooCommerce product It will be the Discount rate : _discount_rate = ((_sale_price-_regular_price_)/(_regular_price)*100) I'm trying to figure out how to add a filter to WooCommerce function…
1
vote
1 answer

How do I query posts and use the 'orderby' attribute to order posts in loop according to date 'meta_value'?

I am creating a website for a theatre company, and I am creating an index of all past, current, and future productions. I would like the index to 'orderby' the ending date of each production (ACF 'date' field type; 'ending_date'). Here is an example…
1
vote
1 answer

How can I get all pages that contain the same meta key?

I want to grab all of the Wordpress pages that include the meta key 'basePrice', regardless of the meta value. When I try to do a simple get_pages(), an empty array is returned. Acording to the Wordpress docs, it states that meta_value requires…
Lee
  • 4,187
  • 6
  • 25
  • 71
1
vote
0 answers

WP Query - sortby with comma in number

I'm trying to sort a query of product custom post type, ordering by the product weight (ASC - from lightest to heaviest). The product weight is entered in a Advanced Custom Fields "field" on the product edit screen. The query is working fine,…