Questions tagged [custom-post-types]
Custom Post Types extend WordPress to support additional content.
10,063
questions
0
votes
0
answers
9
views
Adding /blog in front of single posts (only)
I would like to add /blog in front of the url for a single post:
e.g.
website.com/blog/news-article -> single article
website.com/blog -> blog archive (showing a list of all blogs etc.)
Ive ...
0
votes
0
answers
14
views
Limiting actions only to edit.php page for specific custom post type
Excuse me if something like this has been asked before. So, I'm trying to alter the query which displays the posts of a custom post type, but on the admin side, more precisely, the edit.php page. This ...
0
votes
1
answer
25
views
How do I disable the built-in editor and automatically configure the properties of new pages?
I use a Builder plugin on the site. Members are editors and can create their own page. I want to disable Gutenberg so that they can only edit pages with Buldir. I would also disable the properties of ...
0
votes
1
answer
13
views
How to make a post accessible from multiple post type slugs?
I have two custom post types
colors
shapes
I have a post called "red" under the custom post type "colors". The default URL for this post would be
example.com/colors/red
Now I ...
0
votes
0
answers
47
views
Archive page of taxonomy returns a 404 error
I'm trying to create a template file for a custom taxonomy archive page but I keep getting a 404 error when trying to access that archive page.
Basically something like: domain.com/quizzes/quiz-levels/...
0
votes
1
answer
23
views
date_query empty results with custom post type
I am trying to use get_posts to return data between certain dates but I always get an empty result even though there is a lot of data. This is for a custom post type.
$args = array(
'post_type'...
0
votes
0
answers
18
views
how to apply snippets id in cmb2 text fields?
**
How can I add the conditions so that if the checkbox is enabled then the value of the text box is passed ? And Snippets ID WORK ? **
Why is it that supplying an ID in text fields does not work ?
...
1
vote
1
answer
29
views
Filter post by current 2 differents users id
I'm filtering my custom post type based on author. I want all users to be able to:
1 - in the list everyone can see the posts created by the admin.
2 - users can also see their own posts in the list, ...
0
votes
0
answers
19
views
Should I use a custom post type or a custom taxonomy when creating a relationship? [closed]
I'm developing my own event plugin where I want to give the user that creates the event the ability to book different resources (conference rooms, projectors etc) in relation to the event. The user ...
0
votes
0
answers
7
views
Multiple categories assigned to a single product breaking the breadcrumb
custom bread crumb not working with multiple categories assigned to a single product, we do not have the categories page, so don't want to show categories in the URL, but need to show the categories ...
0
votes
1
answer
33
views
Setting Parent Page to Post
Does anyone know how to achieve different parent pages for posts?
I've managed to code a Custom Post Type that sits under a specific parent page, but I want the option to change this from post to post....
0
votes
0
answers
25
views
redirect after submiting post for review
I have a frontend page that allows "Tutor Instructor" role, to create a course and this course is a custom type post called courses, when the Tutor Instructor finishes creating the course he ...
0
votes
1
answer
29
views
Insert Custom Post Types
I am learning WordPress plugin development. I need to insert Custom Post Type. I registered custom post type using register_post_type(). I am getting below Form when I would like to insert a New ...
0
votes
0
answers
16
views
Having a repeating custom field in admin custom post type, what I'd go better with, for DB's sake? ACF repeater or query a different post type?
I have:
A main custom post type - 'Cards' - each post showing its ACF repeater custom field - 'operations' - with the following sub-fields: 'add/remove', 'amount, 'value', 'date'.
Let's say the fully ...
0
votes
1
answer
24
views
How to inherit field value from parent post into in child / sub post
I have created a custom post type, called 'centres'. This CPT is hierarchical, ie, I can create child pages under each custom post.
Centre1
Location1
Contact1
Centre 2
Location2
Contact2
I've ...
0
votes
1
answer
17
views
Create field of Custom Post Types
I am using below code to create Custom Post Types.
$supports = array(
'title', // post title
'editor', // post content
'author', // post ...
1
vote
1
answer
16
views
Very simple wordpress block to display posts from an api call
I've been banging my head on this for a bit now.
I'm trying to create a simple wordpress block that fetches custom post types from the rest api, then displays the fetched posts via react. It only ...
0
votes
1
answer
26
views
Dynamically insert code to custom post type loop
I need to display post from custom post type name "film", from a specific taxonomy "Horror."
Everything work fine when I type the taxonomy directly like this:
<?php $blog = ...
0
votes
1
answer
20
views
how to show records that don't have custom meta value
Running pre_get_posts, I want to order the items by a custom meta value. The problem is that by default this doesn't exist. Only if a user performs a certain action does the meta key/value get added.
...
0
votes
0
answers
12
views
How to have multiple search result pages in wordpress with taxonomy terms listed
I am using a custom theme which has custom post types. First one is Doctors another is Hospital. Both doctors and hospitals have a common taxonomy named specialities. Each speciality has some services ...
0
votes
1
answer
17
views
How can I add a shortcode to query Custom Post Type with ACF in Wordpress?
I am building a website for a client, and I needed to build a game release calendar using Custom Post Type and Advanced Custom Fields. Everything is built out, but the last step.
I need to be able to ...
0
votes
1
answer
21
views
Custom Post Types not queried in Custom Taxonomy archives or Native archives
I have declared a selection of custom post types as an array, allowing post_tags but not categories:
// Add Multiple Custom Post Types
add_action('init', 'all_custom_post_types');
function ...
0
votes
1
answer
31
views
Admin slow on Postlist (over 30k Posts in Database)
we have a Site with around 20k Posts in the normal postlist and another 10k in other CPT.
The custom post types work really fast, but the normal Post List doesn't.
I assume that might be because the ...
0
votes
0
answers
22
views
How to implement very unusual wordpress routing structure?
Been trying the last two weeks to setup an unusual routing structure for a WordPress website but cannot manage to make it work.
Basically there is a custom post type that will get the post url based ...
0
votes
0
answers
19
views
How can i show ACF in post excerpts
I am using a custom post type and would like to show Advanced Custom Fields in my blog module (Divi). I think i should go and load that values from ACF in the post excerpts. How should i do this?
I ...
0
votes
0
answers
14
views
Best method of implementing compartmentalized custom post types on a multi-site network
I'm aware that there are many different ways to implement custom post types on a multi-site network, however, I'm unsure as to the best method to do so for my application. I have a website with ...
0
votes
1
answer
20
views
Custom post type category link redirecting to 404 page
I have created a custom post type. There is no issue with post and it's working. I am getting issue in the catgory links. When i click on the Category name it's redirecting on 404 page
I am getting ...
1
vote
1
answer
11
views
Parent field missing from custom post type in the block editor
I have a hierarchical custom post type, but the Parent field is missing in the block editor sidebar.
register_post_type( 'guides',
[
'public' => true,
'hierarchical' => true,...
0
votes
0
answers
13
views
How to order query results based on if a custom field has been populated, then the order by the date of the post?
I am trying to custom sort a query for product posts (custom content type) based on if a specific ACF custom field for a product ID number has been populated. My client wants to feature products with ...
0
votes
0
answers
10
views
Change Dropdown jQuery to show/hide but with default place holder that shows all
How to set the jQuery so if default "Department" is selected show all, and only hide all else one other section made.
for example, if non selected will be "Department", if "...
0
votes
1
answer
18
views
Get List of Terms based on a given term (different taxonomy)
I have two taxonomy and a post type.
Post type: Employee (employee)
Taxonomy: Location (term example chicago, id 1)
Taxonomy: Job Title (job-title)
I want to list all job title based on a ...
0
votes
1
answer
71
views
order the meta query results by 2 custom fields
I have a custom post type 'brewery', I want to fetch results by 2 custom fields. The desired result is to get all posts with highest review rating (value is in decimal like 4.2 or 4.8) and if few ...
0
votes
0
answers
20
views
Add rewrite rule for custom post type single page
I am new in the WordPress and I do not know how to convert query parameter as URL for custom post type single page. I do not want to change any affect result of single.php.
Just want to convert below ...
0
votes
0
answers
9
views
Disable permalinks, but allow RSS feeds
Have a custom post type event that needs an RSS feed (/feed/?post_type=event) but should not generate permalinks (/events/title-of-post).
Problem is that the publicly_queryable argument for ...
0
votes
0
answers
10
views
How do I rewrite /blog/ slug in URL to '/' in a WordPress custom type post [duplicate]
I have developed custom type post in wordpress and it's working well. But when you try to post an article its displays /blog/ slug URL example https://example.net/blog/best-construction-company. And ...
0
votes
0
answers
6
views
How to custom post type in wordpress different style Types category
I want to customize the posts for each category to be different. but I can't do it, can you please take a look at me, where is my mistake?
For example, I have 2 categories.
1 window 2 android
I want ...
1
vote
1
answer
23
views
Add custom taxonomy to post content body?
I've built a CPT that has three different custom taxonomies, I've also built a custom search form that has fields for each taxonomy, and a field for "search by keyword".
I want the taxonomy ...
0
votes
0
answers
15
views
Get Posts List of Current Selected Custom Taxonomy in Shortcode
I have a custom taxonomy called Album Link (album_link). I created this so I could link all music that has the term e.g (Glorious Album) to an album post type that uses the same term.
The goal here is ...
0
votes
0
answers
14
views
Wordpress REST API V2: "{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one."
I am trying to use the V2 REST API to filter a custom post type by a custom taxonomy, and if I try to specify the custom post type parameter, the request fails. I understand what the response is ...
0
votes
0
answers
28
views
Create an user checklist system for a course plateform using ACF Pro and ACF Extended
I'm currently trying to develop a learning plateform on my website and I want to integrate a system allowing users to check a list of step defined for each course.
I don't have heavy PHP skills to be ...
0
votes
0
answers
43
views
Custom taxonomy terms as children of multiple custom post types
I'm about to start a part of my project that I've been putting off for too long. I'm not looking for code, I'm looking for confirmation that I'm on the right track and any advice Stackexchange may ...
0
votes
1
answer
36
views
Sticky option for custom post types without using custom fields or plugins
The problem
WordPress supports the sticky option with some of its default post types and doesn't provide any option to extend this to other post types. It's hard-coded in the met-boxes.php file:
<?...
0
votes
1
answer
23
views
Show current custom taxonomy
I have a custom post and custom taxonomy my taxonomy is called "department"
i have my loop showing my custom post, I am trying to also show all the departments (custom taxonomy) that my ...
0
votes
0
answers
17
views
CPT archive with WP native/core tax/categories
So for some reason this is oddly difficult. I need to have a CPT which uses the core categories between the CPT reviews and core posts as news.
I've tried getting the CPT archives as just URL which is ...
0
votes
0
answers
12
views
How to get next post link of child custom post type from parent post and get next post link of parent post from the last child post?
I have a custom post type with this structure:
First Parent
1st child of First Parent
2ndchild of First Parent
3rd child of First Parent
Second Parent
1st child of Second Parent
2nd child of Second ...
0
votes
0
answers
13
views
Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
Im trying to do so, it works but also affects all other cpt (404 for all cpt but not resources one)
this is what I have
In the cpt definition
...
'rewrite' => array(
'...
0
votes
1
answer
14
views
WordPress custom taxonomy not showing
I have a simple custom Taxonomy
register_taxonomy( 'categories', array('career'), array(
'hierarchical' => true,
'label' => 'Departments',
'singular_label' => '...
0
votes
1
answer
32
views
ACF - Retrieve custom taxonomy from a relationship field
I have a custom post type, called prognosis with 3 custom taxonomies, Country, Competition, and Sport, I've also added a few ACF custom fields. I have another custom post type called analysis with an ...
0
votes
0
answers
10
views
Duplicate slug/permalink issue while adding same post name
I have my permalink format set to /%taxonomy%/%postname%/ and I have books custom post type with Genre as a custom taxonomy.
But the main problem is it is not allowing to add the same post name
http://...
1
vote
0
answers
25
views
Custom post query with multiple fields with number values. Totalisation needed
The following code gives me several tables (sorted by category) with custom fields and number values. What I need now, is a totalisation at the end of every table. How can I do that? Thanks!
<div ...