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

learn more… | top users | synonyms (2)

0
votes
1answer
16 views

ACF in wordpress

Hi i have a slight problem when making a custom post type widget. The problem is that when i want to get the field i want to use in a inline style it doesn't work. This is my code: class ...
0
votes
1answer
16 views

Custom post type in Custom widget - $listItem

Hi i have a slight problem when making a custom post type widget. the problem is that when i add a custom field in the code the part that shows the custom field information get's on top of the output ...
0
votes
1answer
47 views

How to display wp_post by custom field value?

I am using wooCommerce. How to display posts, when seaching by custom field value. The goal is when ?s={custom_field_value} URL is set, to get a result : ?custom_field*={custom_field_value} And get a ...
0
votes
1answer
27 views

Query events post type after current date and timezone

So I am making changes to a clients website and currently they have an events post type with some custom fields that allow them to set an events end date/time and the events timezone. The custom ...
0
votes
1answer
38 views

How to Manage and link certain custom taxonomy?

I'm creating some kind of soccer dedicated website.Assuming we created 4 different taxonomies: Teams, Players, Tournaments, Managers. Team includes two different types: National Team Club ...
0
votes
0answers
36 views

Custom Meta Box Image Gallery Not Saving

I'm having an issue of a custom meta box I'm building based off of WooCommerce's Product Gallery meta box. The meta box is not saving for some reason. I've tried some options from many different ...
0
votes
0answers
25 views

taxonomy_radio is not showing anything in the front-end in cmb2

