Posted By : Date : fanuzzi | 04-03-2021
A custom fields are, basically, the properties for a post type. The creation phase of a custom field is divided in two parts: Creation of the structure Define the behavior Creation of the structure Add metabox Metabox is the graphic container of our custom fields. It will appear as a fieldsets in the admin page, containing our custom fields. add_action('add_meta_boxes_{post_type_name}','add_metabox_function');function add_metabox_function($post){  add_meta_box('id','title','metabox_field_function','post_type_name','normal','default');} This function will contain all necessary html, CSS and logical code to manage and show our custom fields. function metabox_field_function(){   //html code to show fields and php…
Read More
0 Comments
WordPress Custom Post Type
Posted By : Date : fanuzzi | 04-02-2021
Post types are a way to categorize different types of content in WordPress. Wordpress has already the following native post type: Post Pages Attachments Revisions Navigation menu custom CSS Changeset Most probably you just knew about the first three in the list. And you can extend these wordpress post type with your own. To do this you here it is a little function recap. Hook custom post type definition Hook add_action( 'init', 'custom_posttype_def', 0 ); custom post type definition function custom_posttype_def() { // Set UI labels for Custom Post Type…
Read More
0 Comments