admin管理员组文章数量:1122832
I have a custom post type called gr-item created by a Wordpress theme. However, checkboxes in Title column for custom post type posts on post list are disabled.
How can I enable them?
Any quick advice is very appreciated.
Regards
No Checkboxes before each Title of custom post type post. Please see the link below:
I have a custom post type called gr-item created by a Wordpress theme. However, checkboxes in Title column for custom post type posts on post list are disabled.
How can I enable them?
Any quick advice is very appreciated.
Regards
No Checkboxes before each Title of custom post type post. Please see the link below:
https://imgur.com/a/QOa1CWh
Share Improve this question edited Dec 21, 2023 at 4:22 daro2013 asked Dec 20, 2023 at 4:47 daro2013daro2013 251 silver badge6 bronze badges 2- Are you talking about the checkboxes in the admin used for bulk actions? Or something different on the front end? – Jacob Peattie Commented Dec 20, 2023 at 16:58
- Hi Jacob Peattie Yes, checkboxes in Title column for custom post type posts on post list page at Admin backend. my question has been updated. – daro2013 Commented Dec 20, 2023 at 22:59
2 Answers
Reset to default 1I see on the link that several columns were added. I would recommend to check the function which was mentioned in the following call:
add_filter( 'manage_gr-item_columns', 'the_function' );
It seems someone removed the column 'cb' in the body of that function;
To enable checkboxes for custom post type posts on their post list in WordPress, you can achieve this by adding some code to your theme's functions.php
file or by creating a custom plugin. Here's how to do it:
Open your theme's
functions.php
file or create a custom plugin.Add the following code to enable checkboxes for your custom post type (replace
'gr-item'
with your actual custom post type name if different):
function enable_custom_post_type_checkboxes($post_type) {
if ($post_type === 'gr-item') {
return 'page';
}
return $post_type;
}
add_filter('manage_posts_columns', 'enable_custom_post_type_checkboxes');
add_filter('manage_pages_columns', 'enable_custom_post_type_checkboxes');
This code filters the column list for both posts and pages and enables checkboxes for the 'gr-item'
custom post type.
- Save the changes to your
functions.php
file or activate your custom plugin.
Now, when you go to the post list in your WordPress dashboard for your custom post type 'gr-item'
, you should see checkboxes next to each post title, allowing you to perform bulk actions and interact with the posts.
However, it's worth mentioning that there may be specific code in your third-party theme that is preventing the checkboxes from displaying, so the only way to know if this will work is to try it out. Best of luck to you!
本文标签: How can I enable checkboxes for custom post type posts on their post listWordpress
版权声明:本文标题:How can I enable checkboxes for custom post type posts on their post list - Wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736293720a1929203.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论