I am building a website in where I want to show the tag selected from the custom fields (mainly from radio button). I have setup the cmb2 as like below the codes.. add_action('cmb2_admin_init', '...
0
votes
1answer
49 views

Order categories by sum of custom fields

I use get_terms to display some categories. I also use a custom field _postviews to count the views per post. I want to order these categories by sum of the custom field. Any ideas how to achieve ...
0
votes
1answer
26 views

How to display all custom fields associated with a post type - IN THE ADMIN AREA?

I know know how to get all the custom fields from a custom post type, that's easy. However, when I create a custom post type, it displays a beautiful page automatically in the administration part of ...
0
votes
0answers
14 views

Retrieving cell values from options table on specific page template

I outsourced this task to a contractor over the past week as i'm up against it timewise. The contractor has been unable to deliver it, so i'm looking to try and get this solved myself asap with a ...
0
votes
1answer
34 views

how to modify a <textarea> field's size in a metabox : ROWS height, and scroll control?

I'm stumped by being unable to find a way to do some really basic adjustments to the textarea in my custom metabox. Looking at a default Wordpress Post Admin screen, the Tags metabox is a single-line ...
0
votes
1answer
40 views

Performance of storing multiple meta fields vs one JSON encoded field [duplicate]

I have several custom post types. For some i need to query them based on a single meta field, but for others i have a dozen individual meta fields. If i create an array and convert it into JSON, will ...
1
vote
0answers
16 views

Alter main archive, to show posts with meta as last

I'm having troubles with getting posts with meta_value "sold" as last in the main query of my custom Post type. The best/easiest way i can think of at the moment is to filter the "sold" posts out of ...
0
votes
1answer
24 views

Output custom text field as unordered list

I am quite new to php. I am using advanced custom fields and have a custom field with the name tags. Users are inputting content such as: Tag 1, Tag 2, Tag 3 I would like parse this output and ...
0
votes
1answer
34 views

Display posts with empty custom field

How to list post with specific custom field which is empty? I have some posts with custom field 'author', and for some posts that custom field is emty, so I would like to find those posts to delete ...
-1
votes
1answer
43 views

Display div based on Group metabox selection [closed]

I am having an issue with the below code when it comes to displaying a div based on a specific metabox is filled in. I am using the Group metabox selection from CMB2 to handle my metaboxes. As of ...
2
votes
1answer
29 views

Checked() showing up twice in custom fields

I've successfully applied a meta box and checkbox field that can save my settings. However, there is a bit of leftover code that seems to show up on my meta box field. The checked='checked' shows up ...
1
vote
0answers
33 views

Add microdata from schema.org [closed]

I am trying to add the microdata from schema.org to my WordPress site, but I do not want to use any plugins. I am trying to hardcode the meta and title for each and every page in the PHP files. Does ...
1
vote
0answers
37 views

register_rest_field for custom taxonomy fields that are assosiated with custom post type

I am trying to register a rest field for my custom taxonomy's custom meta fields. I followed the tutorial at Modifying Responses . The code worked great for adding a rest field for post meta data for ...
0
votes
2answers
33 views

Cannot obtain custom meta information

I'm trying to access custom meta data from a custom post type called 'Videos' The following code is on a template page called 'single-videos.php' A custom field called 'Video URL', 'Video Width' and ...
0
votes
2answers
35 views

Custom Field 101

I'm trying to learn how to use the Custom Field function. I have a series of posts with titles like "Adams County," "Lane County," etc. All are in the category "Washington" and are tagged with "county....
0
votes
1answer
30 views

Query only displays one page_id

I have a short query that is supposed to load IDs from pages that the user picks in the backend. Currently it does display an array with IDs on the frontpage, but it stops displaying posts after the ...
3
votes
3answers
62 views

Custom user avatar in the Wordpress users listing

By default, Wordpress uses Gravatar for user avatars. I've created a custom field for avatar uploads, and I'm using this as users' avatars on various pages in the theme. In the admin - on the all ...
0
votes
1answer
38 views

Conditional featured image with youtube thumbnail

Basically what I am trying to do here is: Display the youtube thumbnail. If no youtube thumbnail -> Display the Featured image for the post. If no featured image -> Display the fallback image. ...
3
votes
1answer
57 views

Right way of storing large number of custom post fields

On one of the sites of my multi-site network; I'm creating a custom post type 'Events'. Each of the 'Events' post will have about 30-50 custom post fields - because we require event creators to enter ...
0
votes
3answers
60 views

custom field (video/audio url) and embed functionality

I was wondering if there is any way to combine a custom field (in custom post type) with an embed shortcode? Long story short - a user type into a field called videox and an url for a video (youtube, ...
0
votes
1answer
23 views

Avoid another meta box in my custom post type

I created my own custom post, all right up here. I have also added the meta box for custom post. But I've noticed that some plugins automatically add their own METABOX my custom post type. This can ...
0
votes
1answer
15 views

Save all custom field data into one “master” custom field

Let's say we have three custom fields: Pirates Robots Ninjas Maybe we're saving information about different people who are related to a post in each of those professions. What I'm trying to ...
0
votes
0answers
11 views

How can I reduce and update the list of available custom fields in the Name list on the page in admin?

So on the admin page for a certain wordpress page, I want the custom fields list updated, because I don't need some (most of them actually) of the existing values for custom fields. So I want some ...
1
vote
2answers
105 views

how to set default value for checkbox in wordpress

I am facing a problem to set default value for the checkbox field in WordPress. I have a checkbox input field (metabox) in a custom post. I want the checkbox to be checked by default. and if user ...
1
vote
1answer
21 views

Customizing user data

For a school, I'd like to add custom fields to users, such as department, curriculum, date & place of birth, education, phone number, social links.... How can I accomplish this? I see there are ...
0
votes
0answers
25 views

How to update Update click count in user meta

I have a custom code which updates count when someone click on each user link. Here is the code HTML OUTPUT <div class="grid-item grid-item--width2 user-img-32" rel="32"> <a href="https:...
0
votes
1answer
34 views

Creating Ordered Query using Meta_key

I've hit a massive roadblock that I've been stuck on for days now, hope someone can help with this. The problem: I have a custom field called order_value with the values road, air and bus. I am ...
3
votes
1answer
21 views

Custom field value based on other custom field values

I have a custom field value called points. Post 01 points = 5 Post 02 points = 10 Post 03 points = 8 I need to create another custom filed value called rank. Rank custom filed value should be ...
0
votes
1answer
39 views

Add custom field to attachments in a specific category

I have a working function that adds a meta field to all attachments (so I can enter the url of a video). I would like this field to populate only on attachments in the "video" category. I've tried ...
2
votes
0answers
17 views

Change the RSS Publication Date to use a value from a custom field

I have a site that wants to order its RSS output by a date value in a custom field. I'd rather not create a new feed to do it -- how do I override the default feed date value?
0
votes
1answer
27 views

After ajax image is outside the `<a>` tag

I am loading some content via AJAX, and basically I have this line: $storage .= '<a href='.get_permalink($id).'><img src="'.$image['url'].'" /></a>'; Which gets rendered as: <...
3
votes
2answers
134 views

How to get custom post meta using REST API

I am trying to create a REST APIs for my wordpress website which is used for facility listing using wordpress job manager plugin. I have registered my custom post , taxonomies in \plugins\rest-api\...
0
votes
0answers
15 views

Table showing data from posts

I have set up a custom post type, with several custom fields to store individual pieces of data. Is there a way to display the data from the posts in a table? Ideally I'd be able to implement search ...
0
votes
0answers
10 views

How to target page editor fields when using an import plugin?

I currently have a need to create many pages that only differ by a small amount, so I figured I search for a plugin that can allow me to import multiple pages that I'll create in Excel and save as a ...
0
votes
1answer
18 views

Add commentmeta custom field to every published comment with SQL

I am trying to add custom commentmeta "likes" with 0 as default value to every posted comment. I have this query but I dont see any error there, but still it doesnt work. Can anyone help me to solve ...
0
votes
0answers
22 views

Query Posts by post_meta using WP_Query (data saved as array with keys)

I am working on some project where i need to create class (like karate etc...). My question is, how can i work with WP_Query to Query all the posts by post_meta where the key "day" is "1" for example....
0
votes
0answers
15 views

how to display a sidebar widget based on a dynamic custom field?

I used to manually assign a sidebar to a post based on a custom field using the following code in the sidebar global $wp_query; $postid = $wp_query->post->ID; $sidebar = get_post_meta($postid, "...
0
votes
0answers
21 views

Content by location - custom meta OR Multisite

I'm looking at organising content by location for a client, initially just two cites, but moving on to three in the future. The client has a LOT of content for one location already. Is it better to ...
-1
votes
1answer
21 views

Filter Query Post by Custom Fields(by date)

I want to filter query_post using the 2 meta keys start_date and end_date, i want to get my posts to divide it by upcoming events and past events. start_date and end_date is stored in the timestamp ...
2
votes
0answers
50 views

Download external images with function

Actually, i display images on my site from other sites. Url is on a custom field name "couv" I'd like to download theses pictures on my site and create a new custom field with the new value "couv2" I ...
2
votes
0answers
32 views

SQL Query to copy value of a meta_key into another meta_key

I am trying to figure out how to replace the value of one advanced custom field with the value from a different custom field. Would anyone be able to help me structure a SQL query that will do this ...
2
votes
0answers
38 views

Using a custom field value to redirect away from a 404 page

I’m moving from an old CMS to WordPress. The old articles are saved as posts and the new WordPress permalink is %post-id%. The old URL slug is unique and saved as a custom field for each post; the ...
0
votes
1answer
25 views

Saved Post Meta Array Returns as String

I am saving an array in post meta using update_post_meta. $arr = array('this', 'or that'); update_post_meta($post_id, 'field', $arr); $ret_arr = get_post_meta($post_id, 'field', true); var_dump($...
1
vote
1answer
27 views

How can I show custom fields in the loop only to specific user roles?

I've inserted this code in the loop (in single.php): <span style="font-size:16px"> <strong>Currently reading:</strong> <?php the_field('book_name'); ?> (<?php the_field('...