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

Questions tagged [custom-post-types]

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

0
votes
0answers
5 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
4 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
13 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
11 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
23 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
13 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
23 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
20 views

Job search 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
4 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
19 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
11 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
19 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
22 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
25 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
19 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
28 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
19 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
12 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
71 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 ...
1
vote
1answer
19 views

Meta Query Filtering not working on Custom Meta Box using Radio Buttons

I have a custom post type called "bids". I'm trying to get the loop to filter posts according to a meta_query. The query should allow for only posts that have the radio button with the value "open" ...
0
votes
1answer
21 views

Make pagination work as a carousel (custom query)

I'm using a custom query on my static front page in order to show my posts, but I would like my pagination to work kinda like a carousel (instead of loading an entire new url). So, basically I want ...
0
votes
0answers
33 views

Permalink structure custom-taxonomy-slug/cpt-slug breaks ability to have subpages and pagination (404 error)

I took over a WordPress project from another programmer, who wrote code to create the permalink structure "custom-taxonomy-slug/cpt-slug", the custom taxonomy is "city", the cpt is "restaurant", so ...
1
vote
1answer
27 views

Query Post Object in WP Admin

How can I fetch the details of the $post object of the very post that I'm working on in WP admin? I've tried global $post but I believe that $post is not available during editing. A little context: ...
0
votes
1answer
7 views

Removing full title and breadcrumb header container for a specific post type

I have been looking around at how to remove the header container but only for a specific post type with php in the functions.php file of the child theme. For example, portfolio or events. Is this ...
0
votes
1answer
16 views

Showing Custom Post Type with his templates on a custom page template

So here's my question: I need to build a custom post type to add employees to a website. The problem is, it need to be shown: 1 - Image on the Right 2 - Image on the Left ... and so on. For this I ...
0
votes
1answer
22 views

Get id from metabox dropdown

Im using Reusable Metaboxes (old but still works) and I created a metabox that allows the user to pick a post from a list of custom post types. Right now that works pretty well, I can see all the ...
0
votes
0answers
21 views

Custom Post Type as a Taxonomy

I have a CPT "Locations" and would like the CPT to also be a taxonomy for ALL other posts/post types. The main point is to have the taxonomy always match the CPT "Locations" without having to ...
0
votes
0answers
13 views

Update checkbox value from clicking button

I have a CPT and in the columns section, there is a button. I have a checkbox in my custom meta box and it is hidden. But when the checkbox has been clicked the text of the button and color will be ...
1
vote
2answers
96 views
+50

How to load custom post archives sub-pages with ajax?

I'd like to keep the pagination links for /page/2/, /page/373/, etc but instead of changing the URL on the browser i want everything to load on the archive main page. Ideally all those paginated URLs ...
0
votes
0answers
9 views

WordPress membership Site for displaying products

I am trying to build a WordPress membership site where users can create stores to post items they want to sell or exchange. The items are solely for catalog viewing only and the item owners are ...
0
votes
0answers
29 views

How to set this permalink structure? /custom-taxonomy/custom-post-type/post-name

I'm coding a WordPress website for a festival that takes place in several cities. My custom post type is events and the custom taxonomy is city. I would like to have a permalink structure like this: ...
1
vote
2answers
29 views

Change post featured image on hover

I've almost finished my first custom theme for a website. I've created some custom post type to manage a portfolio and a staff member section. No problem with the code, but the client asked if is it ...
0
votes
0answers
19 views

Show Post columns to specific users on condition

I have a CPT called Topics. And admin or editor can only make topics and It can be assigned to authors. I have a meta box where there will be a list of authors and Admin/Editor can choose whom to ...
0
votes
0answers
26 views

Bulk trashing post 'fails'

I want to bulk delete child posts of a custom post type, and I've made it work. I'm in class context: // In a register method which registers all hooks. add_action( 'wp_trash_post', [ $this, '...
0
votes
0answers
27 views

Custom Post types categories are creating additional page indexes but pointing to the same archive

This is a little hard to explain, so here goes. Have a WordPress site with a Custom Post Type - "Servies". Which has (example) 3 categories. What is happening, is that the Google are indexing ...
0
votes
0answers
9 views

update custom taxonomy with Ajax in edit.php file

I created Custom Psot Type and Custom Taxonomy. I recover, for each CPT element its custom taxonomy. here is a screenshot: now , i want update the coustom taxonomy for the CPT element with ajax ...
0
votes
0answers
10 views

How Can I Save This Re-order action?

I have a code that I'm working on to enable a user to manually order posts in a custom post type, a lot of the code I basically copy-pasted from an already-existing plugin that has this functionality, ...
0
votes
0answers
8 views

Search for custom post type with autocomplete not working

I have a custom post type of show and I am trying to create a search input where the following occurs: User can start typing a few letters and auto completed suggestions (based on the post title) ...