0

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

2
  • Are you talking about the checkboxes in the admin used for bulk actions? Or something different on the front end? 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
    Dec 20, 2023 at 22:59

1 Answer 1

0

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:

  1. Open your theme's functions.php file or create a custom plugin.

  2. 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.

  1. 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!

1
  • dear Will Ashworth, as simple as that! I tested your codes, but no checkboxes are displayed or enabled on my CPT list. Many thanks for your help.
    – daro2013
    Dec 28, 2023 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.