Questions tagged [meta-value]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

How can I convert postmeta from unserialized to serialized?

I'm replacing 2 fields that were previously set up with ACF and saved separately. Instead of those, I want to have 1 piece of serialized postmeta. So, I'm going from meta_key: old_key_1, meta_value: ...
0
votes
2answers
20 views

Find a way to retrive data updated through metabox plugin to web page

I developed a customer metabox plugin to save user details to db and retrieve them back to Contact Us Page in my website. But I searched a way to retrieve the data to contact us page and I couldn't ...
1
vote
1answer
26 views

Need wp_query to return all children and grandchildren

I am working on a site with three different main 'topevel' sections, that act as the top level parents of the site. Each toplevel section has children and grandchildren, and there needs to be a ...
1
vote
1answer
12 views

OG Meta Tags not being scraped by facebook or twitter

When trying to share a blog from my wordpress website on social media, (facebook, twitter), there is no URL preview card. No picture, no description, nothing. I installed yoast seo plugin on my ...
0
votes
0answers
17 views

Meta_query on same meta key, with diffrenct values

i'm trying to get_users with the meta_query where i need to find users where either they don't have the meta key, or it is blank. It seems like everywhere i look, i should be able to use the OR on ...
0
votes
1answer
16 views

Prepare WPDB with meta key and meta value

I'm trying to prepare WPDB by post type, meta key, and meta value global $post; global $wpdb; $rid = absint($_POST["rid"]); // number $last_id = absint($_POST["lastID"]); // post ID $query = $wpdb-&...
0
votes
0answers
9 views

Sort query by title in meta value stored as id

How can I sort a query alphabetically by meta value where the meta value has the id of a related post and not its title? I have two custom post types: news and companies. Each post under news has a ...
0
votes
0answers
61 views

Get meta_value from GDRating

I am trying to get meta value from GD Rating table for each post ID with following sql: $querystr = "SELECT meta_value FROM $wpdb->gdrts_itemmeta WHERE meta_key LIKE 'stars-rating_rating'"; $...
0
votes
1answer
42 views

How to get string from add_theme_support('title-tag') for meta tag and beautify?

It recommends that we should use add_theme_support('title-tag') for displaying blog title. However, I also need to get the title as string for another purpose. It's for optimizing SEO. As you already ...
1
vote
1answer
25 views

How to change image atributes right before an image to be saved?

I have an installed plugin to import XML content, but it can't change some meta-data of the new image that will be saved. For example, I'd like to intercept the action of saving an image BEFORE its ...
0
votes
1answer
90 views

REST API and filtering by meta value

I have a posttype 'timeslip' and I am calling this with the following API endpoint: /wp-json/wp/v2/timeslip?meta_key=user_id&meta_value=1 I have exposed my custom field user_id to the API meta ...
0
votes
2answers
36 views

How to update a custom field in all posts with the value of another custom field in the same post?

I try to get the value of the source field 'enddate', save it in the variable $enddatevar and write it in the target field 'promote' in the loop by activating the plugin, but the code I added to this ...
0
votes
1answer
70 views

meta_query check for meta value in key which holds an array of values

In every post of my custom post type called "announcements" I save the users' ID inside an array which resides in a meta_key called "post_is_read" whenever a user reads an announcement. Just to ...
0
votes
1answer
12 views

how to SELECT meta values that are not null?

