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

learn more… | top users | synonyms (2)

-2
votes
1answer
450 views

How to include custom field in shortcode (do_shortcode) in theme file

To cut out a few steps and make it easier for authors, I have included a custom field for authors to enter details (may include HTML). I want to add the custom field to a shortcode in the theme. ...
0
votes
0answers
51 views

Conditional logic Advance custom field

i try to use this code to have a conditional logic form some field on back-end on ACF Plugin. I have a select HTML field with si/no (yes/no). If i select no, nothing show but if i select yes appares ...
4
votes
3answers
10k views

How to Add Custom Fields to a Custom Post Type?

Ok, so I have registered a few custom post types and a few taxonomies. Now, for the life of me, I cannot figure out the code I need to add a Custom Field to my Custom Post Type. I need a drop down ...
0
votes
0answers
30 views

Calling Custom Fields within a category loop?

What I'm trying to do is to display a specific category post listing within a page template, showing only each post's custom fields, which must be pulled and included within the following html. What I ...
0
votes
2answers
19 views

How can I hide my section title if there is no data in custom fields?

I wrote this function with a foreach and I'm not able to figure out how to hide the section title if there are no custom fields in $lista. Where should I place the section title? function ...
0
votes
1answer
23 views

Can't Output get_post_meta?

I have a custom field for my post and I am trying to output it onto my post's page but nothing appears. I know my code works otherwise if instead of trying to call my custom field, I use a fixed ...
0
votes
0answers
15 views

Nested Meta boxes?

I am trying to set up a plugin that will add a meta box to the posts admin page asking one simple question: How many authors will add their 2 cents? The question is in a dropdown with a possible 4 ...
0
votes
1answer
18 views

Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?

I'm new to wordpress and I'm trying to make a field that either links to a page internally via a dropdown OR a text area for a URL. Obviously I don't want the button to have two destinations so I'd ...
1
vote
2answers
32 views

Get_post_meta() won't return value

Ok guys... I'm sure this is going to be a really easy answer. I'm a complete noob at this. I have a custom field that is supposed to return a link. For some reason, it just redirects me back to my ...
0
votes
0answers
18 views

Wrap URL around custom field checkbox array

