Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?

You will be rejected from the WordPress.org theme direcotry if you include these post types in the theme. The guidelines, which are available here, state: Non-design related functionality is not allowed. (See: Plugin territory examples) And one of the examples is: Custom Post Types and Shortcodes Regarding TGM, the guidelines have this to say: Themes … Read more

Values entered in a meta box aren’t saved

You have to remove if($post_slug != $post->post_type){} from save function or change $post_slug = “book”; to $post_slug = “page”;. because it check $post slug is book or not. currently post type is page for contact us page. and you have set as book add_action(“save_post” , “wpl_owt_save_metabox_data” , 10 , 2); function wpl_owt_save_metabox_data($post_id, $post){ //verify nonce … Read more