WordPress.org

Ready to get started?Download WordPress

Forums

How to add colums to the screen layout of custom post type ? (5 posts)

  1. Franky57
    Member
    Posted 11 months ago #

    Hi !

    I would like to add a third or fourth column to the screen layout of my custom post type but without using a plugin or modify WordPress core code.

    Is somebody know the way to achieve this ?

    Thanks

  2. catacaustic
    Member
    Posted 11 months ago #

    You can modify the layout of your custom post type by creating/editing the template file for that post type.

    as an example, if your post type is called 'products', you'd use a file called single-products.php. If that file doesn't exist you can copy it from single.php in your theme - but be sure to use a child theme so your changes don't get lost on any future updates!

  3. Franky57
    Member
    Posted 10 months ago #

    Sorry, I omitted to specify I would do this of my custom post type edit panel in the wordpress admin screens.

  4. catacaustic
    Member
    Posted 10 months ago #

    OK then, that may make it a lot harder. Unless you have a template file that is directly made for that content type (single-products.php, content-products.php, etc...) then you can't do it through the built-in theme editor. That editor doesn't create files, it only lets you edit files that are already there.

  5. bcworkz
    Member
    Posted 10 months ago #

    To add columns to the custom post type table on the admin screen, refer to these pages:
    http://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column
    http://codex.wordpress.org/Plugin_API/Filter_Reference/manage_edit-post_type_columns

    While doing so is typically done with a plugin, I believe it can be done by adding code to your theme's functions.php, though you are better off creating a child theme to contain and protect your custom code.

Reply

You must log in to post.

About this Topic