I have a custom field of checkboxes for choosing an "Area of Expertise" that was created using WCK (WordPress Creation Kit which I'm using to create CPTs and Custom Fields). I don't know if this is ...
0
votes
2answers
565 views

Save Custom Fields

I am working in a new project using WordPress. I have created some Custom Posts and now I have to relate some custom posts like categories. I created a custom dropdown menu inside the custom posts. ...
0
votes
1answer
19 views

Set Value To Custom Field While Submit

Is it possible to set an automatic value to a custom field while submitting the post in wordpress? When I post I need that this custom field take automatically the first letter of the post title. ...
0
votes
0answers
30 views

Use custom field “date” compared to today's date to display & order post list

I am at a loss here. I have a custom meta field blser_date where the client can use the date picker. The meta field is setup in a meta box array (this may be an issue b/c of the key?) Here is the full ...
0
votes
0answers
22 views

Display custom field in Media library according to a custom type

I have a custom field that follows any picture in the media library. It's added like this: function add_image_attachment_field( $form_fields, $post ) { $form_field["xxxx"] = array( ...
0
votes
0answers
14 views

Add a new tab (beside Just Listed / Most Popular / Random)

Using classipress theme, I need to add a special Tab beside Just Listed / Most Popular / Random based on a special custom field (cp_annonceur) where its value is equal to professionnel. I used below ...
0
votes
1answer
18 views

Can I access Posts of custom-fields via URL?

Is there a way to access all posts where the value of a given custom field is concurrent? like you can access all posts of a category like this: http://yoursite/category/<category-name> so I ...
0
votes
2answers
61 views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
5
votes
2answers
3k views

How to correctly call custom field dates into a posts_where filter using SQL statements

Currently I have the loop listing posts between two dates using the posts_where filter: function filter_where( $where = '' ) { $where .= " AND post_date >= '2000-01-01' AND post_date <= ...
0
votes
1answer
886 views

MySQL Query that looks for post with Custom Field, then changes Category

I'm looking for a MySQL Query that will look for all the posts with custom field "meta_key_I_want_to_find", then if the custom field is detected, add a category to that post. The category has already ...
1
vote
1answer
773 views

Add custom field to image editor

How do I add custom field to the image editor, such as under the image 'Description' field? To be much clearer, it's where the settings for the images are after you upload an image in the attachment ...
0
votes
0answers
35 views

wp_insert_post not working

I'm using WP 3.8.3 + Yoast for SEO + custom fields. Trying to do wp_insert_post due to post migration using the $my_post = array( 'post_title' => $post_tit , 'post_content' => $link, ...
0
votes
1answer
26 views

Extend WP_Customize_Control with Multiple Field Control

I'm trying to figure out how to code a custom control but frustratingly all the information I find online points to the same example of creating a single textfield. I'd like to create a custom ...
1
vote
1answer
48 views

Query Custom Post Types by date (custom field) range

I've seen similar questions and solutions, but so far I couldn't apply it to my code. The following code (functions.php) works perfectly fine: if( isset($query->query_vars['post_type']) ...
0
votes
0answers
42 views

Saving metadata of related post on save_post

here is the scenario: Custom Post Type "shows" Custom Post Type "reviews" Reviews are "child" of shows so that every review has a custom field with the ID of the parent "show". Since a review has ...
0
votes
0answers
23 views

Custom field with image and figcaption

Is it possible to create a custom field with both image and figure caption? I'm looking to add a custom field to the admin so users can include an image with a caption, styled as such: <figure ...
0
votes
0answers
38 views

Complex menu structure with 6 custom post type hierarchy

We chosen to use Wordpress to this client but we have not work with a menu structure like this one on Wordpress. Those content types i what we have created as custom post type. Is listed below: ...
0
votes
2answers
780 views

Excerpt length: get first paragraph

I'm trying to figure out if it's possible to get an excerpt from each post, grabbing the first paragraph from each one. I'm currently using the ACF plugin and have custom post types and custom fields. ...
0
votes
0answers
26 views

Sorting Custom Posts by Custom Field

I'm currently trying to sort custom post types called 'Donors' by the 'County' they live in. I have a custom field setup called County that they can fill in on the Donor post. Is it possible to echo ...
0
votes
1answer
37 views

Get all the posts from the category in a dropdown list in a custom field

In wordpress I have have a custom post type. Lets say it is movies. Inside movies I have a list of posts with different movie name. Now in each post I want a custom field of dropdown. Where all the ...
1
vote
1answer
650 views

Custom fields to save multiple values

I’m adding custom meta-box, by means of jquery I can create in it several custom fields with a key “test”. There can be one or several custom fields, but the key is only “test”. I can also delete key ...
0
votes
1answer
31 views

Related post thumbnail not showing up

I have created a 'related posts' custom field and would like to loop through all the posts that are added as a relation and show a bit of info from each (the title, a link and the featured image). ...
-1
votes
1answer
43 views

When I have something on a specifc custom field, how can I show it of the place of featured image? [closed]

I want in the place of the featured image of a post -depending on the subject of the post- , to show shortcodes (example shortcode to put on custom field:[ngg_images gallery_ids="1" ...
0
votes
0answers
31 views

If statement with two custom post type's but showing only one

I'm trying to think of a way to create an if statement in which it checks if two fields from two different cpt's are the same. Is there a way to do that without showing one of the two cpt's on the ...
0
votes
1answer
741 views

How to sort by custom field value?

I am using these code to sort most Commented, Most viewed Posts <?php $params = $_GET; unset($params['orderby']); unset($params['order']); unset($params['v_orderby']); unset($params['v_sortby']); ...
0
votes
3answers
665 views

Display value of custom field not working

I am simply trying to print the value of a custom field. I have read all the documentation, tried out other people's suggestions, and nothing works. I can get it to print the ID #, but not the actual ...
0
votes
2answers
78 views

Multiple instances of TinyMCE are removing <p> tag

I'm using the following code in functions.php to add a TinyMCE box on custom field textareas inside the Editor: add_action('admin_print_footer_scripts','FT_TinymceCustom',99); function ...
0
votes
0answers
30 views

Default gallery returns as shortcode text not gallery from synchronized custom field

I'm using ACF and Polylang plugins. In ACF I have set up a custom WYSIWYG field where I create default WP gallery. Then in Polylang I have set up that it synchronizes this field across languages. So ...
0
votes
1answer
397 views

How do i save and retrieve custom attachment meta?

I'm trying to save if a checkbox inside of the media uploader pop up is checked, so i can retrieve it from the front end. I'm using this code: function filter_attachment_fields_to_edit( ...
0
votes
0answers
98 views

WordPress Front End Profile Upload the User Image

I'm building a website that allows users to register to different groups based on their field of expertise. I have managed to get a profile page on the front but I can't get the user image to be ...
0
votes
1answer
494 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
2answers
33 views

Search Results Page - Displaying Custom Meta Fields

For the search results page Im making a custom template. And in that custom template I want to display custom meta field values. However, when I do this: <?php if ( have_posts() ) : ?> ...
0
votes
0answers
27 views

Order posts by average

I am using advance custom fields and i have used the custom fields to create an average score. Now i want to order the posts by the average score I have tried to do it but it doesnt seem to work here ...
4
votes
3answers
623 views

Sort posts by custom field numeric value using dropdown

I've read umpteen answers and questions about things that are very similar to this but I just can't get it to work for my specific situation. I have some posts with a category of "property". In ...
1
vote
3answers
115 views

Title and post URL based on custom fields?

I have custom fields in my custom post type. They should serve as a title and post slug for URL. Basically, whenever I change the content of the custom fields, the title field should react ...
0
votes
1answer
49 views

How make a custom search on backend in Wordpress without plugin?

I have a post type called usr_jardin with a custom field called sim_nuip. I would like to get the search to work for the title of the post and also by custom field . I try this but does not work me. ...
0
votes
1answer
50 views

Add Taxonomy Values Within a Custom Post Type RSS Feed

I would like to display taxonomies within an RSS feed. I am able to display my custom fields as per Add Custom Fields to Custom Post Type RSS (Thank you to all the contributors of that post), but I am ...
1
vote
0answers
62 views

Is there any way to add a “custom field” to the CPT archive page?

as per my title I have a CPT with an archive. I'd like to have my archive main page (the back end) displaying two custom fields that would allow me specifying the "meta tag description" and "page ...
0
votes
0answers
46 views

Query Distinct Taxonomies of Custom Post Type

I have a custom post type called "coupons". These coupons can then be drilled down by "city". City is a custom field that is defined for each individual "coupon". I am then trying to modify a sidebar ...
0
votes
1answer
35 views

Convert all dates in field to Unix time, except those already in Unix time

I have a meta field that is mixed with MM/dd/yy hh:mm dates and Unix timestamp dates. How do I convert all of the MM/dd/yy hh:mm dates in the db to Unix? I have only limited PHP and SQL knowledge so ...
0
votes
1answer
28 views

“Custom Field” to Excerpt field" for pages? [closed]

In the question "Copy SEO Meta Desc “Custom Field” to Excerpt field?" The plugin posted as a part of brasofilo's answer works great but, I would like to alter the excerpt for Pages of my WordPress ...