I have a rating system for our products but there is an issue: by the code, that will SELECT all comments in commentmeta table that have rating as meta_key. even those who do not have a rate (the ...
0
votes
1answer
14 views

How to get all multi-select user meta values and add them to an array?

I am trying to grab meta_values from a user profile's multi-select field, and convert them to usernames, which I will then input into an array. Let's say that the user has selected two options (out of ...
0
votes
1answer
229 views

Wordpress meta query with meta serialized data array value

Looking for a method to nest AND/OR relation in meta_query based on array serialized values. Reviewed these already: Query multiple meta key values? WP Meta Query for some meta (array) values I ...
0
votes
1answer
27 views

Reading Content in an Array as it relates to a meta_query

I am capturing a user's Work Anniversary and their content is being stored in an array. So the key as it relates to these Meta Fields is hire_date and the value that is stored in that array looks ...
0
votes
1answer
106 views

how to change value return by _stock_status

i am finding how to change the value from _stock_status on single product. I have display the product stock status by that code: <?php echo get_post_meta( get_the_ID(), '_stock_status', true ); ?&...
2
votes
1answer
169 views

meta_query works locally but not on live server

I'm filtering posts by author's last name initials. On my local server, the query runs beautifully, but when I push live, it doesn't. It doesn't find anything. Does it have anything to do with the way ...
2
votes
1answer
260 views

Ordering Posts Type A by Custom Fields of related Post Type B

I'm not sure if this is even possible (also posted to ACF forum https://support.advancedcustomfields.com/forums/topic/ordering-by-custom-field-of-relationship-field-object/#post-62454) I have two ...
0
votes
3answers
159 views

How to add custom filed value after in wp post title

(WP Post Title)Malwarebytes Anti-Malware (Custom field value)3.5.1.2522 How to add custome meta value in wordpress after wp post title in same hyperlink
0
votes
1answer
320 views

Do comparision after updates hooks of acf-fields?

I have this code: public function init() { add_filter('acf/update_value/name=bookitall_fromdate', array($this, 'check_bookingdates' ), 10, 3); add_filter('acf/update_value/name=...
2
votes
1answer
345 views

Autoprediction / Autocomplete Search with Meta Keys

currently I am stuck with my real estate search. What I am trying to do sounds pretty simple: I have one field in a search form. I want that field be able to generate auto suggestions / auto complete ...
1
vote
2answers
74 views

What Wordpress function to use to get meta value by using meta keys?

This is the code: if ($keys = get_post_custom_keys()) { foreach ((array) $keys as $key) { $keyt = trim($key); if (is_protected_meta($keyt, 'post')) { continue; ...
0
votes
2answers
640 views

Sortable Custom Columns not sorting correct

I am using the code below to sort code as per meta_value. But in this specific Column I have dates displayed for example: 20 April 2018 or 01 June 2018 The sorting works sort of but now when I order ...
0
votes
1answer
105 views

Using Orderby and meta_value to order natural/alphanumerical

I added a custom column for a custom post type. Then I put it to be the 3th column, and now I want to sort it alphanumerical. I use this action : add_action( 'pre_get_posts', '...
0
votes
1answer
71 views

Print specific values stored in a post meta array

I'm triing to print some values stored in a post meta. My post meta_values looks like this : a:3:{s:6:"amount";s:117:"€2.00";s:6:"entity";s:5:"11854";s:9:"reference";s:9:"800146779";} I'm ...
0
votes
1answer
35 views

Multiple meta key and value search in the query

I am have this following API code for $_REQUEST $metakey = explode(',',$wpdb->escape($_REQUEST['key']) ); $metavalue = explode(',',$wpdb->escape($_REQUEST['value']) ); $meta = ...
0
votes
0answers
39 views

Loop random posts and display odd and even based on two alternating meta values?

I have a CPT containing an ACF select field for gender values Male or Female. I need to to display 6 random posts AND they need to be ordered so the odd posts are female and the even posts are male. ...
1
vote
1answer
42 views

How to extract specific post

I've to extract only the posts where the meta_value does't contain some specific string. I use this code: $query = new WP_Query( array( 'post_type' => 'estate', '...
1
vote
0answers
52 views

WP Query sort by meta value

I would like to get posts order by timestamps. I have to following code but the query keeps getting posts order by modification dates and not with the "evcal_srow" meta. Any clue? <ul class="...
0
votes
1answer
68 views

Get the total Author Favorited posts

I am using the plugin https://favoriteposts.com. To be a little clearer I have posts on my site that have a favourite count as a meta value. I want to get the total favourite count of all posts ...
1
vote
1answer
2k views

Seach custom post type posts only by meta fields?

is it possibile to search custom post type product by _sku or other custom meta field with input text field? I don't want to use plugin, just need custom WP function. I have found this solution for ...
0
votes
2answers
398 views

Check for custom field value in different post type than current one and do something

I have 2 post types, one is for my posts and the other one is used as a submission form. When a user is on a single post page for post type A, I am trying to do several checks to then display ...
0
votes
1answer
215 views

Gather same custom field values in one value in a select tag with wp_query

I am trying to gather specific information in a select tag in order to filter pages. A have several training pages with same prices (for instance : $80, $120, $500, etc...). The problem is when a ...
1
vote
0answers
1k views

How to pull email and name from Flamingo plugin

I am trying to pull the name and email from the database and show on the front end of my website. I tried many scripts and looked on the flamingo forum as well. But couldnt find a solution. All the ...
0
votes
1answer
469 views

get value from selected input

here is my situation, I have different input, each of them them having a <input id="q1a2" type="radio" name="q1" value="1" tabindex="-1"> <input id="q2a1" type="radio" name="q2" value="3" ...
0
votes
1answer
28 views

Is it safe to add a new field to meta_value field?

I'm trying to offload Wordpress images from my web server. I've successfully moved everything over to Amazon AWS and have a syncing mechanism in place that uploads new images to AWS. Now I would like ...
0
votes
1answer
395 views

Create Shortcode shows only posts with custom_field meta

I want to create a shortcode, which shows only the posts that have the definite meta_value. I use the ACF Plugin for different meta-fields. I have the post type "publication" and e.g. want to show ...
1
vote
1answer
659 views

How to wrap meta values seperated by comma in <span>? [closed]

I was able to display the single value of my custom meta field with comma separated using this code: $ct = get_post_meta($post->ID, 'ct', true); echo $ct; And here's an output: USA, UK, China, ...
0
votes
1answer
64 views

Can't get meta values to save

I'm trying to write a class to make meta boxes. The boxes display fine, but I can't seem to get the values to save. It seems like the Save function isn't being called at all. As a further experiment,...
0
votes
1answer
4k views

Assign/update the custom field value for all posts

I have over 1000 posts. Each post has a custom field XYZ. I'm looking for a function that I can run once that will assign a value of 1 to each of the posts' custom field XYZ. I've had a look at this ...
1
vote
0answers
20 views

Individual post. Meta_key, taxonomy or post status for separation?

I have a posts with custom type - TOUR. Among ordinary Tours sometimes I need to create "personal" or "private" Tour, which will be shown only to assigned user. What the way is better to exclude this ...
4
votes
2answers
836 views

Custom WP_Comment_Query with pagination and orderby?

I'm trying to setup a custom WP_Comment_Query which is ordered by a meta key. (It might be worth mentioning that these comments are being retrieved with AJAX.) It all works fine, until I add in ...
0
votes
2answers
114 views

Sending new registration meta values to admin by email

I've created a custom registration form which accepts extra fields like mobile number, address etc and stored into user meta values. This is working fine, now I have to add a functionality of sending ...
0
votes
1answer
162 views

4 Unique Random Posts based on Custom Field Values

I'm trying to display 4 random instances of a custom field from random posts without repeating the custom field. In other words, it's okay to get several custom field instances from one post, but not ...
1
vote
1answer
36 views

Removing link '<a>' from '<li>' on meta_value in custom feilds

I want to remove all links on my custom fields. My fields for now : <li><a href="">my item</a></li> and I'm trying to get this: <li>my item</li> This is the ...
0
votes
1answer
194 views

Multiple Meta_values

As you an see I use a get_pages() function and it all works fine. $city_ids = get_pages(array("hierarchical" => 0, "sort_column" => "menu_order", "sort_order" => "desc", "meta_key" => "...
0
votes
1answer
31 views

Filter between Custom Posts depending on meta_value

I have a custom post type annual_events with 'meta_key' => 'school' and a 'meta_value' => 'primary' or 'meta_value' => 'secondary'. So there are Annual Events which can belong to a Secondary ...
0
votes
1answer
399 views

Order posts by more than one variable (meta_key and publish date AND time)

At cascadeoc.org/results I have results sorted by a Custom Field, "event_date_results" which is the date the event happened (not the date the post was published). However, when there are multiple ...