Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 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 = ...
user avatar
0 votes
1 answer
24 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. ...
user avatar
0 votes
0 answers
14 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 ...
user avatar
0 votes
1 answer
46 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 ...
user avatar
  • 119
0 votes
1 answer
25 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 ...
user avatar
  • 29
0 votes
1 answer
32 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 ...
user avatar
0 votes
0 answers
23 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 ...
user avatar
  • 1
0 votes
0 answers
63 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 ...
user avatar
0 votes
0 answers
20 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 ...
user avatar
0 votes
1 answer
23 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 ...
user avatar
1 vote
1 answer
26 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,...
user avatar
  • 9,947
0 votes
0 answers
17 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 ...
user avatar
  • 101
0 votes
0 answers
12 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 "...
user avatar
  • 105
0 votes
1 answer
19 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 ...
user avatar
  • 7,625
0 votes
1 answer
73 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 ...
user avatar
0 votes
0 answers
23 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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
1 vote
1 answer
25 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 ...
user avatar
0 votes
0 answers
26 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 ...
user avatar
0 votes
0 answers
29 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 ...
user avatar
0 votes
0 answers
38 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 ...
user avatar
0 votes
0 answers
45 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 ...
user avatar
0 votes
1 answer
161 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: <?...
user avatar
0 votes
1 answer
24 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 ...
user avatar
  • 105
0 votes
0 answers
18 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 ...
user avatar
  • 67
0 votes
0 answers
13 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 ...
user avatar
0 votes
0 answers
18 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( '...
user avatar
0 votes
1 answer
16 views

WordPress custom taxonomy not showing

I have a simple custom Taxonomy register_taxonomy( 'categories', array('career'), array( 'hierarchical' => true, 'label' => 'Departments', 'singular_label' => '...
user avatar
  • 105
0 votes
1 answer
171 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 ...
user avatar
0 votes
0 answers
12 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://...
user avatar
  • 21
1 vote
0 answers
26 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 ...
user avatar
0 votes
0 answers
19 views

How to set a 'page' as parent of a custom post type?

For various reasons, I would like to use a 'page' in preference to an archive page for one of our custom post types and have this be reflected in the permalink structure. I am struggling to find out ...
user avatar
0 votes
1 answer
59 views

Query multiple taxonomies with pre get posts

I am trying to query a custom post type based on what a user inputs into a form, I am having trouble querying multiple taxonomies in pre_get_posts filter, I can't seem to find a way to set the query ...
user avatar
0 votes
0 answers
34 views

conditional filter

I'm trying to set up a filter that shows upcoming events (if any) or shows past events; function events_function($date_args){ $date_args = array( 'post_type' => 'evento', '...
user avatar
  • 1
0 votes
1 answer
29 views

Template for custom post type when taxonomy is in the URL

I have custom post type called books. This has a category taxonomy, called book_types. So, for example: Books -> Fiction -> Da Vinci Code Custom Post Type: Books Custom Taxonomy: Book Types (...
user avatar
0 votes
0 answers
41 views

Orderby meta_key/meta_value not displaying anything, am I overlooking anything?

I have an issue with my orderby using get_posts(). I want to order in alphabetical order a list by city name using a custom meta field, but it comes back empty. However when I orderby title, the list ...
user avatar
0 votes
1 answer
28 views

Restrict access to custom post type based on its taxonomy terms

I'm just beginning to understand the roles and capabilities in Wordpress and I'm not sure that I can do what I would like. I have a custom post type, "cats", that has specific taxonomies ...
user avatar
0 votes
1 answer
39 views

CPT permalinks Rewrite

Someone please can help me to change my Cpt permalink. i'm using JEtengine cpt, does the permalink structure can be changed from www.example.com/request/post_title to www.example.com/request/post_id ? ...
user avatar
  • 1
0 votes
0 answers
12 views

Page that lists publications by classifying them by taxonomy

I need a little help writing code. I have an "artists" CPT I have an archive-artists.php page with the code below, but I would need to add a "year" taxonomy. And that my artist ...
user avatar
0 votes
0 answers
15 views

Custom Taxonomy and Categories

I am getting up a site in Wordpress to show tours in countries. I have setup countries as categories and subcategory’s. Europe/Italy/Rome Asia/China/Shanghai I have also setup tours as a custom ...
user avatar
0 votes
1 answer
25 views

finding and using post type fields in Wordpress

Sorry if this question is repeated, i asked on stackoverflow before but then i found out this place and got a message to wait before posting again, maybe it was just a bug. I am working on a premade ...
user avatar
0 votes
0 answers
35 views

How to use pre_get_posts on archive page custom post type

I'm trying to use pre_get_posts to modify my post display request. The posts I want to display are custom post types. I am in a custom page template. I have this is my functions.php function ...
user avatar
  • 1
0 votes
1 answer
29 views

get_query_var('paged') return 0 in custom category page

I want to make a pagination for my category page (category is related to custom post type) But I can't get current page because it returns 0. $term = get_queried_object(); $paged = (get_query_var('...
user avatar
1 vote
0 answers
45 views

Cannot add custom field to "orderby" parameter in Rest API

My goal is to order a list of stars based on their distance from Earth, so I have created a "distance" field. The “distance” field is a meta field I’ve added. Looking at the WP API endpoints,...
user avatar
0 votes
1 answer
27 views

custom filtering admin columns

i'm trying to add custom filters to a CPT job-offer, for example, i'm starting by locations. the filters works fine except when i try to filter by all locations. this is my code function ...
user avatar
0 votes
1 answer
20 views

users post count

I'm trying to set up users archive pages; I notice that, if a user exists and is the owner of a custom post, it doesn't have an archive page; so I looked inside user.php in order to include custom ...
user avatar
0 votes
1 answer
49 views

Give active class to current page on a while loop WP query for custom post types listing

I have a single-programs.php page and at the top of this single page I need to list all the entries from the custom post type "programs". Is there a way to give "active" class to ...
user avatar
0 votes
0 answers
37 views

custom taxonomy pagination 404 error

I know this question has been asked a lot, and I have been searching for solutions and trying what I found but I am still having issues. When I click on page 2 I get the 404 error For example, I have ...
user avatar