Custom Fields are fields that can holds arbitrary extra information known as meta-data.

learn more… | top users | synonyms (2)

0
votes
1answer
25 views

Display post from a date range from custom field

I currently have a custom post type that has two major custom fields that are need for the query. The 'score_time' field stores time of a score. Example: 12:20 The 'score_date' stores the date the ...
0
votes
1answer
33 views

Query Multiple meta

Hi i've looked through the forum but can't seem to find the right solution to what i'm looking what we have is a property website and have various pages setup to show specific types of properties ...
0
votes
0answers
21 views

Can't pick up a field created with Advanced Custom Fields

I have a situation where: I need to create a custom link per image on an image gallery. I did that via ACF. I have created a text field with HTML outputing so that hyperlinks get converted ...
0
votes
1answer
31 views

Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date

I have a custom post type – “members”. With help of Advanced Custom Fields(AFC) I’ve created a Field Group with 5 fields and assigned that group to my “members” post type. I followed this article to ...
0
votes
1answer
24 views

Need some suggestion/help with custom post types project

i am working on some project where i have custom post types for management courses. I have create new roles (for users) : teacher and student. Now the quasions is what is the right way to assign one ...
0
votes
0answers
15 views

Wordpress Costums Field Comment Box on Admin Page (Post Editing)

can help me about wordpress comment field on post editing in admin page? i want to change the default form like picture above : to like this...
0
votes
2answers
90 views

How to hide a div based on contents of custom field

I've found several other threads asking this same question, but for some reason I can't seem to make a solution work for me. For clarification, I want to have a custom field that is applied to a post ...
0
votes
1answer
73 views

If Custom Field is empty don't display div

I'm looking for a better way to hide a div when a custom field is empty. I've figured out how to hide the div but I have quite a few custom fields and I'd rather not write the code for each one. ...
0
votes
1answer
42 views

Group by custom field value (start and end times)

I have the following loop that is outputting a schedule for a conference. At the moment it's looping through a custom post type, grabbing the info, then outputting it in a block. So essentially each ...
0
votes
1answer
43 views

How add body_class from wp_termmeta

I need to assign a class to the body for woocommerce categories. What I've done: // add the fields when the term is created add_action( 'product_cat_add_form_fields', 'add_product_cat_class_field', ...
1
vote
1answer
24 views

get_posts that match a user-specified value on a page

On each page, I want the admin to choose which case history post summaries will be displayed depending on the post category. My code below works but it is very clunky if you have lots of categories. ...
0
votes
2answers
44 views

Custom post types, disable fields

I have a plugin that is syncing data from a third party service into a custom post type. The idea is that the post type acts as a slave to the third party service, so any changes there overwrite any ...
0
votes
0answers
26 views

Create product configurator

I am building a product configurator tool where users can select mutually exclusive/inclusive options and I want to store their configuration at the end for retrieval later. As the user selects option ...
0
votes
0answers
20 views

WP_QUERY with alternating post types and pagination [duplicate]

I want to show both regular posts and a custom post type (event) on the homepage in a single loop. The event post type needs to be ordered by a custom field for the event date and show future events. ...
0
votes
0answers
14 views

why is the value of one field different from another if they are filled with the same variable?

A form is submitted containing a users email address. When the form is submitted, the page that processes the form creates a new post, and it sets the value of the custom meta field called 'entryCode' ...
1
vote
1answer
107 views

Woocommerce - How to populate custom select field with stored values on checkout page?

