How to add custom fields option to custom post type wordpress ?

custom filed option for custom post type wordpresss

How to fix if custom fields option not showing in dashboard posts or pages ..

Here are Steps to Follow:

  1. Simply Login to your website and edit any post from the listed posts.
  2. First check if it is not unchecked by default in dashboard by click on Screen Option .. right side of screen.
custom field option not checked in dashboard wordrpess


If the Custom field not showing in “Screen Option” section on top then follow these steps to add custom filed option to any custom post type .


custom-filed-option-in-post-type


Like here..

no-custom-field-option


if you don’t know how to create custom post then follow this previous post to know more..


Here is the code of custom post type..

<?php 
function nst_custom_post() { register_post_type( 'Movie', array( 'labels' => array( 'name' => __( 'Movie' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'movie'),
'supports' => array('title', 'editor','thumbnail','excerpt','custom-fields'),
)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'nst_custom_post' );
?>


Find your post code in functions.php file if its added recently and just add ‘custom-fields‘ option to ‘supports’ line .. like above to show in post dashboard.


Note : if you don’t know how the custom post is added in your website then here is simple way to add custom filed.


add this function to your active theme functions.php file ..


add_post_type_support( 'my_post_type', array(
    'excerpt', 'custom-fields',
) );


Just change the my_post_type to your post type.. then save this..



Now refresh that edited post page.. Custom Field option will appear now..

That’s it.. 😉 Thanks 👍


If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

5 thoughts on “How to add custom fields option to custom post type wordpress ?”

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat