Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [meta-value]

The tag has no usage guidance.

0
votes
1answer
16 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
17 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
31 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
106 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 ...
1
vote
1answer
131 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
82 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
99 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
187 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
51 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
378 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
0answers
76 views

Insert meta_key and meta_value via sql in CUSTOM POST TYPE

I did this query to find all post that are inside a custom post type and not have 'mymeta' meta_key. So I want to add this meta_key and 0 to meta_value on all this post. SELECT P.post_title,P.ID FROM ...
0
votes
1answer
43 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
36 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
30 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
38 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
22 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
35 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
54 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 ...
0
votes
2answers
130 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
84 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
975 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
279 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
27 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
283 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
502 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
53 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
2k 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 ...
2
votes
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
629 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
90 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
125 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
35 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
136 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
289 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 ...
0
votes
1answer
358 views

pre_get_posts : only get posts by wp_usermeta value

I've added a meta field on my authors (company). How can I only display the posts written by authors with a specific company value (company1 or company2 for example)? I would like to do that within ...
0
votes
1answer
14k views

Using get_terms() with meta_query parameters

Im trying to build a taxonomy query to only display the terms that have a certain custom field value assigned to it. The custom field holds a boolean value, so I tried: $args = array( '...
0
votes
1answer
633 views

How to display checkbox meta array values one by one?

By wp user frontend I add some checkboxes to users frontend profile. When I use echo get_the_author_meta('my_pet', $author_id) output is: cat| dog| hamster And when I use this loop code $pet = ...
1
vote
1answer
801 views

new WP_Query to get max price meta value not working

So, I'm trying to get the maximum price of all 'properties' (custom post type). $max_price_query = new WP_query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'post_type'...
0
votes
1answer
67 views

Add estimated value for a post according to the number of words

I have a blog where paid by 2 cents per word, need to add next to the word count one text value of statistics. Anyone have any idea how to make this automatic multiplication along with the word count?...
0
votes
1answer
226 views

query post by author gender

I'm using utimate member plugin on my website. for each member (author), I have a field to store the member gender. (Homme / Femme). the data is stored in my database, inside wp_usermeta. meta key ...
4
votes
2answers
104 views

Building a scalable Wordpress favouriting plugin - one serialised meta value array or many meta records

I am trying to build a simple Wordpress favourite post plugin that is scalable and could handle 1000s or 10000s of users or more. There are several different approaches that I have seen in other ...
0
votes
1answer
256 views

How to sort by meta value num, but ignore zero value?

I have custom-post-type company and taxonomy services for this CPT. I have created meta-field service_[id]_price for companies and fill this field with a number. If this company has not price for this ...
0
votes
1answer
694 views

Query posts according to specific post meta values

I have a loop in my index.php for my home page like this... <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> I have a function to query the posts by ascending ...
0
votes
1answer
542 views

Display Content Based on Custom Field Value

I have the following code which is trying to show an image based on the value selected from a custom field in the admin screen. <?php if( get_field('bias') != 'Neutral' ) { ?> <img src="...
0
votes
1answer
93 views

Plugin Shortcode value in post

Theme was output with function get_post_meta(get_the_ID(), 'some_value', true); when I try with die(print_r()); function there have some array containing values such as [item_ticket_tailor] => ...
2
votes
1answer
1k views

How to get user_meta value for new user regsitered?

We have a customized the registration process. Users register themselves. When a user registers, some meta values are updated based on the $user_id. Now we need to send an email. We have used action ...
1
vote
1answer
61 views

Sort meta-value in the sequence array in pre_get_post

I am customizing the display of posts in a category with pre_get_posts and meta_value . Each will receive a meta_value posts and wish them to be in the order of the array. I want it that way ( 1 ) ...
1
vote
1answer
582 views

Custom field value not saving when it contains a URL?

I implemented a custom field into one of my post formats called 'url'. When I enter a random string of characters into the field, it saves just fine and I display it in my template like this: <h2&...
0
votes
1answer
340 views

How to fetch meta_value and meta_key in matrix after ajax request by post_id

Well, I have 2 custom post types: A = Properties B = Property Owners Inside CPT Properties, I was created a Meta Box to: Search a registred Owner (CPT) by VAT number (CPF in Brazil) Relate Owner ...