I created a custom post and it’s missing some theme based screen options/elements. I’ve attached photos of what appears in the default post’s screen options and a custom post. I think it has something to do with ‘supports’ but I’m not sure.
Thanks!
]]>I have a simple member profile gallery. When you click on a person it brings up a brief profile. Below the post it has previous and next buttons to toggle through the members, but they aren’t working. If you click next it will take you to a new member but it then gets stuck showing the same members. They are about 40 members but it only shows the same 2 or 3. Any idea what’s misfiring when fetching this?
]]>Hi. I’m looking for a way to automatically apply a tag or category to a custom post type. Posts have the “uncategorized” category, but I’ve set up 4 additional custom posts. The client will end up creating new posts for each and I need to find a fool-proof way to ensure the correct category or tag is applied to any new custom posts. I’m using these categories (I’d prefer to do a tag for these) to filter into post widgets on several areas of the website. I’m afraid that the custom posts could be filtered into the wrong areas if they aren’t careful. I hope that makes sense
]]>Hello, first of all, I apologize for my limited skills with the plugin.
I wanted to create a category called “Animals,” where the taxonomy would cover different animal groups, like amphibians, reptiles, etc. The issue is that when I create a page within “Animals,” the full URL isn’t domainname/animals/taxonomy1/taxonomy2/pagename
but rather domainname/animals/pagename
.
I’m not sure if I’m explaining this correctly, but the permalink isn’t displaying as expected. I read the documentation and set the rewrite slug to true.
Sorry again, any help is appreciated, thank you. Below are the configured labels:
{"animales":{"name":"animales","label":"Animales","singular_label":"Animal","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","has_archive":"true","has_archive_string":"animales","exclude_from_search":"false","capability_type":"post","hierarchical":"true","can_export":"true","rewrite":"true","rewrite_slug":"animales","rewrite_withfront":"true","query_var":"true","query_var_slug":"animales","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":null,"register_meta_box_cb":null,"supports":["title","editor","thumbnail","custom-fields","page-attributes"],"taxonomies":["layout_category","layout_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_trashed":"","item_scheduled":"","item_updated":""},"custom_supports":"","enter_title_here":""}}
{"clasificacion":{"name":"clasificacion","label":"clasificaciones","singular_label":"clasificacion","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"1","show_admin_column":"false","show_in_rest":"true","show_tagcloud":"false","sort":"false","show_in_quick_edit":"","rest_base":"","rest_controller_class":"","rest_namespace":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":"","name_field_description":"","parent_field_description":"","slug_field_description":"","desc_field_description":""},"meta_box_cb":"","default_term":"","object_types":["animales"]}}
]]>
Hi,
I am using Elementor’s Portfolio widget on my homepage to filter custom post types called “installations”. I wanted to be able to filter the posts based on the custom taxonomy but it isn’t working. I have also reached out to Elementor support and they said the widget filters fine for standard WordPress posts but not for custom posts. Can you please help me figure this out?
Maybe I haven’t configured the post properly?
### Begin Custom Post Type UI Debug Info ###
Multisite: No
SITE_URL: https://tasmanav.com.au
HOME_URL: https://tasmanav.com.au
WordPress Version: 6.6.2
Permalink Structure: /%postname%/
Active Theme: Astra Child _ Tasman AV 1.0.0
Registered Post Types: post, page, attachment, revision, nav_menu_item, custom_css, customize_changeset, oembed_cache, user_request, wp_block, wp_template, wp_template_part, wp_global_styles, wp_navigation, wp_font_family, wp_font_face, e-landing-page, e-floating-buttons, elementor_library, ris_gallery, wpcf7_contact_form, installation, product, wpforms, wpforms-template, elementor_font, elementor_icons
PHP Version: 8.2.16
MySQL Version: 10.6.19
Web Server Info: LiteSpeed
Show On Front: page
Page On Front: Home (#10)
Page For Posts: (#0)
WordPress Memory Limit: 40MB
TOTAL PLUGINS: 15
MU PLUGINS: (1)
Health Check Troubleshooting Mode: 1.9.2
ACTIVE PLUGINS: (15)
Classic Editor: 1.6.5
Contact Form 7: 5.9.8
Contact Form Entries: 1.4.0
Custom Post Type UI: 1.17.1
Easy WP SMTP Pro: 2.6.0
Elementor: 3.25.3
Elementor Pro: 3.25.0
GTM4WP - A Google Tag Manager (GTM) plugin for WordPress: 1.20.2
Health Check & Troubleshooting: 1.7.1
LiteSpeed Cache: 6.5.2
Temporary Login: 1.2.0
Ultimate Responsive Image Slider - 3.5.14: 3.5.14
WPForms: 1.9.1.6
Yoast Duplicate Post: 4.5
Yoast SEO: 23.7
INACTIVE PLUGINS: (0)
Post Types:
{"installation":{"name":"installation","label":"Installations","singular_label":"Installation","description":"Installation projects","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","can_export":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-admin-tools","register_meta_box_cb":null,"supports":["title","editor","thumbnail","custom-fields","revisions","author","page-attributes","post-formats"],"taxonomies":["post_tag","installation-type"],"labels":{"menu_name":"Installations","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_trashed":"","item_scheduled":"","item_updated":""},"custom_supports":"","enter_title_here":""},"product":{"name":"product","label":"Products","singular_label":"Product","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","can_export":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-pressthis","register_meta_box_cb":null,"supports":["title","editor","thumbnail","revisions","author"],"taxonomies":["category"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_trashed":"","item_scheduled":"","item_updated":""},"custom_supports":"","enter_title_here":""}}
Taxonomies:
{"installation-type":{"name":"installation-type","label":"Installation Types","singular_label":"Installation Type","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_tagcloud":"true","sort":"true","show_in_quick_edit":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":"","back_to_items":"","name_field_description":"","parent_field_description":"","slug_field_description":"","desc_field_description":""},"meta_box_cb":"","default_term":"","object_types":["installation"]}}
### End Debug Info ###
]]>
the plug in seems to log debug information for each post type about every 30 seconds, this leads to a huge error log about 5gb per month, is there a debug setting that I have not yet found?
]]>Hi. Suddently today I tried to edit my custom posts and the action causes an WP error. When I open the post that only displays a message: There has been a critical error on the site. More information can be found in the website administrator’s email.
None of this happens when I open a normal article or a page.
]]>I know that there must be a way to do this. We have a custom post type, that is using the same post tags ( Tags (WP Core) ) they don’t show up on the single post in the backend to allow people to add them. It appears in the list, but not the edit post level.
I’ve had a look at the settings and can’t see anything untoward.
Any help would be great ??
]]>Is it possible to make a CSV upload that automatically loads all the data I need in the post?
]]>I have created custom category Product Categories through Custom Post Type UI and the basic settings of Product Categories are as follows:
Taxonomy Slug: product_category
Plural Label*: Product Categories
Singular Label *: Product Category
Attach to Post Type *: products
In CPT’s Product Categories settings, the Sort option is currently set to true.
In the wordpress backend Product Categories management interface, I have created 32 categories and all categories are currently displayed in the category list.
In functions.php, I have added sorting functionality to both the new category form and the edit category form in the product_category admin interface. The code is as follows:
/*****
?* [EN]Add sorting settings to both the New Category form and Edit Category form in the product_category admin interface.
[Zh]在 product_category 管理界面的新建分类表单和编辑分类表单中添加排序设置
?*/
// [EN]Add a sort field to the new category form. [Zh]在新建分类的表单中添加排序字段
function add_category_sort_field($taxonomy) {
? ? ?>
? ? <div class="form-field term-sort-wrap">
? ? ? ? <label for="tag-sort">sort</label>
? ? ? ? <input name="term-sort" id="tag-sort" type="number" value="" size="40">
? ? ? ? <p> Set the sorting order of this category, the smaller the number, the higher the sorting order.</p>
? ? </div>
? ? <?php
}
add_action('product_category_add_form_fields', 'add_category_sort_field');
// [EN]Add a sorting field in the edit category form. [Zh]在编辑分类的表单中添加排序字段
function edit_category_sort_field($term, $taxonomy) {
? ? // Get the sort value of the current category 获取当前分类的排序值
? ? $sort_value = get_term_meta($term->term_id, 'term_sort', true);
? ? ?>
? ? <tr class="form-field term-sort-wrap">
? ? ? ? <th scope="row"><label for="tag-sort">sort</label></th>
? ? ? ? <td>
? ? ? ? ? ? <input name="term-sort" id="tag-sort" type="number" value="<?php echo esc_attr($sort_value); ?>" size="40">
? ? ? ? ? ? <p class="description"> Set the sorting order of this category, the smaller the number, the higher the sorting order.</p>
? ? ? ? </td>
? ? </tr>
? ? <?php
}
add_action('product_category_edit_form_fields', 'edit_category_sort_field', 10, 2);
//[EN] Save the value of the sort field? 保存排序字段的值
function save_category_sort_meta($term_id) {
? ? if (isset($_POST['term-sort'])) {
? ? ? ? update_term_meta($term_id, 'term_sort', intval($_POST['term-sort']));
? ? }
}
add_action('created_product_category', 'save_category_sort_meta', 10, 2);
add_action('edited_product_category', 'save_category_sort_meta', 10, 2);
Then, in functions.php, I add a display of individual category sorting for the category list in the product_category admin interface.
The code is as follows:
/*****
* [EN] Add a single sorted category display for the category list in the product_category admin interface.
* [Zh]为 product_category 管理界面的分类列表加入单个分类排序的展示
?*****/
// [EN]Add a custom “Sort By” column to the category list. [ZH]添加自定义的“排序”列到分类列表
function add_sort_column_to_category_list($columns) {
// Insert a new “Sort By” column after the “Name” column. 在“名称”列之后插入一个新的“排序”列
? ? $columns['term_sort'] = 'sort';
? ? return $columns;
}
add_filter('manage_edit-product_category_columns', 'add_sort_column_to_category_list');
// Populate the data in the “Sort By” column. 填充“排序”列中的数据
function fill_sort_column_in_category_list($content, $column_name, $term_id) {
? ? if ($column_name == 'term_sort') {
? ? ? ? // Get the sort value of the current category 获取当前分类的排序值
? ? ? ? $sort_value = get_term_meta($term_id, 'term_sort', true);
? ? ? ? if ($sort_value !== '') {
? ? ? ? ? ? $content = intval($sort_value); // Make sure the value is an integer 确保值为整数
? ? ? ? } else {
? ? ? ? ? ? $content = '—'; // If no sort is set, show dashes.如果没有设置排序,则显示破折号
? ? ? ? }
? ? }
? ? return $content;
}
add_filter('manage_product_category_custom_column', 'fill_sort_column_in_category_list', 10, 3);
// [EN]Make the “Sort By” column support sorting.[Zh]让“排序”列支持排序功能
function make_sort_column_sortable($sortable_columns) {
? ? $sortable_columns['term_sort'] = 'term_sort';
? ? return $sortable_columns;
}
add_filter('manage_edit-product_category_sortable_columns', 'make_sort_column_sortable');
/*****
*[EN] Ensure that the categories are sorted correctly by the term_sort field.
?* [ZH]确保分类按照 term_sort 字段正确排序
?*/
?function sort_category_by_sort_meta($query) {
//Ensure that it is only applied on the product_category admin page in the backend.
//确保仅在后台的 product_category 管理页面上应用
? ? if (!is_admin() || !isset($query->query_vars['taxonomy']) || $query->query_vars['taxonomy'] != 'product_category') {
? ? ? ? return;
? ? }
? ? // Check for 'orderby=term_sort' in URLs.检查 URL 中是否有 'orderby=term_sort'
? ? if (isset($query->query_vars['orderby']) && $query->query_vars['orderby'] == 'term_sort') {
? ? ? ? // Force sorting with term_sort metadata 强制使用 term_sort 元数据进行排序
? ? ? ? $query->set('meta_key', 'term_sort');
? ? ? ? $query->set('orderby', 'meta_value_num'); // 使用元数据数字进行排序
? ? ? ? $query->set('order', isset($query->query_vars['order']) ? $query->query_vars['order'] : 'ASC'); // Default ascending order 默认升序
? ? }
}
add_action('pre_get_terms', 'sort_category_by_sort_meta');
I’ve created 32 categories and set ordering values from 1-32 for each of them. Screenshots of some of the categories and sort values are shown below:
Current problem: Clicking on the sort button for a category sorts it, but the sort result for the category is garbled.
For example, there are currently 32 categories, when I click on the ascending button, there is no 1.2.3…30.31.32 sorting, but a random chaotic sorting with sort values 1-32 is displayed; when I click on the descending button, there is no 32-1 sorting, but a random chaotic sorting with sort values 1-32 is displayed as well;
What I need is that when I click on the ascending button, the sorting is according to 1.2.3…30.31.32; when I click on the descending button, the sorting is according to 32.31.30 …. .3.2.1 way to sort;
I’ve tried many ways but can’t solve this problem, I hope CPT UI official friend, help me to see what is the problem?
How should I solve this problem?
Looking forward to a reply from the CPT UI team! Thanks!
]]>An absolute beginners question but I can’t find information about this: how do I add fields to a post type?
]]>Hi Support,
I am Creating a custom theme for www.remarpro.com. So I need CPT but theme doesn’t allow me to do that acc to wordpress code standard. But I use your plugin as depedency.
But i didn’t get any way to create a Custom Post type by code. I manulaly create a json file. But no such good way get to import that json file after plugin actaivtaion.
Could you please help me out in this.
Thank You
my site is a recipe site and the recipes aren’t displaying (quite critical!) it says There has been a critical error on this website. Everything else on the site is fine – we have chef pages, potato variety page made with the custom post type and they are fine
Also shop, blog etc and is fine
I have put the site to maintenance, and I have gone back to a previous backup but the problem is still there.
I can’t get in to edit any recipes, I can’t access from the front end (all the recipes are the same – but it is at maintenance just now)
Thank you
Hi, I’ve got about 100 existing wp posts that I would like group under a new custom post type. Is there an option to carry this out? Thanks
]]>Hello,
Recently we have had a problem with not all taxonomies being displayed when editing posts. It displays some but not all, and you can’t search for the ones that are missing. It displays the ones from A to C but stops after that. It is possible to add them in the quick edit view but not in the actual post view. Can anyone help me fix this?
]]>I’m not able to get the custom post type to display on the web page. Can someone advise me as to what I may be missing?
I originally placed this code in the functions.php file:
function pluginize_display_post_type_description( $post_type_providers = 'providers' ) {
$mytype = get_post_type_object( $post_type_providers )
if ( ! empty( $mytype ) ) {
echo $the_post_type->description;
}
}
When that didn’t work, I removed that and added this:
function cptui_register_my_cpts() {
/**
* Post Type: Providers.
*/
$labels = [
"name" => esc_html__( "Providers", "hello-elementor" ),
"singular_name" => esc_html__( "Provider", "hello-elementor" ),
];
$args = [
"label" => esc_html__( "Providers", "hello-elementor" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => true,
"rewrite" => [ "slug" => "providers", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor", "thumbnail" ],
"taxonomies" => [ "disciplines" ],
"show_in_graphql" => false,
];
register_post_type( "providers", $args );
/**
* Post Type: Leaders.
*/
$labels = [
"name" => esc_html__( "Leaders", "hello-elementor" ),
"singular_name" => esc_html__( "Leader", "hello-elementor" ),
];
$args = [
"label" => esc_html__( "Leaders", "hello-elementor" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => true,
"rewrite" => [ "slug" => "leadership", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor", "thumbnail" ],
"show_in_graphql" => false,
];
register_post_type( "leadership", $args );
/**
* Post Type: Board Members.
*/
$labels = [
"name" => esc_html__( "Board Members", "hello-elementor" ),
"singular_name" => esc_html__( "Board Member", "hello-elementor" ),
];
$args = [
"label" => esc_html__( "Board Members", "hello-elementor" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => true,
"rewrite" => [ "slug" => "boardofdirectors", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor", "thumbnail" ],
"taxonomies" => [ "bordroles" ],
"show_in_graphql" => false,
];
register_post_type( "boardofdirectors", $args );
/**
* Post Type: Jobs.
*/
$labels = [
"name" => esc_html__( "Jobs", "hello-elementor" ),
"singular_name" => esc_html__( "Job", "hello-elementor" ),
"menu_name" => esc_html__( "My Jobs", "hello-elementor" ),
"all_items" => esc_html__( "All Jobs", "hello-elementor" ),
"add_new" => esc_html__( "Add new", "hello-elementor" ),
"add_new_item" => esc_html__( "Add new Job", "hello-elementor" ),
"edit_item" => esc_html__( "Edit Job", "hello-elementor" ),
"new_item" => esc_html__( "New Job", "hello-elementor" ),
"view_item" => esc_html__( "View Job", "hello-elementor" ),
"view_items" => esc_html__( "View Jobs", "hello-elementor" ),
"search_items" => esc_html__( "Search Jobs", "hello-elementor" ),
"not_found" => esc_html__( "No Jobs found", "hello-elementor" ),
"not_found_in_trash" => esc_html__( "No Jobs found in trash", "hello-elementor" ),
"parent" => esc_html__( "Parent Job:", "hello-elementor" ),
"featured_image" => esc_html__( "Featured image for this Job", "hello-elementor" ),
"set_featured_image" => esc_html__( "Set featured image for this Job", "hello-elementor" ),
"remove_featured_image" => esc_html__( "Remove featured image for this Job", "hello-elementor" ),
"use_featured_image" => esc_html__( "Use as featured image for this Job", "hello-elementor" ),
"archives" => esc_html__( "Job archives", "hello-elementor" ),
"insert_into_item" => esc_html__( "Insert into Job", "hello-elementor" ),
"uploaded_to_this_item" => esc_html__( "Upload to this Job", "hello-elementor" ),
"filter_items_list" => esc_html__( "Filter Jobs list", "hello-elementor" ),
"items_list_navigation" => esc_html__( "Jobs list navigation", "hello-elementor" ),
"items_list" => esc_html__( "Jobs list", "hello-elementor" ),
"attributes" => esc_html__( "Jobs attributes", "hello-elementor" ),
"name_admin_bar" => esc_html__( "Job", "hello-elementor" ),
"item_published" => esc_html__( "Job published", "hello-elementor" ),
"item_published_privately" => esc_html__( "Job published privately.", "hello-elementor" ),
"item_reverted_to_draft" => esc_html__( "Job reverted to draft.", "hello-elementor" ),
"item_scheduled" => esc_html__( "Job scheduled", "hello-elementor" ),
"item_updated" => esc_html__( "Job updated.", "hello-elementor" ),
"parent_item_colon" => esc_html__( "Parent Job:", "hello-elementor" ),
];
$args = [
"label" => esc_html__( "Jobs", "hello-elementor" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => true,
"rewrite" => [ "slug" => "jobs", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor" ],
"show_in_graphql" => false,
];
register_post_type( "jobs", $args );
}
add_action( 'init', 'cptui_register_my_cpts' );
]]>
I have a custom post type called treatments and a url as follows: https://www.looklovelylondon.co.uk/treatments/fat-dissolving-injections/
I want to rewrite all treatment URLs so they remove the /treatments/. In CPTUI, I have set rewrite to true and set a custom rewrite slug of / with front false. After I flushed the permalinks, my standard pages are showing 404 not found. My treatment pages are rewriting as expected. Why are my other pages showing 404?
HI, I’m new to the database query game.
I have this query that selects posts for use in a database filter calculation:
SELECT post.post_title,post.post_excerpt,post.post_date,post.guid,user.display_name FROM {wpdb.posts} post INNER JOIN {wpdb.users} as user ON (post.post_author=user.ID) WHERE post.post_title LIKE “%<%fieldname2%>%” OR post.post_excerpt LIKE “%<%fieldname2%>%” OR post.post_content LIKE “%<%fieldname2%>%”
I just want to call my custom posts. My custom post name is price_book. How would I do this.
I would greatly appreciate any help.
Thanks!
]]>if you will check this using the tool axe DevTools – Web Accessibility Testing, which is an extension of chrome, you will find some issues. When I was trying to remove them there wasn’t any option like that in template etc. Can you please guide me how these errors can be removed?
]]>I created two content types, one is for paintings (images), the other is one for photos (photos). I created two taxonomies to sort the post types by subject matter. I exported the content types as templates to then import the data via a csv file from a Drupal site. Now, I can see it all on the front end, but the back end is not working correctly. For the images CPT, I can not add new posts, or edit the taxonomy terms for existing images without getting this “The editor has encountered an unexpected error.”, and two choices “copy post text” and “copy error”. The error is:
e/ce/<@https://wp-kendalbrown.com/wp-includes/js/dist/components.min.js?ver=36b97398bf090476214e:34:460446
ce@https://wp-kendalbrown.com/wp-includes/js/dist/components.min.js?ver=36b97398bf090476214e:34:460425
e@https://wp-kendalbrown.com/wp-includes/js/dist/components.min.js?ver=36b97398bf090476214e:34:461842
hu@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:60308
_o@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:74386
xi@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:120464
bs@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:108751
vs@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:108679
gs@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:108540
as@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:105347
is@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:105736
Hl@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:46663
551/rs/<@https://wp-kendalbrown.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:2:103288
I have disabled all the plugins, and switched the theme to Twenty Twenty-Four, but still the error occurs. I also added the content types to a different installation with the same results. The backend does not work correctly. If I go to the taxonomy, it shows the number of posts by their term as designed, and clicking on the number takes me to the post admin, but shows no entries by term. I installed the Classic Editor, and I can now add and edit the custom posts. How could I get back to the way WordPress is designed to work with Gutenberg? Unfortuantely this is on my local machine, so I can’t get access for you.
Here is some other debug info:
### Begin Custom Post Type UI Debug Info ###
Multisite: No
SITE_URL: https://wp-kendalbrown.com
HOME_URL: https://wp-kendalbrown.com
WordPress Version: 6.6.1
Permalink Structure: /%postname%/
Active Theme: bootScore Child 5.2.0.0
Registered Post Types: post, page, attachment, revision, nav_menu_item, custom_css, customize_changeset, oembed_cache, user_request, wp_block, wp_template, wp_template_part, wp_global_styles, wp_navigation, wp_font_family, wp_font_face, wpcode, wpcf7_contact_form, image, photo
PHP Version: 8.1.29
MySQL Version: 8.0.39
Web Server Info: Apache/2.4.52 (Ubuntu)
Show On Front: page
Page On Front: Home (#457)
Page For Posts: (#0)
WordPress Memory Limit: 40MB
TOTAL PLUGINS: 12
ACTIVE PLUGINS: (10)
A2 Optimized WP: 3.0.9
All in One SEO: 4.6.9.1
bs Contact Form 7: 5.3.3
bs Cookie Settings: 5.6.1
Classic Editor: 1.6.4
Contact Form 7: 5.9.8
Custom Post Type UI: 1.17.1
Honeypot for Contact Form 7: 2.1.4
WPCode Lite: 2.2.1
WP Import Export Lite: 3.9.27
INACTIVE PLUGINS: (2)
Akismet Anti-spam: Spam Protection: 5.3.3
W3 Total Cache: 2.7.5
Post Types:
{"image":{"name":"image","label":"images","singular_label":"image","description":"a post type for images","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","has_archive":"true","has_archive_string":"","exclude_from_search":"true","capability_type":"post","hierarchical":"false","can_export":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":null,"register_meta_box_cb":null,"supports":["title","editor","thumbnail","excerpt","trackbacks","custom-fields","revisions","author","page-attributes","post-formats"],"taxonomies":["images"],"labels":{"menu_name":"My images","all_items":"All images","add_new":"Add new","add_new_item":"Add new image","edit_item":"Edit image","new_item":"New image","view_item":"View image","view_items":"View images","search_items":"Search images","not_found":"No images found","not_found_in_trash":"No images found in trash","parent":"Parent image:","featured_image":"Featured image for this image","set_featured_image":"Set featured image for this image","remove_featured_image":"Remove featured image for this image","use_featured_image":"Use as featured image for this image","archives":"image archives","insert_into_item":"Insert into image","uploaded_to_this_item":"Upload to this image","filter_items_list":"Filter images list","items_list_navigation":"images list navigation","items_list":"images list","attributes":"images attributes","name_admin_bar":"image","item_published":"image published","item_published_privately":"image published privately.","item_reverted_to_draft":"image reverted to draft.","item_trashed":"image trashed.","item_scheduled":"image scheduled","item_updated":"image updated.","parent_item_colon":"Parent image:"},"custom_supports":"","enter_title_here":"Add image"}, "photo":{"name":"photo","label":"photos","singular_label":"photo","description":"a post type for photos","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"photos","rest_controller_class":"","rest_namespace":"","has_archive":"true","has_archive_string":"photos","exclude_from_search":"false","capability_type":"post","hierarchical":"false","can_export":"true","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":null,"register_meta_box_cb":null,"supports":["title","editor","thumbnail","excerpt","custom-fields","author","page-attributes","post-formats"],"taxonomies":["photo"],"labels":{"menu_name":"My photos","all_items":"All photos","add_new":"Add new","add_new_item":"Add new photo","edit_item":"Edit photo","new_item":"New photo","view_item":"View photo","view_items":"View photos","search_items":"Search photos","not_found":"No photos found","not_found_in_trash":"No photos found in trash","parent":"Parent photo:","featured_image":"Featured image for this photo","set_featured_image":"Set featured image for this photo","remove_featured_image":"Remove featured image for this photo","use_featured_image":"Use as featured image for this photo","archives":"photo archives","insert_into_item":"Insert into photo","uploaded_to_this_item":"Upload to this photo","filter_items_list":"Filter photos list","items_list_navigation":"photos list navigation","items_list":"photos list","attributes":"photos attributes","name_admin_bar":"photo","item_published":"photo published","item_published_privately":"photo published privately.","item_reverted_to_draft":"photo reverted to draft.","item_trashed":"photo trashed.","item_scheduled":"photo scheduled","item_updated":"photo updated.","parent_item_colon":"Parent photo:"},"custom_supports":"","enter_title_here":"Add photo"}}}
Taxonomies:
{"images":{"name":"images","label":"images","singular_label":"image","description":"a post type for images","public":"true","publicly_queryable":"true","hierarchical":"false","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"images","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_tagcloud":"false","sort":"false","show_in_quick_edit":"","rest_base":"images","rest_controller_class":"","rest_namespace":"","labels":{"menu_name":"images","all_items":"All images","edit_item":"Edit image","view_item":"View image","update_item":"Update image name","add_new_item":"Add new image","new_item_name":"New image name","parent_item":"Parent image","parent_item_colon":"Parent image:","search_items":"Search images","popular_items":"Popular images","separate_items_with_commas":"Separate images with commas","add_or_remove_items":"Add or remove images","choose_from_most_used":"Choose from the most used images","not_found":"No images found","no_terms":"No images","items_list_navigation":"images list navigation","items_list":"images list","back_to_items":"Back to images","name_field_description":"The name is how it appears on your site.","parent_field_description":"Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.","slug_field_description":"The slug is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.","desc_field_description":"The description is not prominent by default; however, some themes may show it."},"meta_box_cb":"","default_term":"","object_types":["image"]},"photo":{"name":"photo","label":"photos","singular_label":"photo","description":"a catalog for photos","public":"true","publicly_queryable":"true","hierarchical":"false","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_tagcloud":"false","sort":"false","show_in_quick_edit":"","rest_base":"photo","rest_controller_class":"","rest_namespace":"","labels":{"menu_name":"photos","all_items":"All photos","edit_item":"Edit photo","view_item":"View photo","update_item":"Update photo name","add_new_item":"Add new photo","new_item_name":"New photo name","parent_item":"Parent photo","parent_item_colon":"Parent photo:","search_items":"Search photos","popular_items":"Popular photos","separate_items_with_commas":"Separate photos with commas","add_or_remove_items":"Add or remove photos","choose_from_most_used":"Choose from the most used photos","not_found":"No photos found","no_terms":"No photos","items_list_navigation":"photos list navigation","items_list":"photos list","back_to_items":"Back to photos","name_field_description":"The name is how it appears on your site.","parent_field_description":"Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.","slug_field_description":"The slug is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.","desc_field_description":"The description is not prominent by default; however, some themes may show it."},"meta_box_cb":"","default_term":"","object_types":["photo"]}}
### End Debug Info ###
]]>
Hi,
I’m a french guy, so my labels can contain some apostrophes, like “Domaines d’activité”. Try to add such labels and you will see that the output will be encoded html entities. I had to fix this by adding this filter :
add_filter('register_post_type_args', 'fix_cpt_labels_apostrophe', 10, 2);
function fix_cpt_labels_apostrophe($args, $post_type) {
if (!empty($args['labels'])) {
foreach ($args['labels'] as $key => $label) {
$args['labels'][$key] = html_entity_decode($label);
}
}
return $args;
}
I’m sure you can do it in your plugin’s code in order for us to don’t apply it manually.
You’re welcome. Regards.
]]>Hello,
I am trying to build url structure as following cases
Say, the cpt type is cpt1, category base is cpt_category, and categories are cat1, cat2, and cat3.
The cpt and category base (taxonomy) are both defined by CPT UI.
I used following plugin to define CPT’s permalink structure.
For the case 1, my permal structure is following:
Since there are 3 categories in cpt_category, I thought the url will be
But in the browser URL, I can see
In other words, ‘%cpt_category%’ is not considered as a variable, but as a string value. This might be the permalink plugin’s problem. So, I’ve tried the same thing with pre-made CPTs from a random glossary plugin. The plugin’s category base is ‘%glossary-cat%’, so I set the permal structure by following
Somehow, in this case, %glossary-cat% is replaced to cat1, cat2, and cat3 in the URL. So it looks like
which means that ‘%glosary-cat%’ is not considered as a string value, but as a variable. My guess is that either I did something wrong in settings for CPT UI’s taxonomy, or there is some sort of a bug that WP does not capture CPT UI’s taxonomy.
Most likely, this should be my fault.
Let me share you how I set a taxonomy so that you can figure easily out what went wrong.
Other setting values are unchanged from your default.
In fact, another plugin that is supposed to find CPT’s category base also fails to list up my CPT category bases. Above two cases are from my own version of debugging.
Can you please help me to resolve the issue?
]]>How do I get the slug of a new CPT I created? If I click on CODE I see this cptui_register_my_cpts_photos
. Is that it? Thanks.
Custom Post Type UIですでに運用しているカスタム投稿の設定で、いくつか文章を変更して保存したところ、全く別の項目が表示されない&レイアウトが崩れる、という現象が起きています。
先日までは問題なく表示されていました。
最近したことは、SWELLのアップデート、Aformsというプラグインを追加、ぐらいです。色々調べたのですが、解決法が分からないためこちらに質問させて頂きました。
よろしくお願いいたします。
]]>hi how to achieve Taxonomy below the excerpt in the grid view
i use Custom Post Type UI Extended
thank you
]]>Hi, the default width in post grid is as follows:
.cptui-shortcode-grid li {
flex: 0 1 50% !important;
}
Is there a way to change this other than adjusting the css?
]]>Hi there,
Awesome plugin.
I created a CPT called Videos and created a bunch of them.
Then, I went to enable a custom taxonomy and applied it to the Videos post type.
However, it won’t allow me to categorized the CPTs under that new taxonomy.
Here is a screenshot showing the post quick edit with no option to add a category to the post.
It seems like it might be creating the taxonomy as “tags” because when I view the custom taxonomy list with no categories yet created, it shows a string that says something like “No tags found.”
Thank you kindly for your assistance.
]]>Hello Team,
I have created custom post, categories and tags. Everything is working fine but while enabling taxonomies without WP core are not visible on listing page. Is there any way to get it resolve?
For better understanding adding screenshots here:
In the below screen shot selected Team Categories but it is not visible while core categories are visible.
https://cptui.s3.eu-west-2.amazonaws.com/image_2024_07_26T08_53_01_681Z.png
https://cptui.s3.eu-west-2.amazonaws.com/image_2024_07_26T08_53_35_687Z.png
]]>
Hello,
I’ve used the WP post grid before and one custom post type I created was displayed fine. I have created other custom post types in the same way as the previous one. And when I choose to display them in a WP post grid, it simply displays “Array.” I’m using Uncode theme, and WP 6.6.1 version, in Firefox. Any hint what I need to do?
Thanks for any kind of help!
]]>Hi! My taxonomies don′t have a scrollbar anymore, now they show as a big list on my post edit site, example: https://imgur.com/a/m5RqOPA
Is there any way to change this? I suddenly shows this way.
]]>