Questions tagged [custom-field]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Order category posts by last word of custom field

I'm trying to order a category page by the last word of a custom field that all of its posts have. The custom field represents a name, so the last word would be the last name. In the end, the posts of ...
1
vote
0answers
11 views

Calling the "wp-link-wrap" pop-up modal

When using the ACF, I noticed that the "Select Link" button calls a native modal called "wp-link-wrap". How can I call/access this modal without ACF?
0
votes
2answers
22 views

hide specific div on single.php

I've been working on WP since a week so far i've seen bunch of tutorials and videos about wp but i feel stuck and since i'm a wp noob i cant find or think any solution for a simple problem. i have ...
0
votes
0answers
15 views

Copy data from 2 different ACF custom post types with relation

I have 2 custom post type. I used ACF to make a relationship field with bidirecional linking. Is it possible after linking the posts to copy from the linked post data from one custom post field to ...
0
votes
0answers
85 views

get_field values for each post on home page using wp_add_inline_style

I can do this for single posts but not on the home page archive. When i add a meta value on the term archive edit screen, i want to use it in the home.php file to target posts in specific categories. ...
0
votes
0answers
17 views

How can I add diffrent editable text fields?

I am new to Wordpress development and created my own theme in php. My problem is, that I don´t realy know how to achieve the following: The website has diffrent areas, where custom text shall appear. ...
0
votes
0answers
22 views

Print custom field in Query Loop block

I have added a custom field with the Advanced Custom Fields plugin. I can print the content of the field on the post itself using the acf shortcode ([acf field="date"]) without issues. ...
0
votes
1answer
23 views

Listing posts with a value in a custom field

I read several posts and stack exchange answers but still cannot put the code together to work. I read the post Query posts by custom fields I have posts with custom fields, lets say "publisher&...
1
vote
1answer
25 views

How To Fix WP Query Returns Results But Shouldn't?

I have a WP Query that should return no results, but instead seems to be returning items. I'm guessing the null result is being interpreted as "return all results" but I'm not sure the ...
-1
votes
0answers
11 views

How can I add a custom field in registration form with image

I wanted to add a custom field in my registration form. So it works, it looks as follows. The passwortfield has the little image, my new field location doesn't. I added the field via Register/Modal/...
0
votes
1answer
29 views

Custom Taxonomy Search result page

I have a post type named Icons, I have a custom taxonomy named Icons Pack which have a custom field for featured image. Also I have a search form in my site for users to search for the icons they want ...
0
votes
0answers
25 views

How to get Previous Visited Page Information

I want to Change for Customized my Contact Form based on Previous URL Visited or We ca say I want to Dynamically Change the Values of Contact Form based on Previous URL Visited. So I had searched and ...
0
votes
0answers
12 views

Help with autofilling field

Not much of a dev and would prefer the simplest way to solve this please. Working on a client website and they have a entry field on the homepage where you enter a registration and then click button '...
0
votes
0answers
16 views

Add a custom field to my custom post type and then get posts which are before the given date in the custom field

Hi all "Want to do it without plugin" Firstly how can I create a custom field in my custom post type where I can get the date // Our custom post type function function create_posttype() { ...
0
votes
1answer
19 views

Delete user meta but only if found in array

I created a SAVE button that saves a page's URL to the user meta in an array. I'm trying to now create a REMOVE button but I'm finding that when delete_user_meta is used it deletes all entries in the ...
0
votes
0answers
12 views

How can i add service category here? [duplicate]

I am using a theme called StartNext on wordpress, which has an option for adding services with a specific category. It uses advanced custom fields plugin for this. But when I try to add new services ...
0
votes
0answers
24 views

What is the recommended / best way to do this: Event calendar post/type in a block-based theme?

my question is this: assume I have a php-themed WordPress site with an event calendar page template that's using post type "event", which in turn has a lot of custom fields that hold the ...
0
votes
0answers
11 views

Change word in woocommerce product category custom field

I have woocommerce shop with a large number of categories that have a filled custom field "custom_title". Each custom field has the word "Category" and I want to replace it with ...
1
vote
1answer
62 views

Get posts for which a custom field is not present, with get_posts

I'd like to get all posts for which the custom field hidden is NOT present. This does not work: $postsForSitemap = get_posts(array( 'numberposts' => -1, 'orderby' => 'modified', '...
0
votes
0answers
8 views

Post meta not working

I'm trying to set custom category and post meta but I think they are somehow blocking eachother. $post_tarjousid = wp_insert_post($post_tarjous); $category_id = 22; $taxonomy = ...
0
votes
1answer
49 views

get posts based on non-single metadata

