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
0answers
5 views

Custom Post Permalink Change Including Parent Post

I am working on a plugin for custom posts. I need to remove the custom post slug. I used this code. function remove_cpt_slug( $post_link, $post ) { if ( 'cars' === $post->post_type &&...
0
votes
2answers
17 views

Custom post types saved as basic post

I made a custom post type filters for others post types. The slug is a concatenation like "filters-" . $custom-post-type. And the custom post type appears correctly in the menu : My problem is when ...
0
votes
1answer
41 views

Custom Post type doesn't appear in search results

I am working on a plugin where I am adding a custom post type and inserting its posts based on wp_insert_post function once the plugin is activated. The problem is that the custom post types cannot ...
0
votes
0answers
7 views

Sub user management / administrator able to see related users

Ey guys, basically i have been looking for a way in which i can allow a specific user role / administrator to list and manage only it's related users. Im not 100% sure in how to make it. Ive been ...
0
votes
0answers
19 views

How to include custom post types and custom taxonomies with WP_Query

Hi guys there any way to include or join custom post types and custom taxonomies with WP_Query below? static function &get_wp_query ($atts = '', $paged = '') { $args = self::...
0
votes
1answer
11 views

I want to create a metabox under custom taxonomy

I have a custom post type and A custom Taxonomy under the post type. But I want to add a metaboxes under the custom Taxonomy. My code is not working, Please can you help. Working Code // Register ...
0
votes
0answers
22 views

Why is this function so slow?

My client has a WP website, its a real estate site with the properties setup as custom post types. Below is my search query to filter the listings based on a search form, all fairly standard stuff. ...
0
votes
1answer
40 views

How to output and alert message when updating a post

i want to prevent a duplicate entry for a CPT, so i'm querying the db to find if the record already exists and return if get_result() is true $query = 'SELECT * FROM `wp_postmeta`WHERE `...
-1
votes
0answers
12 views

Newspaper theme: How to make blocks filter by custom post and taxonomies

By default tagdiv newspaper theme not support filter by custom post or custom taxonomies in ajax filter in blocks. Any help please?
0
votes
0answers
19 views

$_POST & $_GET from external link – how?

My light control system can send a http link when triggered. i.e. http://mysite.biz/sql.php?insert=insert&command=75869-OFF&status=0 A separate sql.php file puts the data in posts and ...
0
votes
1answer
12 views

Issue with CPT posts within WP REST API showing as []

When I am querying for posts of a CPT, I get a response of 200 but a return of brackets []. How can I show all of my CPT post data? My syntax I am using in the url is: http://mydomain/wp-json/wp/v2/...
0
votes
0answers
12 views

Have custom post type posts show under regular posts in sitemap (Yoast)

I have a custom post type called FAQs, and I'm using Yoast SEO to generate a sitemap. The sitemap gets generated like it should, but it creates a completely separate sitemap for the FAQ post type, so ...
0
votes
1answer
26 views

Convert With Custom Post Type

Instead of using a regular post with category (Properties), I created a Custom Post Type (Property). So, I'd like to convert the following code so that it's using the custom post type instead of ...
0
votes
1answer
20 views

How to add a filter to a custom post type to get adjacent custom posts via the REST API

I need to get the adjecent posts of a custom post type "projects". The custom post type works in general and I get the a projects list and single projects via GET request. In addition want to add the ...
0
votes
1answer
89 views

Taxonomy list. Order by a specific custom post type count ( Please help)

I have a custom taxonomy and two custom post types (A and B post types). I created a taxonomy list and this list also display B custom posts type count of taxonmoy. Taxonomy list is ordered by post ...
0
votes
1answer
19 views

Do not show child pages within a file page

I have a CPT created, in my CPT file page the father pages and daughter pages are shown. Books of science Book 1 Book 2 Books of science fiction Book 1 Book 2 In my case I don't want it to ...
0
votes
0answers
9 views

Limit the number of times a user can book an appointment in Timetable Schedule

I'm building a gym website using Gym X theme. For appointments, it uses the Timetable Responsive Schedule plugin. I want a user to be able to book only a limited number of times per month (based on ...
0
votes
1answer
31 views

Count custom post types with a specific meta value

We have a custom type called books. In a template, we need to show the counts of books that have the book_type as Fiction Non Fiction Novel Short Stories We use ACF Pro, and the above field is set ...
0
votes
0answers
11 views

search results to show individual ACF fields from inside custom posts

In need of some help. I have my search results showing the custom post type with all the ACF fields inside. What I want is the search result to show the ACF singularly with a field name of file_name ...
0
votes
0answers
17 views

Taxonomy shows up twice on Custom Post Type

I created a new Custom Post Type called Articles & Issues. I then created a new taxonomy called authors on this CPT. I then went into Advanced Custom Fields and created a field group called ...
0
votes
2answers
20 views

How to display singular_name of custom taxonomy?

I'm displaying list of term from each taxonomy assigned to custom post: <?php $taxonomies = get_object_taxonomies( $post ); foreach ( $taxonomies as $taxonomy ) { the_terms( $post->ID, $...
0
votes
0answers
20 views

Replace admin edit.php content for CPT

I am building a WP plugin and I want to replace the admin list page (edit.php?post_type=my_cpt) for my CPT. The CPT should not have any 'add new' buttons as new content will only be imported. The ...
0
votes
1answer
20 views

Custom Post Type not using correct page template

I've been having trouble lately in trying to figure out why this custom post type is not using the correct template file. The custom post type is called 'job' and it has a rewrite on it for the slug ...
0
votes
1answer
22 views

Returning a custom content types with meta values

I find myself facing a situation where I will have a bunch of custom post types and I want to select those with specific meta values. There is a slight wrinkle in that the value I want to select ...
0
votes
0answers
28 views

Custom Taxonomy Rewrite redirects back to home page

I have a custom post type with two taxonomies set. On my Episode CPT I have a rewrite arg set to "rewrite" => array( 'slug' => 'bctv', 'with_front' => false ). Then on my Taxonomy I also have ...
0
votes
1answer
8 views

Taxonomy doesn't follow slug permalink structure

I started with a fresh template and added a Post Type according to specification at GenerateWP. I then added a taxonomy to the custom post type, also according to the above-referenced website: // ...
0
votes
0answers
11 views

Page not found on page. How to write a rewrite rule for a custom post type?

add_action('init', 'my_custom_init'); function my_custom_init() { register_taxonomy('manufacturer', ['product'], [ 'labels' => [ 'name' => 'Manufacturer', '...
2
votes
1answer
51 views

taxonomy list display custom post count

I use $term->count to display post count but it displays the total count of all type of custom posts attached to taxonomy... I just want to display the count of only a specific custom post type ...
0
votes
1answer
24 views

Change CPT permalink to use the category

I have a CPT called teachers and a custom taxonomy called teacher type. I'm using the code below to rewrite the url for the CPT and instead of being like: website.com/teachers/post1 it changes the ...
0
votes
1answer
23 views

How to display all terms from all taxonomies in post, but separately for each taxonomy?

If I want to display all terms assigned to a custom post with custom taxonomy, I could use for eg. <?php the_terms( $post->ID, 'custom-taxonomy', '', ", ", '' ); ?> but in this solution I ...
0
votes
2answers
44 views

meta query multiple values for the same key

I'm trying to query wordpress with multiple values but it looks like it can't take no more than 4 keywords I'm currently using a loop and I already tried to switch to a IN operator but I need the ...
-1
votes
0answers
18 views

WordPress post views per location

I've been working on a WordPress theme that allows users to add a custom post type from the front end. I'm working on a new addition to the site with Chart JS, where my users can see statistics about ...
1
vote
1answer
21 views

Why my CPT does not appear on the dashboard menu when i activate the plugin?

I've added this code to my magazine.php file into the plugin, but when it is activated, the CPT does not appear in the dashboard menu. Do you figure out why? it is a really minimalistic CPT, i do not ...
0
votes
0answers
9 views

Custom archive page pagination issue

The WP Setup I created a template, broadcast-archive-template.php, that contains code that functions as a custom post type archive page. We set the page template to the template in the WP admin to ...
0
votes
0answers
14 views

Post Update Hooks with Conditional Logic based on Query String

I'm rendering a list of posts in a CPT (child for this example) inside the edit page for another CPT (parent) to establish a hierarchy. In the listing, I have links to edit and delete each child and a ...
0
votes
0answers
21 views

How to get WP_Term object properties for custom post type and custom taxonomy?

Can I get WP_Term object properties for all custom post type and custom taxonomy? Here is the code that I need to replace $categories = get_categories(array( 'include' => ...
0
votes
0answers
6 views

Looking to add a specific kind of custom post search

Recently my site changed themes. The old theme had a built-in staff directory plugin with a specialized search that had two features we now miss: It autocompleted staff member names. It allowed you ...
0
votes
0answers
8 views

Taxonomy in taxonomy permalink structure

I have a custom post type advert and two taxonomies advert-category and advert-location. By default it looks like: .../ads/advert-category/ archive for categories .../place/advert-location/ archive ...
0
votes
0answers
24 views

Remote Custom Post Type

I've got a remote source of data - customers and the items they've purchased - which resides on a different server and uses a system that's not Wordpress. But it's got a REST API I can call to obtain ...
0
votes
1answer
12 views

Wordpress wp_query() basic question about args

Can someone tell me the comparison of these three query statement: 1/ Is it nline code ? I don't know what is it call. $getposts->query('post_type=projects&taxonomy=projects_categories&...
0
votes
1answer
28 views

Use the custom post type archive for taxonomies?

Im using a archive-cpt.php template page to display all my custom post type posts but now I will be categorizing them in taxonomies. I want to add a dropdown filter navigation that will be populated ...
0
votes
0answers
34 views

Display post date with the date archive link for custom post types

i have a custom post type and every single post it displays post date like 05 Jun 2019. i show this date with this code : <a href="<?php echo get_day_link(get_post_time('Y'), get_post_time('m'),...
0
votes
1answer
18 views

Is there a function that replace category name with a icon?

I am using a Custom Post Type and I have a Taxonomy name "Type" this taxonomy have A y B taxonomy names. If possible a function that remplace the name of Taxonomy with an icon or image? Thank you!
-1
votes
0answers
24 views

How I can get custom post link by two custom taxonomies IDs

I have in loop list of taxonomies IDs and one ID of second taxonomy example: <?php if( have_rows('taste_category_settings') ): ?> <ul class="product-wrap__category--...
0
votes
1answer
10 views

Change custom post taxonomy values from front-end

I'm developing a ticketing system which already has the custom post type for the tickets with a "status" taxonomy. I have the tickets displayed in a table on the front-end and the status column has ...
1
vote
1answer
36 views

How to limit post of custom post status?

I have a custom post type 'Commercials' and custom post status 'Featured'. Now I want only one featured post. What I mean is right now I can make all posts as Featured, but I want only one to be ...
0
votes
0answers
14 views

Display all posts from specific category and CPT

Currently, we are getting all posts from a specific category using the following: $args = array( 'post_type' => array('post'), 'cat' => 1247, 'posts_per_page' => 4 ); What we'd ...
1
vote
1answer
21 views

Custom WP Query on custom meta and sort by multiple meta keys value

I am testing something out and I have a query like this: $paged = 1; $filter_min_price = 5; $filter_max_price = 300; $products5_cat_term_id = 368; $filter_brand = "Now, Garmin"; $sort_order = "ASC"; ...
1
vote
1answer
18 views

Can I override a CPT template on a per post basis with Gutenberg block editor?

I have a CPT defined in code called event, and there is a template file for the markup (single-event.php). I am wondering if it is possible to override a post within the Event CPT with the Gutenberg ...
0
votes
0answers
12 views

show count and sort by curtain post type in taxonomy list

i have a taxonomy list with post count and it sorted by post count. but i want taxonomy list to show only curtain post type count and sort by ount of this post type this is my code function ...