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

learn more… | top users | synonyms (2)

0
votes
2answers
38 views

How can meta boxes be added to “unknown” custom posts?

I'm running WP multi-site and I've created a plugin that adds meta boxes to my page and post. add_meta_box( 'Intro', __('Intro'), 'sewp_post_intro_meta_box', 'post', 'normal', 'high' ); add_meta_box( ...
1
vote
3answers
499 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 ...
0
votes
2answers
61 views

Using a Custom Field instead of original title field but only for Custom Post Type

I am trying to get a custom field value (Field "bildname") as my post title, and another (Field "bildbeschreibung") as my content in my Custom Post Type. It is not really working though. First it kept ...
0
votes
1answer
41 views

How to hide a custom field from admin?

I created a custom field that I would like to hide from the wp-admin (because the system generates it and I don't want user to change it; Hidding it with CSS should be OK in this case), Like this, ...
0
votes
1answer
936 views

3.8 Media Upload and Custom Meta Box

I've been using Tammy Hart's Reusable Custom MetaBox code for some time now but with the recent 3.8 update the media upload seems to be no longer functioning, and the code is no longer supported. ...
0
votes
1answer
27 views

How to validation for sanitize_URL?

Like sanitize_email validation is options available but sanitize_url options is available .if options is not available then how can i do this . http://i.imgur.com/WPYdkTb.png
5
votes
2answers
126 views

Tabindex on text input immediately after WordPress title input

The following code adds a text input for a subtitle to the space directly below the title input, via the edit_form_after_title hook. However, when editing the title, pressing tab moves the cursor to ...
0
votes
1answer
57 views

Why can't I access Custom Taxonomy metadata?

I'm trying to access Custom Taxonomy metadata for all my custom taxonomy terms. The metadata is stored in options like so: $t_id = $term_id; $term_meta = get_option( "taxonomy_$t_id" ); ...
0
votes
1answer
57 views

How to add content at the end of posts?

I am trying to add custom fields at the end of posts. I succeeded showing the custom content using the below mentioned code. But the main post's content was replaced. : function ...
0
votes
0answers
181 views

WP Query multiple select form - meta_query help

I am creating a multiple filter - as in I could filter by all the options if I wanted to do so, i.e terms, calories & price in my case. I am having trouble with meta query args. At present I can ...
2
votes
1answer
104 views

Automatically assign taxonomy term if custom meta value exists

I currently have a custom meta field for adding a video url to the post. I'd like for the existing taxonomy term "video" to be automatically assigned to the post upon saving if the meta field has any ...
4
votes
3answers
316 views

Query custom post type by custom field

General Info I used the plugin WP Types (wp-types.com) to create a custom post type called "artist". In WP Types you can also set another post type as parent post type. This is not possible by ...
0
votes
0answers
24 views

wp_postmeta are updated for only one page

Code below only updates wp_postmeta of one specific post, not all the posts. On other pages the meta_key is not even added to the table, so it is not the problem with saving but with something else, ...
0
votes
1answer
99 views

update_post_meta not working in action hook

I'm having a real problem updating custom fields (within a custom post type) with data from the database. I have a table in the database called wp_company_profiles with address fields (i.e. ...
0
votes
1answer
59 views

My meta boxes update wp_postmeta of posts but not of pages. What is wrong with the code?

I have a simple checkbox on posts to display posts in a slider, and everything works fine. But I want to switch and add only pages in the slider, but code below is not updating wp_postmeta table of ...
0
votes
2answers
40 views

Help setting up a sql query

I need to list out specific custom field items that contain an associated custom field entry. For example, the custom fields are named "type" and "food". I would like to list out all of the breakfast ...
1
vote
0answers
203 views

How to populate custom field dropdown box based on prior selection?

I have two dropdown boxes for a search that uses custom fields and I need the second dropbown box to be populated depending on the results of the first box. So far I have: <form role="search" ...
0
votes
2answers
36 views

Custom Field Multiple Clauses

I am having a weird situation, I have two meta keys in my custom posts. Start Date and End Date, In simple SQL, I want to execute following query where startDate > '2013-12-10' and (startDate ...
0
votes
1answer
218 views

How to import database table as custom post type and custom fields?

I have a sql table that contains vehicle information. When I import the database table to my WordPress website, I need the information to be imported as custom fields for a custom post type. For ...
0
votes
1answer
49 views

delete_post_meta() for whole CPT / multiple posts?

I'm cleaning up a theme and one of Custom Post Types has some odd, long gone custom fields. I want to delete them, unfortunately delete_post_meta() takes post->ID for an argument, while I want to ...
0
votes
2answers
50 views

Avoiding stripping of HTML in Custom Taxonomy Meta Field

I'm using a custom form field on a Custom Taxonomy to hold various data. All working well except in one particular case where I'm trying to save an iframe embed code (from Bandcamp) which is to be ...
0
votes
1answer
28 views

Conditional On custom field plugin metabox

I've trying to run a conditional on the custom field I made with the Custom Fields plugin, I made a true and false check box. I just need to check if the box is true or false really. I've tried ...
0
votes
0answers
76 views

Woocommerce - Get or calculate user totals and assign to role

I need some help with GET and/or calculate the sum of all orders made by specific user and if conditions is 'true' assign them to specific user-role. for ex: Find all users. Get all "totals" for ...
0
votes
1answer
22 views

How to only allow post to be deleted if custom field doesn't exist

I have looked at both the delete_post and before_delete_posts. Neither of these hooks actually allow me to perform a check and then tell wordpress not to delete the post. Anyone got any ideas?
0
votes
1answer
40 views

Advanced Custom fields not available yet during publish_page action

I have a function that I use that ties into the publish_page action that I use to create multiple pages on my site. This function worked perfectly for a while, but ceased to function correctly after a ...
0
votes
1answer
44 views

Meta box values are displayed on Custom Fields list. Is it possible to hide them?

I have multiple meta boxes for my Custom Post Type posts. I want my users to add new fields using Custom Fields. The problem is - Custom Fields display all the garbage from my metaboxes and it might ...
0
votes
1answer
106 views

How can I output the custom fields wrapping with HTML

I am trying to publish custom fields created using the plugin "Advanced Custom fields". I am able to display them on posts and custom post types as raw output. But I want to wrap html around the ...
1
vote
1answer
30 views

strtotime and custom field value

I have a custom field of Due and am trying to display the date. It is stored as 20131209. I am using <?php echo date_i18n( get_option( 'date_format' ), strtotime( $Due ) ); ?> but it just ...
0
votes
0answers
42 views

Search a specific custom field values in a specific custom post type

Hello WordPress developers, In my site, I have created a custom post type called "BOOKS". And In that custom post area there's a custom data field called "Author". Now, what I want is add a search ...
0
votes
0answers
39 views

Delete duplicate custom field with specific vaule

I'm trying to delete specific custom fields that have been duplicated, however i only want to delete the fields with the value 0 in them. I currently have this code that will delete the duplicate ...
0
votes
2answers
68 views

Sort posts by custom field value

I tried fixing this for 5 days and my head is burning now. I bought a theme from GorilaThemes and the developer doesn't get back to me on the forum either, so Im pretty much by myself now. can you ...
0
votes
1answer
30 views

If custom field is empty, use one from a previous post

Let's say you have a few custom fields (I use the advanced custom fields plugin for it). There is an extra field in posts called 'afbeelding_onder'. It is not required but on index.php within the ...
0
votes
2answers
39 views

Order by custom field attribute

I'm try to get the output of this post type to order by the staff name alphabetically and I can't seem to figure out if needs to be within the beginning array() or if I been do something within the ...
0
votes
0answers
50 views

How can I include the custom field in Woocommerce in my IPN

I use Woocommerce plugin. All works great, I have added a custom field or attribute to a product which is fine and it shows on the products detail page but my problem is getting this data to come ...
0
votes
1answer
67 views

How can I save custom meta to one global value?

I have added a custom meta box to one of my custom post types. It contains a checkbox that will indicate that this is the "featured monthly product" (there can only ever be one). When I check this ...
0
votes
2answers
86 views

Get Specific Template Part if Custom Field is Some Value

I have a problem and I don't know how to solve it. I tried some solutions but I failed since I am not good programer. I also tried to find a solution, but there is no similar question asked. So... ...
0
votes
1answer
137 views

Show Posts in Vertical Tabs with Scrollbar

I have created CPT ( Custom Post Type ) called Recipes. I want to display all me recipe in Vertical Tabs. For Example; check the image below i have created. Image Example Click Here On the left ...
0
votes
1answer
119 views

ACF | Repeater Add-On Query

Hoping someone can assist as I am new with ACF, particulary around the repeater add-on I am creating a "Postage Pricing" table where this table will consist of 5 columns with 7 rows say. 1st Column ...
0
votes
3answers
171 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
0
votes
2answers
28 views

Confusion on how to display custom field data

Hey I'm new to WordPress. I've looked at the codex and other topics here, I just don't get how to display my custom field, which I have set in the area under my post editor. The name is MyField and ...
0
votes
1answer
225 views

Display custom widget value in header.php

I am using the code below for a custom widget. I have added some fields in the widget like: Title, Name and a checkbox. Now everything is fine but I want to show those values in header.php. Any idea ...
0
votes
1answer
117 views

Show field if it has contents on Advanced Custom Fields

I have a custom field set that is look to display like so: <p><strong>Lease Rate:</strong> <?php the_field('lease_rate'); ?> </p> <p> ...
0
votes
1answer
157 views

ACF Custom Field for User selection

I came across your question on creating a new custom field with ACF, to choose from Registered USERs - I think I understood correctly...- and that is exactly what I'm looking for myself (eg.being able ...
0
votes
0answers
27 views

Custom meta boxes for different custom post type on multisite WP

I have two custom post type defined ('acting' and 'voiceover') and custom met boxes defined for both of them. I'm able to save, update and delete on the acting custom post type. But if I add the ...
0
votes
0answers
62 views

Check before publishing, if already exist post with custom field value

I want to use custom field value unique post to post. like Email / student ID / Driving Licence as value of custom field. It has to be unique like Post ID. When I am publishing same value in custom ...
0
votes
3answers
101 views

get_post_meta() retrieves meta from a specific post on pages, not the page currently viewed

I am making a simple sidebar functionality to display embed video in the sidebar. I've created a meta field where admin should paste the embed video. It works as it should on posts, but on pages, ...
-1
votes
1answer
121 views

how to add radio field on user meta on function.php?

i have added gender filed on user meta it is not value <?php add_action( 'show_user_profile', 'show_extra_profile_fields', 10 ); add_action( 'edit_user_profile', 'show_extra_profile_fields', 10 ...
0
votes
1answer
43 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo ...
0
votes
1answer
118 views

Advanced WordPress search form based on custom taxonomy and custom meta value

I would appreciate if someone could help me out with the following issue. Here is the thing. I created two select boxes so I could filter and display posts from a custom post type based on two values ...
0
votes
1answer
56 views

If metabox has content display content

I know how to display field content if the field has content. $monday = get_post_meta($post->ID, '_cmb_open_monday', true); if ( ! empty ( $monday ) ) { echo 'content'; } How do I display ...