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

learn more… | top users | synonyms (2)

-1
votes
1answer
105 views

How to show all posts of specific custom post type with their custom fields values?

I am trying to get the list of all posts with post_type "staff" along with custom fields assigned to this post_type. Custom fields were create with help of ACF. I've tried both: $query = new ...
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
18 views

Custom Fields with pre-filled content

as this is my first post here I first of all like to say "Thanks" because I found a lot of hints here for my problems in the past. Now I have to ask for the first time: We are offering news under ...
0
votes
1answer
27 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
77 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
32 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
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
2answers
93 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
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...
3
votes
2answers
759 views

How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?

I know the question is quite ambiguous. Let me explain: I have a page that lists all posts with a certain value of a custom field. (Eg.: The page Rentals lists all posts with the value rental of ...
1
vote
2answers
138 views

Custom Field returning Numerical Value for Image rather than URL

I have been trying a way round my latest WordPress problem all morning and I feel now is the right time to shout and ask for help. I have been trying to create a people directory, I'm there except ...
20
votes
6answers
24k views

getting all values for a custom field key (cross-post)

I know how to get a custom field value for a specific post. get_post_meta($post_id, $key, $single); What I need is to get all the values associated with a specific custom post key, across all ...
0
votes
1answer
64 views

Change post template the proper way

I'm trying to create an option on edit posts screen (backend) to select different post template based the selection and I need your opinions guys if that is the proper way. Here is what I've tried so ...
0
votes
1answer
325 views

echo value from 'select' field type into page template using cmb2?

I'm using CMB2 plugin to add metaboxes into a custom post type. I'm adding the additional metaboxes via functions.php onto child theme. It may worth to mention that parent theme/custom post already ...
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
44 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', ...
0
votes
0answers
271 views

Generate auto seqential ID number when a new user is registered

First off I found this solution to what I would like to do: generate an auto incremented id number when a new user is registered It is almost there but I would like to extend the functionality a ...
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
3answers
1k views

Get single image from custom fields made with WCK custom fields creator

I used WCK Custom Fields Creator to create a repeatable custom field for uploading pairs of images (one color, one black and white) to posts. So for example, one post may have three fields, with two ...
0
votes
0answers
27 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 ...
1
vote
1answer
110 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
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' ...
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 '. ...
3
votes
1answer
46 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
34 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 ...
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 ...
8
votes
5answers
7k views

Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title

I'm working on a custom taxonomy term page template where we want the items that are connected to the term sorted by a publication date (custom date field) - and if there are multiple items on the ...
4
votes
3answers
6k views

Using TinyMce with textareas in meta boxes on custom post types

I am trying to use the http://www.tinymce.com/ plugin to add a tinymce to my textareas in my meta boxes I have created. I've googled other ways and either I cant get it to work or didnt grasp the ...
0
votes
0answers
30 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
114 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 ...
1
vote
1answer
52 views

Masking Affiliate URL using $post_slug after “/go/”

I am trying to figure out how can I redirect a masked URL based on a custom field URL. If I have a masked URL: echo '<a href="https://domain.com/go/'. $post_slug .'/" class="button">Click here ...
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
33 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
39 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
2answers
193 views

How to show a gloabl message on a user profile page (in back end)?

I want to show a global message for all users in their profile page. I do not want to edit profile.php what is the hook to do this? Basically I want to add a div to show a paragraph below the ...
0
votes
1answer
45 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
38 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 ...
0
votes
2answers
705 views

How to I make my post title link to a custom field

I have a custom field in my posts called post_bookmark_url which contains a link. I want the post title that is displayed in the excerpts on my home page to link to the post_bookmark_url rather than ...
4
votes
1answer
5k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
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
25 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 ...
1
vote
1answer
42 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) { ...
1
vote
1answer
58 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 ...