I have meta data to custom post "event", registered as non-single, i.e., there is an array od metadata "terms" (it is not WordPress term, I just call it term, it is a record ...
0
votes
0answers
18 views

Creating a custom page post type just like the original "pages" post type using CPT UI

How can I make my custom post type (a page type) using CPT UI? What are the setting I should use? Like I need a custom "pages" section completely separate of the original "pages" ...
0
votes
0answers
16 views

Adding a location field to buddypress activity

I am trying to figure out a way for adding location to buddypress activity. I tried using "Geo my WP" plugin to add location to a custom post type but the problem is that activity is not a ...
1
vote
0answers
21 views

retrieve Meta field value from CPT and set those values as Image Meta Field "Title"

So i have a created a CPT (Car) with custom meta fields (Model, Maker, car photo ..etc) and those meta fields are being filled using a frontend form , all these has been created using JetEngine Plugin....
1
vote
0answers
19 views

Wordpress Rest API to call page data associate with custom meta

I have an ajax rest api called to retrieve certain page data, the call was success but it's come with blank meta, is there any workaround to call api associated with meta data along? var request = ...
0
votes
0answers
9 views

Problem with revisions only returning four results

I have the following query running to grab post revisions to show specific data on the front-end to users... $postType = 'items'; $metaKey = 'price'; $query = " SELECT c.meta_value,...
0
votes
0answers
19 views

how to find out which plugin disable custom field for post

I tried to enable custom field for my post but it fails to enable. Read about it online that there is an plugin for advance custom field that is causing the issue. But I am not using this plugin. ...
1
vote
1answer
14 views

Output an array of terms for a 'tax_query' => array()

I'm trying to use custom fields on the backend to set the taxonomies in a WP_Query for a category archive on the front end. In the page template. this gets my categories from the custom field: $terms =...
0
votes
1answer
21 views

how to skip a CPT element from the pager by custom field

I'm making a template that shows all the users of a CPT Family like this: <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : ?> <?php the_post(); ?> $...
0
votes
1answer
50 views

How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields

I try to make a sort of fiter for my website. Goal is for the visitors to query results by prices ('prix') and hobbies ('aimerparlapersonne'). Prices are numbers between min and max. Hobbies is ...
0
votes
2answers
36 views

Posts sortable column not sorting properly for custom field numbers

I have a custom field for view counts that are stored as numbers. I added a Views column, and made it sortable, but they are not sorting properly. The results when I click on the Views column are ...
0
votes
0answers
18 views

How to use custom slug and custom templates for custom taxonomy?

I haven't used taxonomies much, so not sure what the correct way to do this is. I have a custom taxonomy called collections. I want an archive page for this that shows all the collections. I can ...
0
votes
1answer
22 views

WP_Query orderby not work with meta_key

I want to order the post by 'leasenum' in my archive-shop.php. I want to filter the specific 'mall' . The result set is correct but the order is wrong. The orderby only works if I remove the 'meta_key'...
0
votes
0answers
15 views

Search & column order by meta value in admin

So, my posts have a custom field named "company" and I would like to have a sortable column for this field in the admin area list of posts and also be able to search posts by it's content. I'...
0
votes
0answers
39 views

Create if else for post types in WP_Query 'post__in' values

I'm trying to enable users to select individual posts by custom post type using a new WP_Query $posts = new WP_Query( array( 'post__in' => selected_posts(), 'post_type' =&...
0
votes
0answers
30 views

Add a "custom field" to a category that can be retrieved when viewing the category page with get_post_meta

I usually set a custom field customdata for posts and pages, that I can obtain when rendering a page with this PHP code: get_post_meta(get_the_ID(), 'customdata', true) Is there a way to set a custom ...
0
votes
0answers
55 views

How to set up page fields with gutenberg instead of ACF

I have always developed sites using such a development flow: Wordpress installation + a blank theme (underscores theme) + ACF. Creation of the site structure (pages, custom post types, articles, ...
0
votes
0answers
24 views

WP Query from two Custom Post type fields as statement

I have two custom post type table and reservation. Also on the CPT reservation I made three custom fields date, hour and IDtable (this meta field I made to storage ID of the table, so this IDtable is ...
0
votes
0answers
35 views

How do i create a custom post query when the meta value is an array?

A number of properties have been imported from an external API and saved into a custom post type called 'Properties'. I want to filter these properties by the city they are located in, however it is ...
0
votes
0answers
20 views

How to Print Title and Permalink of CPT Post behalf of Posts Meta Value with WP_Query

I want to print custom post type post's permalink and title on behalf of default posts custom field value. For example, default post X has CF Key Company and Value is WordPress and website has CPT ...
0
votes
0answers
20 views

wp_set_object_term via js btn frontend

Hi I just copied some code to change a post custom field term by clicking on the btn with #projects-pay-btn id and work with it on frontend as end user, but it does not working. when the user push the ...
0
votes
0answers
14 views

How to add a "base" filter for all posts visible to visitors on the site?

I'd like to filter all posts ever visible to my visitors by the posts' custom meta (box) tag value. I added a post meta box "access_required" and I want to check if the post's ...
0
votes
2answers
32 views

Update some (not all) post titles with custom field values before running the Loop

In this project, there are custom posts with a variety of titles. In each post with the title that is the name of a person (first name, last name), there is a custom field (custom_title) that can hold ...
0
votes
0answers
21 views

Sort custom post by custom field if none order by latest release

I basically want my post order first on upcoming releases and if there are non or no more I want to order them by latest releases. I would also like the upcoming book releases to be ordered by nearest ...
0
votes
1answer
31 views

Exclude URL's from sanitize_html_classes

I've searched through the similar questions but found nothing. I've coded a meta box for adding custom URL's which get added to buttons on single posts but when the URL is added to the meta box field ...
0
votes
0answers
83 views

How to add custom checkboxes from loop to WooCommerce product variation options?

I want to make a custom checkboxes in WooCommerce product variation. How to save checked checkboxes in website to use it later? After this i want to display prodcuts depends on this checkboxes. ...
0
votes
1answer
13 views

data-value for custom woocommerce field showing in code but not visable on page load

I have the code below (not written by myself) which has a li data-value populated - however this is not showing next to the date on the product page, the date is showing correctly but the location ...
2
votes
0answers
66 views

ACF won't load from a custom JSON location

I’m trying to set up local json sync with ACF on a multisite installation. It worked with the default acf-json folder in the child theme, but I’d like to save and load everything from the parent theme....
0
votes
0answers
23 views

Missing Custom Fields

Recently began working on a site I created many years ago. As part of the update, I upgraded to WordPress 5.8.1 then I changed the theme. Now I can't see my custom fields when editing posts/pages and ...
0
votes
0answers
63 views

Display custom field value in woocommerce variable product via jQurey

I try to display the custom value fields that each variation has. I use this code to display variation id and variation description: add_action( 'woocommerce_before_single_variation', '...

1
2 3 4 5
72