Questions tagged [custom-post-types]
Custom Post Types extend WordPress to support additional content.
10,287
questions
0
votes
1
answer
30
views
coloring row's background based on custom field value
i am using acf , in admin dashborad i have post type called Requests , i want to set background color based on column value called status , like
if the status is approved the row should be green
if ...
1
vote
1
answer
24
views
How can I incldue a "private" post type in a loop for public users?
I have a post type that I've registered using "public" => false, "publicly_queryable" => true, because I don't want singles, but I do want these posts to show up on a custom ...
0
votes
1
answer
84
views
Add post id to url instead of WordPress default -2 suffix
I have a site where Posts in a Custom Post Type will have the same title. Per default WordPress will add a number after the url to handle this but I would like instead to always include the post id ...
0
votes
0
answers
108
views
Custom URLs between different post types, using "Pods"
Setup
I am using the plugin Pods, and I have created 2 custom post types: location and office.
The URLs to access these resources are, for example:
/location/new-york (for locations)
/office/my-ny-...
0
votes
0
answers
14
views
How to add categories to a custom post type using wp_insert_post($new_post);
I have a custom post type 'memberfile', and a function for users (members) to upload files. Uploaded files are automatically posted as a 'memberfile' post in the backend.
In the form for uploading the ...
0
votes
1
answer
89
views
Can't add custom post type archive page to menu
I cannot add this custom post type archive page to any menu from the admin. Adding via the front end customizer works fine. Viewing the archive page on the front end also works fine.
My custom post ...
0
votes
0
answers
15
views
An script/Plugin for automatic page creation per term
My site is such that it introduces the devices and displays their specifications (something like WooCommerce but without the ability to buy), I have 2 Post-Types named "Devices" and "...
0
votes
0
answers
24
views
Modify permalink of CPT archive to support two taxonomies
there are hundreds of questions like these but some outdated and some are just bloated with code, hope I can make things simple.
CPT Slug: resources
Taxonomy Slug: language
Taxonomy Slug: program
I ...
0
votes
0
answers
38
views
Admin user get message higher level of permission to edit taxonomy
i can't edit taxonomy even i created wp-admin/edit-tags.php?taxonomy=portfolio-filter&post_type=portfolio
message show
0
votes
0
answers
14
views
Categorizing Custom Posts in Bulk Based on Title
I'm working on the website of a client who used pages for every type of content in their not so small website. What they've done is created 400 pages for different projects they have interacted with. ...
0
votes
2
answers
239
views
Permalinks for Custom Post Types and Taxonomies
I've been trying to figure out how to achieve a particular permalink structure to no avail. Here's the situation:
On my site, I have one main custom taxonomy (module). I have five custom post types (...
0
votes
0
answers
17
views
How to develop Knowledge center in WordPress Website
I need to develop Knowledge Center Concept in my Website, where I can Publish Blog Posts, Case Studies, Customer Success Stories, Info-graphics & Whitepapers etc.
How can i develop such concept in ...
0
votes
1
answer
58
views
Why does wp_generate_uuid4() timeout?
I'd like to generate unique titles if it's missing. When using wp_generate_uuid4(), it returns a 504 error. Here's the snippet of the code:
$custom_post = ( get_post_custom( $post->ID ) ? ...
0
votes
0
answers
12
views
Group search results by post type, but having a unique heading for each section?
I've been struggling to make it work. This code works and returns search results separated for each post type, however I would like to have a unique heading for each section and style it, currently it ...
0
votes
0
answers
40
views
How do I display custom post type data in Team Table?
// Define custom post type
function team_post_type() {
$labels = array(
'name' => __('Team'),
'singular_name' => __('Team'),
'add_new' => __('Add New'),
'...
0
votes
1
answer
212
views
Delete Term from Custom Taxonomy using wp_delete_term isn't working
I have created custom taxonomy called program using Custom Post Type Plugin. I want to create functions using add_action that can create and delete term which has the same name as the post ...
0
votes
1
answer
100
views
Dynamic WordPress rewrite rules for multiple custom post types
I'm very new to WordPress development and would like some pointers if this is possible.
So I have this rewrite rule for my custom sidebar in functions.php:
add_action('init', 'cpt_rewrite');
function ...
0
votes
1
answer
8
views
strange issue with get_post_type() when using it in a shortcode in text widget
I have a simple shortcode to show post_type slug when I needed.
when using shortcode in text widget:
-in "post_type single page" it's working
-But in same sidebar and same widget in "...
0
votes
0
answers
32
views
using jetbooking for multiple custom post types
I'm using jetbooking to book Rooms in my website but now I want to create another custom post type "Cars" but jetbooking is allowing me to link only one custom post type
what should I do?
1
vote
2
answers
53
views
How to display *block number* instead *date value* on Wordpress posts?
Ideally, the goal is to show the block number (ie: 782667) instead of the date value (ie: 26 March 2023 4:44PM CT) on all wordpress posts and pages that currently display it.
There's maybe a script we ...
1
vote
1
answer
54
views
Display custom post type attached media file sizes
We have a custom post type slugged 'download' and it acts like a posts but with the different slug. (It displays content like a post). Now, We have a custom field named "videos" and ...
0
votes
0
answers
63
views
Sorting by Title for Post Archive Categories for Custom Post Type
I have a custom post type - vendors. They have a taxonomy vendor_category. I am attempting to sort the archive pages by the title (since it defaults to post date). Here is the code that I am putting ...
0
votes
0
answers
14
views
Limit a search box by CPT + taxonomies, in only one page
I have a specific page, in which I want the search box to show only a CPT as result. But I also want to search, as input terms, for post title, and two custom taxonomies assigned to this CPT. I tried ...
0
votes
0
answers
138
views
Single custom post type page redirect to 404 page
Helo,
i am trying to convert some posts to new custom post type. Then i get an error.
Special at my wordpress-installation:
I have categories and pages with the same slug. For example:
/state/ (page)
...
0
votes
0
answers
22
views
selecting custom post types and taxonomies for hub page listing blocks
I am looking to build a hub page for my site, containing selections of posts from various sections in blocks.
The site consists of various custom post types and taxonomies.
On the admin page for the ...
0
votes
1
answer
32
views
Have Custom Taxonomy Slug Fall Under Custom Post Type Slug
Currently scratching my head as to how to get this to work.
I have registered a custom post type "guide", and have a custom taxonomy for the post type of "venue-type".
I am trying ...
0
votes
0
answers
91
views
How can I show a field ID in Elementor with Request Parameter
I have a ID Field called name and I need get this field in Elementor.
I don´t know if it show as get, post or queryvar.
Please, I need help
Maybe with
add_action( 'elementor/query/nameid', function( $...
0
votes
0
answers
17
views
Custom post type pagination conflict result in 404
we have post type reviews with the slug customers and archive page as customers/customer-stories
we have created page customers and want to show on this page posts from different post type.
it does ...
0
votes
2
answers
68
views
WP Query - Can't get posts with specific taxonomy
I can't get my custom posts with a specific taxonomy. Here is my code in functions.php :
function portalp_custom_post_type_realisations() {
$labels = array(
'name' => ...
0
votes
1
answer
42
views
Adding Taxonomies to Custom Post Type Without Displaying Blog Post Categories
I am running into an issue that I am trying to fix. I first needed to find a way to add a category page to custom post type. Which I was able to do with this following code added to the mu-plugin file....
0
votes
0
answers
125
views
Query order by a numeric ACF field
I created a query for the custom post type of "departments" the query gets me every department with ACF field "type_of_cetifecate" = "bach" and with a certain category id,...
0
votes
0
answers
33
views
Allow child pages with the same base as the CPT slug
I use WordPress, but I don't use the archive templates, nor the default post. Instead, I create a CPT that will function as my blog, and I use regular pages for archives. This gives me a minor ...
0
votes
0
answers
18
views
Mixing custom post types and standard post types is distorting page layout
In simple terms when I include any custom post type and standard post in one archive page of any type the layout is somehow distorted. The sidebar looks different and sidebar widgets are moved to ...
0
votes
0
answers
13
views
Wordpress taxonomy and terms question
what i want to do is compare orcs from the game shadow of war.
I have an idea of what I need to do, but I a not sure how to use wordpress taxonomies, categories and tags.
I know enough php that could ...
0
votes
0
answers
29
views
Load style and script for custom post type metabox
I'm using this code to try loading some custom assets for a custom post type I have registered
public function setup_theme_backend_assets($hook)
{
$screen = get_current_screen(); ...
0
votes
2
answers
770
views
upload image with rest API to the media library
I am working on uploading an image to the media library and then attaching it to the featured image. I put the code below in my functions.php file and submitted a JSON file through postman, but for ...
0
votes
0
answers
28
views
Create a WordPress loop that shows posts from a custom post type + filters the posts by taxonomies while hiding empty taxonomies
I am working on a page template for a custom post type where I need to only show posts that are tagged for a certain sport in a custom taxonomy. I am also displaying all posts that are tagged to that ...
1
vote
1
answer
44
views
How do I add the "orange counter" next to a Custom Post Type?
I'm currently building a plugin for a client, where users can book meeting-rooms from the frontend. Then AJAX will create a custom post type, and an email will be sent to the site administrator. All ...
0
votes
1
answer
51
views
public custom posts not showing in my wordpress plugin
I am building a WordPress plugin and I want to show all publicly registered custom post types (by theme or other plugins) in my plugin. But it only shows post and page custom post types not other ...
0
votes
0
answers
16
views
Custom CPT - Programmatically create categories to assign CPT when a new one is created
I'm creating a CPT using this code in my OOP plugin
register_post_type(
'products',
[
'label' => __('Products', ''),
'description' =&...
0
votes
0
answers
39
views
Wordpress post objects in one parent post object
I'm creating an event page where we can add an event line-up. Such a line-up consists out of different speakers.
So I've create two custom post types:
Line-up
Speaker
On my event page you can select ...
0
votes
1
answer
172
views
Wordpress Multisite Network Shared Custom Post from Main Site using single-CPT.php
Trying to share a Custom Post from main site to a child site on a multisite network.
I am 80% there, with the use of switch_blog I am able to query custom posts on my templates on the child site. I DO ...
0
votes
0
answers
26
views
Remote database access on another wordpress site's custom post type
Firstsite.com
secondsite.com
both are Wordpress site and firstsite's data I want to fetch on my secondsite's custom post type template.
Secondsite.com has it's own database so I want to use both on ...
0
votes
0
answers
18
views
How to change permalink structure off default posts and also CPT's posts
For example, I need "name of post type / name of post" when I am on single post page and when I am on category page it must look "name of post type / category / category name"
0
votes
0
answers
25
views
Cannot attach custom taxonomy term to a custom post type. Post taxonomy terms are not saving
I have a custom post type with five different custom taxonomies attached to it. Of those 5, I am unable to add taxonomy terms to posts. However, the other four taxonomies are saving just fine!
Here is ...
0
votes
1
answer
16
views
Change post-name when inserting new Post if Specific Category is selected in WP
I want to hook a function for first time when new post is being inserted in WP.
when Poetry category is selected I want to change post-name with random 7 numeric numbers like
/poetry/2837410/
which ...
0
votes
0
answers
61
views
How do I get parameters from the URL?
I have to be missing something obvious, but darn me into wool socks if I can figure out what it is.
I have a set of news articles in the custom post type news. I'm trying to get an archive page ...
0
votes
0
answers
52
views
Custom post type single page fine for admin, 404 from front
When logged-in I can open post type single page (mysite.com/evenements/sample-slug)), but the same URL throws a 404 page if I'm not logged-in
Sometimes when logged in, I edit a given single page then ...
0
votes
1
answer
52
views
plugin translation *.mo file not getting loaded for custom post
I'm encountering a weird behavior with the translation for a custom plugin I've made for a customer.
The translation files are in the plugin languages folder and I load them with ...
0
votes
1
answer
74
views
Dynamically count the number of custom post types associated to a custom taxonomy
I have two custom post types, "participants" and "reports". Both of them are associated with the custom taxonomy "year".
So in the post "report 1" that is ...