Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

-1
votes
0answers
9 views

Should I use Wordpress.com or Wordpress.org if building with React front end?

I'm a developer and want to leverage Wordpress's CMS and API as the backend of my blog. I will be building the blog using ReactJS. I discovered the console: https://developer.wordpress.com/docs/api/...
0
votes
1answer
22 views

Custom WordPress Pages

Recently, I have started developing a WordPress Events plugin as none of the off-the-shelf ones met the specific criteria for this project. I have ended up creating a few database tables for tracking ...
0
votes
1answer
15 views

Display taxonomy loop using custom field data

Just learning PHP. Wondering what I'm doing wrong here. The aim is: if custom field in taxonomy term (in "shows" taxonomy) has data, show posts loop of taxonomy term in a custom post type ("blogs"). ...
0
votes
1answer
14 views

Custom product page's style for printing

I m using woocommerce for product listing on site but i changed default single product page's layout with elementor. Now when i'm trying to print it changes layout on preview. Product's image size ...
0
votes
1answer
19 views

copy attachments to another post type and change attachment url

On my site I have to custom post types and a function that let's users import photos from post type A to post type B, copying the meta values and it copy's the image to the folder specified for post ...
1
vote
1answer
16 views

How do I set all of a particular post meta to a value within the custom post type I'm in?

I've currently got a custom checkbox that (if checked) sets a particular post as 'featured'. It also set all other posts as 'unfeatured', just before setting the current post. This has worked great, ...
-1
votes
0answers
6 views

Product attributes show up in admin panel but not anywhere in the database

I have a WooCommerce site on which I had a person work on with a custom products importer. The importer was supposed to loop through a csv file, add products, prices, stock etc, as well as search ...
0
votes
0answers
13 views

Best plugin to create a navigation menu from a product custom field

I have a woocommerce site and I use WP All Import which creates some custom fields during the import process. I'd like to create a navigation menu from one of these custom fields but can't find a ...
0
votes
0answers
12 views

CPT Text search with wp_dropdown_categories is not working well, return false result

Please review my code, I want to search custom post type text with drop-down. <form id="searchform" method="get" action="<?php bloginfo('url'); ?>"> <input type="text" ...
0
votes
0answers
5 views

Woocommerce Custom Checkout field saving bogus from time to time

