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.

1
vote
1answer
20 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
22 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
36 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
17 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
23 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
22 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
98 views

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
31 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
1answer
16 views

update custom taxonomy with Ajax in edit.php file [duplicate]

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
11 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
9 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) ...
0
votes
0answers
13 views

SQL Query to delete featured images in particular post type within a specific date range?

I saw this answer... Query to delete all featured images and remove post meta? ...but it deleted ALL featured images and post meta. I would like to do the same for all "events" posts created by ...
0
votes
1answer
29 views

Custom Post Type archive page listing a 404 or single post

I want to preface this by saying we HAVE tried saving and re-saving the permalinks structure. We are developing a custom theme and have a few custom post types in our theme. An example of one of them ...
0
votes
1answer
35 views

Do not load the categories in Category.php

I have a CPT and each post has categories and sub categories. When I enter the Category.php page this does not print any post. <?php get_header(); ?> <div class="row"> <div ...
0
votes
1answer
31 views

Programmatically add custom field to post_name in a custom post type

I have a simple custom post type set up for Events. I'm using Carbon Fields to add a Start Date field which I would like to include in the post_name. For example: http://example.com/events/20190401-...
0
votes
1answer
22 views

Displaying Custom Fields from Custom Post Types [on hold]

I've been looking everywhere and still don't understand how to display the information from some of the Custom Post Types on my site (took over the site for a new client). The previous developer had ...
0
votes
0answers
10 views

Pretty Post Type/Taxonomy URLs for Archives While Keeping Post Type/Post URLs Intact

This question expands the following: Permalinks: custom post type -> custom taxonomy -> post This works all well and good... however, I have an existing site that I'm trying to improve and, ...
0
votes
0answers
13 views

How to order WP_Query by parent for hierarchical Custom Post Type?

How can I get all items under specific parent and order them by menu order in hierarchical Custom Post Type? Lets say I have this posts structure: Fruits Apples Bananas Plum Cherry Vegetables ...
0
votes
1answer
18 views

Custom taxonomy not showing up when adding a new custom post type

I added a taxonomy and custom post type, but for some reason, my taxonomy isn't showing up when I add a new marker. I half expected it to be there like when selecting a category for a post, but it isn'...
0
votes
1answer
23 views

Wordpress API for custom post types returns rest_no_route

I created a custom post type and I am trying to get the posts from it using WP-API, however, when I try to access the API I get the error rest_no_route message. The set up for my custom post type is ...
-1
votes
1answer
11 views

How to manage a bookstore

I am planning to make a bookstore website with Wordpress. Can you give me some advice to manage my store? I'm not sure whether to choose Custom Post Type or Custom Taxonomy to manage the authors of ...
1
vote
1answer
13 views

How to create shortcode to display custom field value on a custom post type

in my ad site I was trying to create shortcode of some custom fields I created on a custom post type. I'll explain In the single post, there are the custom fields and are shown in a standard way in ...
0
votes
0answers
9 views

How to clone Media custom post type?

I'd like to have clone of Media custom post type to let user manage his pictures easily. Is there any way that I clone it? I want the same panel, same edit/upload system only changing the post type ...
0
votes
0answers
16 views

single-{post-type} page in front page of wordpress

I create page custom post type services.it will show me front page of wordpress when i create single.php or single-services.php in wordpress,it will not move single-services.php ,again come back front ...
0
votes
0answers
14 views

Change picture attachment meta of all occurrences of a picture

I have a custom post type with multiple body copy boxes. I want to achieve the following. Add an image attachment to one body copy box. Add the same image to another body copy box by selecting it ...
0
votes
1answer
24 views

Get all posts for custom taxonomy term

I have a custom taxonomy how-to-guide-type and I have some terms setup in this taxonomy. I want to display ONLY the posts assigned to each taxonomy term. I have the following but I can only seem to ...
0
votes
1answer
38 views

Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?

I have a custom post type called "equipment". I would like the permalink structure to be: example.com/equipment/%post_id%-slug I specifically want it to use a dash and not a slash (i.e. - "id-slug" ...
1
vote
2answers
24 views

Adding Meta Boxes while Registering a Post Type in a Class

I am trying to add a few meta boxes for a Custom Post Type through a Class. I am using the "register_meta_box_cb" parameter while registering the Custom Post Type to specify the callback function for ...
0
votes
0answers
24 views

$_POST from a Meta Box

From my reading, the editor page of a post is wrapped in a form tag meaning a standard HTML form won't work within a Meta Box. What I'm trying to achieve is a meta box with two fields e.g. Name & ...
1
vote
1answer
27 views

Display a grid of taxonomy terms at root taxonomy page

I’ve used WordPress for years as a content admin but I am new to PHP development (am fine with HTML/CSS). From Googling about and experimenting I believe that what I want to achieve isn’t standard ...
0
votes
1answer
114 views

“A post type mismatch has been detected” Error when updating custom post

I have started getting this error when updating a custom post type on a clients site. I've never seen this error before and can't find any reference to it in Google search. Can anyone point me in ...
0
votes
2answers
57 views

Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post

I am building a custom post type and its respective custom taxonomy. Here is the code: add_action( 'init', 'register_my_types' ); function register_my_types() { register_post_type( 'help', ...
0
votes
2answers
19 views

WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category

I'm trying to do a single WP_Query to get the posts that are in 2 different custom post types but the second post type has to be from a specific taxonomy. This is what I'm currently doing: $...
0
votes
0answers
23 views

Implement AJAX load more button in custom post loop

I need help implement a load more button in some custom loops in my custom wordpress theme. I'm experiencing some problems in the final step, I'm not able to print the function. This site is a ...
1
vote
1answer
29 views

wp_query to find posts by year and month

I need to create sorting by year and month of custom post type in taxonomy archive page. Like this: Here is shown year, if post exists in that year. And Highlighted month if post exists in that ...
0
votes
1answer
17 views

Redirect Custom Post Type from Child Taxonomies

I have created a Custom Post type and its own respective taxonomy. I have for example this URL structure: http://www.example.com/faq/category/sub-category/test-post/ The same content can also be ...
0
votes
1answer
21 views

Unknown Post Meta Records

I inherited a site that has had many developers. There are post meta custom post type records for custom post types that we do not have. They appear to have come in through an import when the site was ...
0
votes
2answers
21 views

Loop to display custom post type from a custom Taxonomy

I have created a post type and a taxonomy for this post type . After I create a page to display all taxonomies for the post type. When i'm click on one of the taxonomy displayed I would like to show ...
1
vote
0answers
48 views

How to filter by custom post type on Gutenberg "Latest Posts' block

When adding the "Latest Posts" block within Gutenberg, is it possible to filter by custom post type? Here are the options I can see: Would I need to create a custom block for this type of ...
0
votes
1answer
28 views

Add content to wordpress edit.php page

I want to add some content, in the top or bottom of the wordpress edit.php page for a custom post type. What is the right filter or way to do this ?
2
votes
3answers
76 views

WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts

I have a custom post type "projets" that is using the category taxonomy (so it is sharing categories with regular posts). When I call WP_Query like this: $args = array( 'post_type' => '...
0
votes
1answer
23 views

Classic editor showing in Gutenberg when creating a custom post type

I'm building a theme using Gutenberg for the first time. In the past, I've built custom post types like this: // Register Custom Post Type function custom_post_type() { $labels = array( '...