Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [custom-post-types]

Custom Post Types extend the WordPress back-end to support additional, non-Post content.

0
votes
2answers
15 views

Archive for custom taxonomy

I have a custom post type movies that I have defined in function.php function create_post_type() { register_post_type( 'movies', array( 'supports' => array('title', 'editor' , 'excerpt' , '...
0
votes
1answer
15 views

assign array of category to custom post type

I tried to assign array of categories to custom post type on creation, so I wrote the following code: $post_id = wp_insert_post( array( 'post_content' => '', 'post_name' => $...
0
votes
0answers
19 views

Can I manage current & past editions of an annual event with a single WordPress install?

I want to use a single WP install to build a site that will present curent and pasts editions of an annual event. From one year to the next the list of participants and the daily program change ...
0
votes
0answers
15 views

Ho to display author image dynamically as a background image?

On my puzzle website I would like to display author image on the post area as shown in the image below. The author image would be a background image. May I know how is this possible? Theme is using ...
0
votes
0answers
13 views

Count posts associated with another post type

I have two custom post types in Wordpress: Events and Venues. I need to count the number of Events associated with the individual venues and have the counts displayed in a column on the Venues page in ...
0
votes
1answer
19 views

Topic won't save for a custom post type — how to debug?

In two of my site's custom post types, the topic (in the Topics meta box -- see screenshot below) won't save. This is not a custom meta box, I don't think. At least, I think it comes standard with ...
0
votes
0answers
12 views

Woo commerce hide category descriptions

i am currently building a site on my localhost, i have descriptions of product categories but on the category product page, it shows it twice. I have tried messing with my theme and custom css to hide ...
0
votes
0answers
9 views

Hidden Form Custom Post Meta Field for Storing Post_id using PHP and save_post hook

In order to send email notifications to registered users when a new listing matches their breed and location preference, need the post_id stored in a meta field to have post_id parameter available for ...
0
votes
2answers
18 views

How can we display full post on home page rather than excerpt

I have a puzzle website where i am looking for the option to display full question on the home page rather than excerp. Just a note that questions are custom posts. Is there any way. Thanks
0
votes
0answers
16 views

Adding specific custom fields (images) to post excerpt

I am working on a simple user profile archive, using the theme "Atomic Blocks" as a starter theme. I am using one custom post type and several custom post fields to create these user profiles. The ...
1
vote
2answers
14 views

list taxonomies from a custom post type

I registered a Taxonomy for a custom post type called events. // Register Custom Taxonomy function events_categories() { $labels = array( 'name' => _x( '...
0
votes
1answer
14 views

How to get the custom post list to admin user edit page?

I want to list out some post types in the admin panel admin user section to allow the users to access from the front end. How can i get the post list in admin user edit profile section?
0
votes
0answers
12 views

link user to post, when its submitted via online form

Users can submit Events via a Custom Post Type (Form is made with the qform Plugin) - If the user does not have an account, an account is created during submitting the form. If he is logged-in already,...
0
votes
0answers
18 views

Translation in Plugin doesn't work

Hello my fellow WordPress Devs, i'm new in WordPress coding and try to code a free plugin for animal shelters. I want to create a new post type "Pets" this works absolute fine. But when i want to ...
0
votes
0answers
22 views
+50

How To Import CPT With Only Few TEXT ACF Fields From Front End?

I have registered CPT "Contacts" and I have created 3 text fields: name, phone and address. All those fields are set as text fields, and now I want to allow admins to import CPT with those fields from ...
0
votes
0answers
10 views

wp-query: order by a custom-field and get one random item of another custom-field

I have a "brand" page (ex. Nike). When I click on "Nike" page I would like to show a list of all categories of their products (ex. shoes, thirts ecc). Each category of their products is listed by a ...
0
votes
1answer
14 views

Custom post type suddenly stoped working after WordPress 5 update

I build a simple plugin that has a CPT and 1 metabox section that collect extra information from admin. It was working fine in the old version but when i just updated it to WordPress 5 it stopped ...
1
vote
2answers
32 views

Custom post type archive sorted and grouped by date in post meta field

I am trying to build an Custom Post Type for showing information about events. The Custom Post Type has name 'Event', with the following meta fields: event_startdate (date in format YYYY-MM-DD) ...
-1
votes
1answer
23 views

is it possible to keep the custom posts even users deleted from the frontend? Is there any code for function.php?

Is it possible to keep the custom posts even users deleted from the frontend? Is there any code for function.php? I want to keep the properties listings even the users from the dashboard (frontend) ...
0
votes
0answers
9 views

Create navigation that changes depending on how you get to a single page?

I'm trying to make conditional navigation along the lines of "if a user goes into the tag "foo" make sure the navigation once in the single page only goes back and forth in the "foo" tags. But if the ...
1
vote
1answer
17 views

Custom meta box not saving

I've created a custom meta box for a custom theme. The metabox appears but does not save any inputed values <?php /* @ PACKAGE 3KTECHS THEME ========================= CUSTOM POST TYPE PAGE =======...
0
votes
1answer
21 views

Batch Extract Date from post title and put into ACF custom field

I have a custom post type called 'events' with around 700 posts, the titles are consistently formatted like this: Event Title - January 1st 2019 I need to isolate the date in another field. I am ...
0
votes
1answer
13 views

show custom value from frontend form in a post (custom post type)

I am using a frontend form to create posts in a custom post type (Everything is working fine excepts custom fields). I tried for hours to figure out, how i can show custom field value from the form in ...
0
votes
1answer
27 views

is therer any wordpress function to retrieve a specific html element from post content

I am developing a wordpress blog theme and I want to use the heading1 element(tag) from post content to be used as the title for my posts instead of the default title. Actually, I want the title for ...
0
votes
1answer
14 views

Rewrite nested urls for custom post type

I have a problem with nested permalink. I have a structure of urls like that: Catalog -> Category -> Product My urls are: www.domain.com/catalogs (for archive catalog) www.domain.com/catalogs/...
0
votes
1answer
18 views

Where paramaters of a custom function are coming from inside the loop?

I have this piece of code and, although it works, I do not understand how. First, I created a custom post type into my mu-plugins folder: function actor_init() { $args = array( 'label' => '...
0
votes
1answer
29 views

WP Query Conditionally query meta and taxonomy

I develop a plugin which includes a custom post type that is displayed as a list within WP Admin. There are varying levels of users defined within the plugin and a few other options which determine ...
0
votes
0answers
31 views

filter using custom fields

I am working on a job search page. I have created job category, job location, job description and posted date using Advanced Custom Fields. I want to display the job location and category in a select ...
0
votes
1answer
5 views

How to hide sub fields in a field group and also the entire field group if the answer selected is “no”

I have a field group (repeater field type) set up (titled "Units") with sub fields; sq footage, floor plans and availability (this is a yes/no selection). I have the availability sub field to display ...
0
votes
2answers
22 views

Enable Authors in Multiple Custom Post Types

I have found the below code to enable viewing the author of a custom post type and it works perfectly for one custom post type. But I need it to work for 4 custom post types called: detox, recipes, ...
1
vote
1answer
17 views

A to Z List of Custom Post Type in three columns

I want to display custom post types A to Z Index in three columns, but it just lists the first post under each alphabet in three columns, I think there is some issue with the loop but can not figure ...
0
votes
1answer
12 views

Create 3 Levels of relations with Wordpress

I need to create this type of relation in Wordpress: A Catalog can have many Products A Product can have many Catalogs A Category can have many Products A Product can have only one Category So when ...
0
votes
0answers
15 views

How to enable VC for custom post type programmatically?

I’m creating a custom post type. Now I want to use Visual Composer with this post type by default. Is it also possible to enable VC for this post type programmatically?
0
votes
1answer
24 views

PHP question: how to combine syntax?

could someone please tell me where the mistake is in my PHP code? My PHP knowledge is extremely rudimentary although I have tried it with http://php.net/manual/de/language.operators.logical.php :-D "...
0
votes
1answer
20 views

Archieve.php not loading for custom post type

I have a post with a category of blog . So i came across with this archieve.php , whereby we can edit the layout and content of a custom post type. From what I understand archieve.php contains the ...
0
votes
0answers
23 views

Custom Post Type - Display all, wrap in groups of 3

I've got a custom post type for staff members in a project I'm working on. I want to display all staff members in a slider, with groups of 3 rotating. I need my listing to end up looking like this, ...
0
votes
0answers
20 views

How to get the text from PDF, doc and txt file

I've a custom post type called "Document" in my wordpress project which allow users to upload a PDF (.pdf), Word (.doc, .docx) and text (.txt) file. Once the user upload the file, some text of the ...
0
votes
1answer
27 views

Display both parent and child custom taxonomy / content

I'm trying to display a list of parent and children custom taxonomy and under each the title of any post associated with the taxonomy. What I have now is: Category 1 Title Title Title Category ...
0
votes
1answer
23 views

How to save contact form 7 data in Custom Post Types (CPT)

I want to store the data of contact form 7 (CF7) in a custom-post-types (CPT). There are several plugins like: https://de.wordpress.org/plugins/cf7-responses/ https://de.wordpress.org/plugins/cf7-...
0
votes
1answer
15 views

Exporting Post type from one theme and importing it to another theme

I am stuck on an issue here. I have this one theme which has the post type called 'listing' and I have this new theme with the post type 'iwp_property' When I use the Wordpress Exporter/Importer tool ...
1
vote
1answer
20 views

How to display selected taxonomies by their parent

I have a custom taxonomy as 'services' and custom post type as 'portfolio'. What I would like to do is; I want to list all the selected services under their parent taxonomy in single page. This is ...
0
votes
2answers
30 views

Hiding load more button with wp ajax

im using ajax to load more posts for custom post type using WP QUERY, now i'm having trouble hiding button if it's last post or if there are no posts left ( behaviour im getting is when i click it ...
0
votes
1answer
20 views

Add parent post to Custom Post Type

how can i add a parent post to my custom post type ? I found an example : function codex_custom_init() { // Our People $people_label = array( 'name' => 'People', 'singular_name' => '...
0
votes
0answers
11 views

Null data are being saved after validation of post in ACF

I am hooking to the acf/validate_save_post to validate the save post. // Validate the save post. $this->loader->add_action( 'acf/validate_save_post', $invoice_post_type, 'validate_save_post', ...
0
votes
1answer
24 views

Is it possible to insert text into an html tag using functions.php?

Here's what I mean: I am using a plugin called 'pods' which allows for the creation of Custom (CPT) and for relationships to be formed between those CPT's. However - there's a little flaw that I can ...
1
vote
2answers
9 views

Custom post registration causing errors

I copied this code from a youtuber. It works for him, but not for me. Does the code contain any errors? As soon as I put it in, my WordPress breaks and won’t load. function gt_custom_post_type() { ...
-1
votes
0answers
14 views

load more button in plugin

I wrote a simple plugin which creates a post type named cryptoevent and also creates a metabox that have some custom fields, I display this post type and fields with WP_Query, now I want to display ...
0
votes
1answer
13 views

Rewrite of Custom Post Type doesn't work with dynamic data

I created a Custom Post Type in my plugin. I added an argument with rewrite: 'rewrite' => array('slug' => 'foo/bar/%baz%', 'with_front' => false), Then I added a method to replace %baz%: ...
0
votes
2answers
15 views

How to display Custom Taxonomy under Custom Admin Menu?

I have problem to display custom taxonomy under custom admin menu. Custom post types are displayed properly, but the taxonomy doesn't appear. I added to custom post types: 'show_in_menu' => 'my-menu' ...
4
votes
2answers
76 views

Add class to Gutenberg Editor for Custom Post Types

I have registered a custom post type using register_post_type('myposttype', ...). On published posts, there is a custom class that gets applied to the whole body of the page, single-myposttype. I ...