I have converted the postcode field in checkout to a dropdown field. Its working fine. $fields['billing']['billing_postcode'] = array( 'type' => 'select', 'label' => __('Locality - ...
0
votes
2answers
26 views

If metabox fields has content display content

I am try to hide the metabox fields with empty value like $Product_Brennwert = get_post_meta(get_the_ID(), 'Product_Brennwert', true); if ( ! empty ( $Product_Brennwert ) ) { echo 'Brennwert '. ...
0
votes
0answers
32 views

Wordpress Image details extra field under caption

Can I have an extra field on Wordpress Image details under caption ? I have seen a lot of tutorials and code snippets for adding WordPress Media Uploader custom fields but I couldn't find any ...
3
votes
1answer
44 views

Can I count the number of users matching a value in a multiple value key?

I'm trying to find the number of users having a certain value in a custom field. The problem is that this custom field allow multiple values. This code works well when the meta_key allows only one ...
0
votes
0answers
24 views

Order by meta_value_num issue

I am using meta_value_num to get the list of teams by their ranking, it working fine in 1,2,3,4 etc position, but in case of 11th, 12th, 13th etc position it consider them as a second position, the ...
0
votes
1answer
33 views

Convert all dates stored in custom field

I have a custom field to store the date of games, and I store it in database like mm/dd/yyyy Now I need to convert all dates to dd/mm/yyyy So how can do that? Is timestamp a solution for it, if ...
0
votes
0answers
27 views

List authors by first letter with letter per page

Currently I have this working with first letter of post title with letter per page. <div class="alpha_navigation"> <div class="inner_alpha_navigation"> <?php foreach ($letters as ...
0
votes
0answers
104 views

Add custom fields from Woocommerce Attributes in check out page

I've added some custom fields, using ACF, for attributes in Woocommerce. So when you add an attribute you can add some more info. I achieved to show them in the product page but I can't find a way to ...
0
votes
2answers
27 views

ORDER BY custom field value

Based on example here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ I'd like to modify the query $q = new WP_Query( array( 'meta_query' => array( ...
0
votes
1answer
36 views

ORDER BY custom field value out of where clause

Based on example here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ I'd like to modify the query $q = new WP_Query( array( 'meta_query' => ...
0
votes
1answer
32 views

Sorting posts by custom fields in meta_query

How to apply 'order_by' in WordPress query in the following example: I have a query to get all posts with custom field for event dates greater or equal current date. I can have up to 10 event dates ...
0
votes
0answers
38 views

Embed handler in custom field

I am trying to implement wordpress function wp_embed_register_handler() into a custom field. Using this instead of wp_oembed_add_provider(), for the urls I use do not offer oembed support. With help, ...
0
votes
1answer
44 views

ACF Relationship - Get Parent's Post Object

I've a few post that have ACF relationship field set up : - Post A - Post A1 - Post A2 - Post A3 Post A have a relationship that link to : Post A1,A2 & A3... Post A1,A2,A3 have their own post ...
0
votes
1answer
23 views

Extracting a TLD from the content and assign to custom field

I am trying to get the first instance of a TLD in a post and insert it into a custom field. For example with a post: Hi I am Bob. My website is http://bob.com and you can reach me at bob@bob.com ...
0
votes
1answer
34 views

WooCommerce - Order_itemmeta - Need to add meta_keys to table

I need to add 3 meta values to each order_item to the woocommerce_order_itemmeta table. Any suggestions how to create new meta_keys to be included in the table for all order items?
0
votes
1answer
21 views

I have a form with a custom button ,i want to add the field data to an database when clicking the custom button

So im new to wp/themes,and coding, but love it and love trying to build sites, I used the form from the theme, extracted only the email field and added a button on that field basically inside of that ...
1
vote
0answers
13 views

Change the main loop Wordpress impact on the server?

I used pre_get_posts to change the loop of my Wordpress site. The idea of this loop is not show posts I define an expiration date, whose dates are added in a custom field ( postexpiry ) . These ...
0
votes
1answer
23 views

manage posts custom column is not populating data from meta boxes

My custom post name is "employee". Here is the code for creating and populating admin columns. Columns have been created but it is not populating. Also, what is the meaning of the "10, 2" in action ...
1
vote
1answer
30 views

Get categories with posts by custom field value

I have a big categories tree (~2000 total subcategories)... And I have a lot of posts with custom field "city" (different values). I have created filter posts by "city" field. But I have problem with ...
0
votes
2answers
25 views

Link FROM attachment to full post and get custom fields values on attachment page?

This shouldn't be so hard! But I cannot find the answer to this question on Google.. How can I link from an attachment template to the full post please? Bonus question! How can I grab the custom ...
0
votes
0answers
42 views

Filter Dashboard of Custom Post Type by Custom Field

I have created a new Custom Post Type and added a new Custom Field to the Dashboard Table: add_filter('manage_edit-my_custom_post_type_columns' 'addNewMyCustomPostTypeColumns'); function ...
1
vote
1answer
52 views

Two near-identical custom field types - one works, the other doesn't . What can cause this?

I'm using Advanced Custom Fields to add meta information to a custom post type and in ACF I've created two different 'Select'-dropdowns - one is called 'series' the other 'classification'. I run a ...
0
votes
0answers
17 views

Add wordpress category id to user meta with button

I want to know which categories my users are most interested in so I want to add a button to categories theme so if they click it that is saved to user meta. Similar to this: Let user subscribe to ...
1
vote
1answer
32 views

How to load an assets based on custom field value?

How can I load an asset based on custom field value? - This would be outside of the loop, all I can find for this is in the loop related functions, which I'm not familiar with, or what I find are ...
-2
votes
1answer
36 views

Grouped Custom Meta Fields without plugin

I need to add grouped multiple custom metas. I did it with CMBII plugin. But if it's possible, I want to create it without any plugin.
1
vote
1answer
41 views

First custom field value (out of several) displayed twice after query

I have the following piece of code, which is based on the solution to this question: <?php $game_titles = get_terms('game'); foreach($game_titles as $game_title) { ...
0
votes
1answer
49 views

Upload files programmatically to users

i'm using pods plugin to add new custom fields to user so i added 4 files custom fields and then trying to upload files to this fields from registration page and create new user but when i upload the ...
1
vote
0answers
33 views

displaying and sorting comments by a custom field (using PODS plugin) [closed]

In my blog, i answer comments inline by editing them to add "admin says: blah blah". i do this so i won't bump up the comment count with all my admin comments. I am using the PODS plugin to add a ...
0
votes
0answers
60 views

Create select dependent dropdown by meta values or categories

We had 3 custom fields Brand Model Features (multi input in an array ) need dependent drop down form when select Brand (or Category) > show drop down menu contain all Models (related to this ...
0
votes
0answers
24 views

Strange issue with custom fields not showing data for certain posts but working fine on others

I have a very strange issue with custom fields on my site. I am using the custom fields for custom post types. So lets say the custom post type is called "cars". I will have various custom fields like ...
1
vote
2answers
53 views

Determine when a custom field was last updated?

Would anyone know of a way to determine when a custom field for a post was last updated? I'm trying to write something that says "If CUSTOMFIELD was updated in the last 24 hours don't do anything, ...
1
vote
1answer
53 views

Last modified field for user profile?

Is there a plugin or a known way to track user profile changes and save a last modified date in Wordpress? I tried with ACF, but it doesn't have an option to auto update this field. Thanks in ...
3
votes
1answer
47 views

Add options to featured image

I want to add an option to the featured image metabox. I have found a way to do this here The problem I'm having is saving the value tot the database. Here is what I have tried: add_filter( ...
1
vote
0answers
26 views

automatically set “Featured Image” the same as the og:i that is set in a custom field

I currently have a site that uses the "custom fields" feature to set the value of the meta property="og:image" for each post. All of my og:images are stored on an external server. I'm looking for a ...
1
vote
1answer
32 views

Meta Query returns wrong number of posts

I am using this meta query inside a category: $args = array( "posts_per_page" => 12, "post_type" => array( "event", "post" ), "post_status" => "publish", ...