In our woocommerce instance we have added custom checkout fields for invocing (identification number of entity and its tax number) via add_filter( 'woocommerce_checkout_fields' , '...
0
votes
1answer
27 views

using custom meta user data to run queries in WordPress

I have added custom user meta data to the WordPress user profile below is the code I used to add this data. This part of the code seems to be working fine and I do not have a problem with it. <?...
0
votes
1answer
33 views

Get every post with value in meta key

I am trying to get every post, that has a specific URL in the meta key _cornerstone_data. From the WordPress documentary I was able to build this query, that probably gets me close to what I'm trying ...
0
votes
1answer
26 views

Dropdown (with onChange) with custom taxonomies

I have multi-select taxonomy field A. When one or more values are selected in A, I want to restrict the choices available in taxonomy field B. So for example: Two Taxonomies called country - "USA", ...
1
vote
1answer
14 views

How can I filter the contents of a metafield before it's displayed in the admin?

With the cmb2 plugin I created a metabox with a textarea metafield this way: function myprefix_register_metabox() { $prefix = 'myprefix_'; $cmb = new_cmb2_box( array( 'id' => $...
0
votes
0answers
9 views

How to add specified user role's all users list on drop down menu of Buddy Press custom add profile field

Is anyone an idea to add separate user role's all users list in drop down menu of custom add profile field of Buddy Press ? For example I have three types of roles. Admin,Doctor,Patient. I ...
0
votes
0answers
14 views

How can I dynamically filter the choices in a taxonomy select?

More specifically – I have multi-select taxonomy field A. When one or more values are selected in A, I want to restrict the choices available in taxonomy field B. So for example: Two Taxonomies ...
0
votes
0answers
9 views

Get Users list by separate field.

Is it possible in WordPress or Buddy Press that get users list data as per specific field. Which field filled by user at the time of registration. For example in hospital management site The ...
0
votes
0answers
13 views

Update custom field on the fly

In Woocommerce I want to update the custom field value for a logged in user. How can that be done?
0
votes
0answers
22 views

ACF - new flexible content layout not displaying on front-end

I have added a new layout to a flexible content block, but for some reason it isn't displaying on the page as it should. Previous layouts that have been created are displaying fine and the layout I ...
1
vote
0answers
21 views

Query Multiple Custom Posts by Custom Fields

We have 3 custom post types and we need to query all 3 and join them in order the get that data to build up a complete list of films at a venue. Tables are as follows, with there unique ID's. The ...
0
votes
1answer
13 views

Using get_posts to get posts based on a checkbox value with Advanced Custom Fields

I have a custom post type, "Jobs". These jobs have an ACF checkbox field, "city". "Jobs" can have more than one "city," so the jobs returned have meta values look something like this: [city] => ...
1
vote
2answers
23 views

Outputing a metabox textarea and avoid line breaks inside li tags

I have added a custom metabox that holds string from a textarea in database. Now if I just simply echo the meta box like this: $post_meta = get_post_meta($pid); $answer = $post_meta["answer"][0]; ...
0
votes
0answers
13 views

Issue on Creating Checkbox Field On Custom Post type

Can you please look at this demo let me know how I can create and save a checkbox as a custom field in Custom Post Type? function render_metas( $post ) { $we_productMetas = get_post_custom( $post-...
0
votes
1answer
24 views

Custom field disappeared from screen options

I've been trying to display the custom field section for my posts in the admin, but it's not under screen options anymore... Was it moved somewhere else? Thanks!
1
vote
1answer
17 views

Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta

I believe there are multiple ways to use nonce. Recently I've used wp_nonce_field('any_nonce_value'); which creates a <input type="hidden" id="_wpnonce" name="_wpnonce" value="111bc61eba"> ...
0
votes
1answer
24 views

Post meta data not showing in frontend, until hitting 'update' button

I try to insert around 2000 video-posts into WP. There is a custom field in the theme for the video-url, so I add the video-url to the post meta data with the corresponding field name. ACF seems not ...
0
votes
0answers
19 views

How to load ACF groups With jQuery or Ajax

When i want to edit wordpress page, it is taking 2min to load bcz of custom fields, am loading same type of custom filed 3 times, it will give the option to select the posts, left side we have latest ...
0
votes
1answer
38 views

Increment user meta data by 1 each time a page is visited

Can't for the life of me figure out why this isn't working, I've tried like below with $val, I've tried sticking the get_user_meta into the meta_value, I've tried just adding +1 in the meta_value but ...
-1
votes
0answers
26 views

Search custom post with custom fields by post author

I have a specific search requirement which searches custom posts with custom fields and returns post_authors as a result. Let’s say I have two custom post types house_post and car_post. A user can ...
0
votes
0answers
30 views

Tweaking custom post attribute sortation

I've set up a custom field called "Priority" for posts in my Wordpress theme. They're basically integer values that the user can set, which are used in operations elsewhere on the site, and are ...
1
vote
1answer
37 views

Audio player shortcode not showing up when using variable

I am trying to call a custom term meta field in an audio shortcode that I have placed on a custom page that I am working on. The field contains a link to a .mp3 file that I have uploaded to my media ...
0
votes
1answer
31 views

wp_query posts with custom fields number smaller than

Posts have a custom field with key time and a value. In a template I want to query the posts that have the time key and a value smaller than 30. Whatever I have done so far didn't work. Below is the ...
0
votes
1answer
24 views

Custom plugin issue - Notice: Trying to get property of non-object in

In my plugin to configure some basic values using a woocommerce function which is creating a select field, but for some reason it generate this error: "Notice: Trying to get property of non-object in /...
1
vote
0answers
29 views

How to create a dropdown select of all items in an ACF field group

I have a series of Field Groups, each attached to a specific product category (woocommerce) and I need to be able to access ALL the data regarding each field group on the product category page. This ...
1
vote
2answers
52 views

Redirect users based on custom field

I'm a novice at Wordpress and i'm pretty sure what i'm looking for is really easy. I have an issue with a function that doesn't work : function user_homepage() { if ( is_user_logged_in() ) { ...
0
votes
1answer
18 views

Show image gallery from a custom field

I have a custom field in a custom post type. The custom field is a tinymce editor and I should echo out what user enters on it. If user enters text it is shown as well but when an image or a gallery ...
0
votes
1answer
50 views

copy images from custom field to another custom field

On my wordpress site I have a front end form that allows users to create posts and upload photos for a custom post type 'Property'. Using the following function - $property_sights_value = ...
0
votes
1answer
13 views

custom fields anchor points php

Hey i have a list on the side of one of my pages which when clicking on the word it scrolls to its anchor which is set up like: <div class="guide-section" id="Measuring_up"> then the href ...
0
votes
0answers
15 views

how to remove duplicate arrays from view

I'm trying to create a filter list based on a custom taxonomy. This is my array: Array ( [0] => WP_Term Object ( [term_id] => 121 [name] => Sistemas CIP - COP - SIP [slug] => sistemas-...
0
votes
1answer
28 views

WP All Import / Update stock quantity from multiple XML files

Hi there as the title says, I am trying to import stock quantity from multiple xml files, I am trying to save stock in custom filed and then add code to sum this new filed and existing new and then ...
0
votes
0answers
6 views

wp_redirect not working when adding custom fields

I am trying to redirect when the admin clicks on the "Draft" button. The code is below $draft_txt_change = 0; function test_post_status(){ global $draft_txt_change; $year = date("Y"); $month = date("...
0
votes
0answers
6 views

Use custom profile field in comment

On registeration I added 2 custom profile fields. How can I use these 2 fields on the comment section. For example I want to display the value of "City" field, just before the nickname, for example :...
0
votes
0answers
8 views

Order by 3 custom fields in archive Woocomerce list

I'm trying to order the products in woocomerce archives pages by 3 custom fieds, my code is: add_action( 'woocommerce_product_query', 'imcar_custom_product_query' ); function ...
0
votes
0answers
17 views

Woocommerce - Saving parent product meta for children (in variations)

In 'new product page' i'm using custom meta fields. They're extensive and use custom functions to process data. Now in product type [variation] i need to take those meta fields which are coming from ...
2
votes
1answer
48 views

Display custom post types with custom date field value (before today) & order by custom date field

I'm trying to display custom post types with custom date field value being before today. It works OK for showing posts before today, but the order is only based on post date. I want to have the result ...
0
votes
0answers
13 views

How to sum Formidable selected Fields in one Field togther?

Im a Wordpress developer , im building a custom Survey using Formidable Pro Plugin. I have built a custom Field that able to upload images using Media uploader from Wordpress , everything is fine ...
0
votes
0answers
81 views

Creating a “Related Meta” type field?

I need a unique meta box which can contain auto-updating elements similar to how a tag cloud would appear. Example. identifier id : animals identifier data : Dog, Cat, Horse, Pig I need to know ...
0
votes
0answers
13 views

Retrieve a specific ACF Repeater Sub field similar to a veriable

I have a veriable $journey_value = $_GET['onward-date'] != '' ? $_GET['onward-date'] : ''; And in a custom query I want to retrieve a specific acf repeater suv field simillar to the above veriable. ...
0
votes
0answers
44 views

Search for custom post type with acf fields

I am following the idea of Mayeenul Islam for creating a search for custom post types available here This link. However ,I want to use ACF repeater sub fields in the query.So,I have added another ...
1
vote
2answers
26 views

Custom fields value

I have created a custom post and on the custom field I want to give value to name field in the back end, the post hasn't created yet and I wanted to create a field with name value so that the user can ...