Browse Source

Add: all custom fields and post type

Mozahidur Rahman 2 years ago
parent
commit
d81e83adc0

+ 1 - 1
functions.php

@@ -217,7 +217,7 @@ include_once(get_stylesheet_directory() . '/inc/custom-post-type.php');
 // include_once( get_stylesheet_directory() . '/inc/menus.php' );
 
 // Theme Settings
-// include_once( get_stylesheet_directory() . '/inc/theme-settings.php' );
+include_once( get_stylesheet_directory() . '/inc/theme-settings.php' );
 
 // Shortcodes
 // include_once( get_stylesheet_directory() . '/inc/shortcodes.php' );

+ 2 - 47
inc/acf-json/group_642aa09ae85e7.json

@@ -1,52 +1,7 @@
 {
     "key": "group_642aa09ae85e7",
-    "title": "Faculty Profiles",
+    "title": "Profiles Details",
     "fields": [
-        {
-            "key": "field_642b5d933dba3",
-            "label": "Profile Photo",
-            "name": "profile_photo",
-            "aria-label": "",
-            "type": "image",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "return_format": "",
-            "library": "",
-            "min_width": "",
-            "min_height": "",
-            "min_size": "",
-            "max_width": "",
-            "max_height": "",
-            "max_size": "",
-            "mime_types": "",
-            "preview_size": "medium"
-        },
-        {
-            "key": "field_642ab30fc50c5",
-            "label": "Designation",
-            "name": "designation",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "Professor & Director",
-            "prepend": "",
-            "append": ""
-        },
         {
             "key": "field_642ab412c50cc",
             "label": "Contact Details",
@@ -248,5 +203,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1680608285
+    "modified": 1680617704
 }

+ 14 - 95
inc/acf-json/group_642b6746320a8.json

@@ -1,95 +1,14 @@
 {
     "key": "group_642b6746320a8",
-    "title": "All events",
+    "title": "Event Details",
     "fields": [
-        {
-            "key": "field_642b67c31e6e2",
-            "label": "Event Image",
-            "name": "event_image",
-            "aria-label": "",
-            "type": "image",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "return_format": "url",
-            "library": "all",
-            "min_width": "",
-            "min_height": "",
-            "min_size": "",
-            "max_width": "",
-            "max_height": "",
-            "max_size": "",
-            "mime_types": "",
-            "preview_size": "medium"
-        },
-        {
-            "key": "field_642b67461e6de",
-            "label": "Event Name",
-            "name": "event_name",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "",
-            "prepend": "",
-            "append": ""
-        },
-        {
-            "key": "field_642b67951e6e0",
-            "label": "Event Date",
-            "name": "event_date",
-            "aria-label": "",
-            "type": "date_picker",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "50",
-                "class": "",
-                "id": ""
-            },
-            "display_format": "d\/m\/Y",
-            "return_format": "d\/m\/Y",
-            "first_day": 1
-        },
         {
             "key": "field_642b67a11e6e1",
-            "label": "Event Time",
-            "name": "event_time",
+            "label": "Event Date and Time",
+            "name": "event_date_time",
             "aria-label": "",
             "type": "date_time_picker",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "50",
-                "class": "",
-                "id": ""
-            },
-            "display_format": "d\/m\/Y g:i a",
-            "return_format": "d\/m\/Y g:i a",
-            "first_day": 1
-        },
-        {
-            "key": "field_642b675b1e6df",
-            "label": "Event Details",
-            "name": "event_details",
-            "aria-label": "",
-            "type": "wysiwyg",
-            "instructions": "",
+            "instructions": "For the date and time picker, click on the input field.",
             "required": 0,
             "conditional_logic": 0,
             "wrapper": {
@@ -97,30 +16,30 @@
                 "class": "",
                 "id": ""
             },
-            "tabs": "all",
-            "toolbar": "full",
-            "media_upload": 1,
-            "default_value": "",
-            "delay": 0
+            "display_format": "F j, Y g:i a",
+            "return_format": "F j, Y g:i a",
+            "first_day": 0
         }
     ],
     "location": [
         [
             {
-                "param": "options_page",
+                "param": "post_type",
                 "operator": "==",
-                "value": "acf-options-event-settings"
+                "value": "event"
             }
         ]
     ],
     "menu_order": 0,
-    "position": "normal",
+    "position": "side",
     "style": "default",
     "label_placement": "top",
     "instruction_placement": "label",
-    "hide_on_screen": "",
+    "hide_on_screen": [
+        "slug"
+    ],
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1680566828
+    "modified": 1680619614
 }

+ 10 - 75
inc/acf-json/group_642b681749965.json

@@ -1,77 +1,14 @@
 {
     "key": "group_642b681749965",
-    "title": "All News",
+    "title": "News Details",
     "fields": [
-        {
-            "key": "field_642b68175cea0",
-            "label": "News Image",
-            "name": "news_image",
-            "aria-label": "",
-            "type": "image",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "return_format": "url",
-            "library": "all",
-            "min_width": "",
-            "min_height": "",
-            "min_size": "",
-            "max_width": "",
-            "max_height": "",
-            "max_size": "",
-            "mime_types": "",
-            "preview_size": "medium"
-        },
-        {
-            "key": "field_642b681751eee",
-            "label": "New Title",
-            "name": "news_title",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "",
-            "prepend": "",
-            "append": ""
-        },
         {
             "key": "field_642b681755962",
             "label": "News Date",
             "name": "news_date",
             "aria-label": "",
-            "type": "date_picker",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "display_format": "d\/m\/Y",
-            "return_format": "d\/m\/Y",
-            "first_day": 1
-        },
-        {
-            "key": "field_642b681760a4e",
-            "label": "News Details",
-            "name": "news_details",
-            "aria-label": "",
-            "type": "wysiwyg",
-            "instructions": "",
+            "type": "date_time_picker",
+            "instructions": "For the date picker, click on the input field.",
             "required": 0,
             "conditional_logic": 0,
             "wrapper": {
@@ -79,24 +16,22 @@
                 "class": "",
                 "id": ""
             },
-            "default_value": "",
-            "tabs": "all",
-            "toolbar": "full",
-            "media_upload": 1,
-            "delay": 0
+            "display_format": "F j, Y g:i a",
+            "return_format": "F j, Y g:i a",
+            "first_day": 0
         }
     ],
     "location": [
         [
             {
-                "param": "options_page",
+                "param": "post_type",
                 "operator": "==",
-                "value": "acf-options-news-settings"
+                "value": "news"
             }
         ]
     ],
     "menu_order": 0,
-    "position": "normal",
+    "position": "side",
     "style": "default",
     "label_placement": "top",
     "instruction_placement": "label",
@@ -104,5 +39,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1680566812
+    "modified": 1680619602
 }

+ 8 - 48
inc/acf-json/group_642b68725c729.json

@@ -1,6 +1,6 @@
 {
     "key": "group_642b68725c729",
-    "title": "All Stories",
+    "title": "Story Details",
     "fields": [
         {
             "key": "field_642b68726e942",
@@ -16,8 +16,8 @@
                 "class": "",
                 "id": ""
             },
-            "return_format": "",
-            "library": "",
+            "return_format": "array",
+            "library": "all",
             "min_width": "",
             "min_height": "",
             "min_size": "",
@@ -27,26 +27,6 @@
             "mime_types": "",
             "preview_size": "medium"
         },
-        {
-            "key": "field_642b68726395d",
-            "label": "Student Name",
-            "name": "student_name",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "",
-            "prepend": "",
-            "append": ""
-        },
         {
             "key": "field_642b689ad9ac5",
             "label": "Student Designation",
@@ -63,42 +43,22 @@
             },
             "default_value": "",
             "maxlength": "",
-            "placeholder": "",
+            "placeholder": "Senior Database Engineer, Google",
             "prepend": "",
             "append": ""
-        },
-        {
-            "key": "field_642b6872723e4",
-            "label": "Student Story",
-            "name": "student_story",
-            "aria-label": "",
-            "type": "wysiwyg",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "tabs": "all",
-            "toolbar": "full",
-            "media_upload": 1,
-            "delay": 0
         }
     ],
     "location": [
         [
             {
-                "param": "options_page",
+                "param": "post_type",
                 "operator": "==",
-                "value": "acf-options-student-story"
+                "value": "success_story"
             }
         ]
     ],
     "menu_order": 0,
-    "position": "normal",
+    "position": "side",
     "style": "default",
     "label_placement": "top",
     "instruction_placement": "label",
@@ -106,5 +66,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1680566495
+    "modified": 1680617595
 }

+ 70 - 0
inc/acf-json/group_642c30c3d7bd7.json

@@ -0,0 +1,70 @@
+{
+    "key": "group_642c30c3d7bd7",
+    "title": "Profiles Information",
+    "fields": [
+        {
+            "key": "field_642c30c3df90b",
+            "label": "Profile Photo",
+            "name": "profile_photo",
+            "aria-label": "",
+            "type": "image",
+            "instructions": "",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "return_format": "",
+            "library": "",
+            "min_width": "",
+            "min_height": "",
+            "min_size": "",
+            "max_width": "",
+            "max_height": "",
+            "max_size": "",
+            "mime_types": "",
+            "preview_size": "medium"
+        },
+        {
+            "key": "field_642c30c3e3387",
+            "label": "Designation",
+            "name": "designation",
+            "aria-label": "",
+            "type": "text",
+            "instructions": "",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "default_value": "",
+            "maxlength": "",
+            "placeholder": "Professor & Director",
+            "prepend": "",
+            "append": ""
+        }
+    ],
+    "location": [
+        [
+            {
+                "param": "post_type",
+                "operator": "==",
+                "value": "faculty"
+            }
+        ]
+    ],
+    "menu_order": 0,
+    "position": "side",
+    "style": "default",
+    "label_placement": "top",
+    "instruction_placement": "label",
+    "hide_on_screen": "",
+    "active": true,
+    "description": "",
+    "show_in_rest": 0,
+    "modified": 1680617800
+}

+ 70 - 0
inc/acf-json/group_642c328a32e68.json

@@ -0,0 +1,70 @@
+{
+    "key": "group_642c328a32e68",
+    "title": "Alumnus Details",
+    "fields": [
+        {
+            "key": "field_642c328a3df63",
+            "label": "Profile Photo",
+            "name": "profile_photo",
+            "aria-label": "",
+            "type": "image",
+            "instructions": "",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "return_format": "array",
+            "library": "all",
+            "min_width": "",
+            "min_height": "",
+            "min_size": "",
+            "max_width": "",
+            "max_height": "",
+            "max_size": "",
+            "mime_types": "",
+            "preview_size": "medium"
+        },
+        {
+            "key": "field_642c328a419f4",
+            "label": "Student Designation",
+            "name": "alumni_designation",
+            "aria-label": "",
+            "type": "text",
+            "instructions": "",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "default_value": "",
+            "maxlength": "",
+            "placeholder": "Senior Database Engineer, Google",
+            "prepend": "",
+            "append": ""
+        }
+    ],
+    "location": [
+        [
+            {
+                "param": "post_type",
+                "operator": "==",
+                "value": "alumni"
+            }
+        ]
+    ],
+    "menu_order": 0,
+    "position": "side",
+    "style": "default",
+    "label_placement": "top",
+    "instruction_placement": "label",
+    "hide_on_screen": "",
+    "active": true,
+    "description": "",
+    "show_in_rest": 0,
+    "modified": 1680618236
+}

+ 45 - 0
inc/acf-json/group_642c37b2a5b50.json

@@ -0,0 +1,45 @@
+{
+    "key": "group_642c37b2a5b50",
+    "title": "Notice Details",
+    "fields": [
+        {
+            "key": "field_642c37b2aa16f",
+            "label": "Notice Date",
+            "name": "notice_date",
+            "aria-label": "",
+            "type": "date_picker",
+            "instructions": "For the date picker, click on the input field.",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "display_format": "F j, Y",
+            "return_format": "F j, Y",
+            "first_day": 0
+        }
+    ],
+    "location": [
+        [
+            {
+                "param": "post_type",
+                "operator": "==",
+                "value": "notice"
+            }
+        ]
+    ],
+    "menu_order": 0,
+    "position": "side",
+    "style": "default",
+    "label_placement": "top",
+    "instruction_placement": "label",
+    "hide_on_screen": [
+        "slug"
+    ],
+    "active": true,
+    "description": "",
+    "show_in_rest": 0,
+    "modified": 1680619579
+}

+ 43 - 0
inc/acf-json/group_642c38b31afcd.json

@@ -0,0 +1,43 @@
+{
+    "key": "group_642c38b31afcd",
+    "title": "API Details",
+    "fields": [
+        {
+            "key": "field_642c38b35b140",
+            "label": "Instruction:",
+            "name": "",
+            "aria-label": "",
+            "type": "message",
+            "instructions": "",
+            "required": 0,
+            "conditional_logic": 0,
+            "wrapper": {
+                "width": "",
+                "class": "",
+                "id": ""
+            },
+            "message": "An application programming interface is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software.",
+            "new_lines": "wpautop",
+            "esc_html": 0
+        }
+    ],
+    "location": [
+        [
+            {
+                "param": "options_page",
+                "operator": "==",
+                "value": "acf-options-api-settings"
+            }
+        ]
+    ],
+    "menu_order": 0,
+    "position": "normal",
+    "style": "default",
+    "label_placement": "top",
+    "instruction_placement": "label",
+    "hide_on_screen": "",
+    "active": true,
+    "description": "",
+    "show_in_rest": 0,
+    "modified": 1680619776
+}

+ 3 - 15
inc/acf-settings.php

@@ -1,7 +1,7 @@
 <?php
 
 // Hide ACF field group menu item
-add_filter('acf/settings/show_admin', '__return_false');
+// add_filter('acf/settings/show_admin', '__return_false');
 
 // Customize ACF path
 add_filter('acf/settings/path', 'my_acf_settings_path');
@@ -76,20 +76,8 @@ if (function_exists('acf_add_options_page')) {
     ));
 
     acf_add_options_sub_page(array(
-        'page_title'     => 'Department of CSE: Event Settings',
-        'menu_title'    => 'Event Settings',
-        'parent_slug'    => 'uiu-cse-general-settings',
-    ));
-
-    acf_add_options_sub_page(array(
-        'page_title'     => 'Department of CSE: News Settings',
-        'menu_title'    => 'News Settings',
-        'parent_slug'    => 'uiu-cse-general-settings',
-    ));
-
-    acf_add_options_sub_page(array(
-        'page_title'     => 'Department of CSE: Student Story',
-        'menu_title'    => 'Student Story',
+        'page_title'     => 'Department of CSE: API Settings',
+        'menu_title'    => 'API Settings',
         'parent_slug'    => 'uiu-cse-general-settings',
     ));
 

+ 314 - 2
inc/custom-post-type.php

@@ -1,7 +1,7 @@
 <?php
 
 // Register Faculty Post Type
-function cpt_uiu_faculty()
+function uiu_cpt_faculty()
 {
 
     $labels = array(
@@ -21,6 +21,10 @@ function cpt_uiu_faculty()
         'view_item'             => 'View Faculty',
         'view_items'            => 'View Faculties',
         'search_items'          => 'Search Faculty',
+        'featured_image'        => 'Cover Image',
+        'set_featured_image'    => 'Set cover image',
+        'remove_featured_image' => 'Remove cover image',
+        'use_featured_image'    => 'Use as cover image',
         'insert_into_item'      => 'Insert into faculty',
         'uploaded_to_this_item' => 'Uploaded to this faculty',
         'items_list'            => 'Faculties list',
@@ -57,4 +61,312 @@ function cpt_uiu_faculty()
     );
     register_post_type('faculty', $args);
 }
-add_action('init', 'cpt_uiu_faculty', 0);
+add_action('init', 'uiu_cpt_faculty', 0);
+
+// Register Success Story Post Type
+function uiu_cpt_story()
+{
+
+    $labels = array(
+        'name'                  => 'Success Stories',
+        'singular_name'         => 'Success Story',
+        'menu_name'             => 'Success Stories',
+        'name_admin_bar'        => 'Post Type',
+        'archives'              => 'Success Story Archives',
+        'attributes'            => 'Success Story Attributes',
+        'parent_item_colon'     => 'Parent Story:',
+        'all_items'             => 'All Stories',
+        'add_new_item'          => 'Add New Story',
+        'add_new'               => 'Add New',
+        'new_item'              => 'New Story',
+        'edit_item'             => 'Edit Story',
+        'update_item'           => 'Update Story',
+        'view_item'             => 'View Story',
+        'view_items'            => 'View Stories',
+        'search_items'          => 'Search Story',
+        'featured_image'        => 'Cover Image',
+        'set_featured_image'    => 'Set cover image',
+        'remove_featured_image' => 'Remove cover image',
+        'use_featured_image'    => 'Use as cover image',
+        'insert_into_item'      => 'Insert into story',
+        'uploaded_to_this_item' => 'Uploaded to this story',
+        'items_list'            => 'Success Stories list',
+        'items_list_navigation' => 'Success Stories list navigation',
+        'filter_items_list'     => 'Filter storys list',
+    );
+    $rewrite = array(
+        'slug'                  => 'success_story',
+        'with_front'            => true,
+        'pages'                 => true,
+        'feeds'                 => true,
+    );
+    $args = array(
+        'label'                 => 'Success Story',
+        'description'           => 'Success Story of Department of CSE',
+        'labels'                => $labels,
+        'supports'              => array('title', 'editor', 'thumbnail', 'revisions'),
+        // 'taxonomies'            => array('category', 'post_tag'),
+        'hierarchical'          => false,
+        'public'                => true,
+        'show_ui'               => true,
+        'show_in_menu'          => true,
+        'menu_position'         => 5,
+        'menu_icon'             => 'dashicons-businessperson',
+        'show_in_admin_bar'     => true,
+        'show_in_nav_menus'     => true,
+        'can_export'            => true,
+        'has_archive'           => true,
+        'exclude_from_search'   => false,
+        'publicly_queryable'    => true,
+        'rewrite'               => $rewrite,
+        'capability_type'       => 'post',
+        'show_in_rest'          => true,
+    );
+    register_post_type('success_story', $args);
+}
+add_action('init', 'uiu_cpt_story', 0);
+
+
+// Register Alumnus Post Type
+function uiu_cpt_alumni()
+{
+
+    $labels = array(
+        'name'                  => 'Alumni',
+        'singular_name'         => 'Alumnus',
+        'menu_name'             => 'Alumni',
+        'name_admin_bar'        => 'Post Type',
+        'archives'              => 'Alumnus Archives',
+        'attributes'            => 'Alumnus Attributes',
+        'parent_item_colon'     => 'Parent Alumnus:',
+        'all_items'             => 'All Alumni',
+        'add_new_item'          => 'Add New Alumnus',
+        'add_new'               => 'Add New',
+        'new_item'              => 'New Alumnus',
+        'edit_item'             => 'Edit Alumnus',
+        'update_item'           => 'Update Alumnus',
+        'view_item'             => 'View Alumnus',
+        'view_items'            => 'View Alumni',
+        'search_items'          => 'Search Alumnus',
+        'featured_image'        => 'Cover Image',
+        'set_featured_image'    => 'Set cover image',
+        'remove_featured_image' => 'Remove cover image',
+        'use_featured_image'    => 'Use as cover image',
+        'insert_into_item'      => 'Insert into alumnus',
+        'uploaded_to_this_item' => 'Uploaded to this alumnus',
+        'items_list'            => 'Alumni list',
+        'items_list_navigation' => 'Alumni list navigation',
+        'filter_items_list'     => 'Filter alumni list',
+    );
+    $rewrite = array(
+        'slug'                  => 'alumni',
+        'with_front'            => true,
+        'pages'                 => true,
+        'feeds'                 => true,
+    );
+    $args = array(
+        'label'                 => 'Alumnus',
+        'description'           => 'Alumnus of Department of CSE',
+        'labels'                => $labels,
+        'supports'              => array('title', 'editor', 'thumbnail', 'revisions'),
+        // 'taxonomies'            => array('category', 'post_tag'),
+        'hierarchical'          => false,
+        'public'                => true,
+        'show_ui'               => true,
+        'show_in_menu'          => true,
+        'menu_position'         => 5,
+        'menu_icon'             => 'dashicons-businessperson',
+        'show_in_admin_bar'     => true,
+        'show_in_nav_menus'     => true,
+        'can_export'            => true,
+        'has_archive'           => true,
+        'exclude_from_search'   => false,
+        'publicly_queryable'    => true,
+        'rewrite'               => $rewrite,
+        'capability_type'       => 'post',
+        'show_in_rest'          => true,
+    );
+    register_post_type('alumni', $args);
+}
+add_action('init', 'uiu_cpt_alumni', 0);
+
+
+// Register Notice Post Type
+function uiu_cpt_notice()
+{
+
+    $labels = array(
+        'name'                  => 'Notices',
+        'singular_name'         => 'Notice',
+        'menu_name'             => 'Notices',
+        'name_admin_bar'        => 'Post Type',
+        'archives'              => 'Notice Archives',
+        'attributes'            => 'Notice Attributes',
+        'parent_item_colon'     => 'Parent Notice:',
+        'all_items'             => 'All Notices',
+        'add_new_item'          => 'Add New Notice',
+        'add_new'               => 'Add New',
+        'new_item'              => 'New Notice',
+        'edit_item'             => 'Edit Notice',
+        'update_item'           => 'Update Notice',
+        'view_item'             => 'View Notice',
+        'view_items'            => 'View Notices',
+        'search_items'          => 'Search Notice',
+        'insert_into_item'      => 'Insert into notice',
+        'uploaded_to_this_item' => 'Uploaded to this notice',
+        'items_list'            => 'Notices list',
+        'items_list_navigation' => 'Notices list navigation',
+        'filter_items_list'     => 'Filter notices list',
+    );
+    $rewrite = array(
+        'slug'                  => 'notice',
+        'with_front'            => true,
+        'pages'                 => true,
+        'feeds'                 => true,
+    );
+    $args = array(
+        'label'                 => 'Notice',
+        'description'           => 'Notice of Department of CSE',
+        'labels'                => $labels,
+        'supports'              => array('title', 'editor', 'thumbnail', 'revisions'),
+        // 'taxonomies'            => array('category', 'post_tag'),
+        'hierarchical'          => false,
+        'public'                => true,
+        'show_ui'               => true,
+        'show_in_menu'          => true,
+        'menu_position'         => 5,
+        'menu_icon'             => 'dashicons-businessperson',
+        'show_in_admin_bar'     => true,
+        'show_in_nav_menus'     => true,
+        'can_export'            => true,
+        'has_archive'           => true,
+        'exclude_from_search'   => false,
+        'publicly_queryable'    => true,
+        'rewrite'               => $rewrite,
+        'capability_type'       => 'post',
+        'show_in_rest'          => true,
+    );
+    register_post_type('notice', $args);
+}
+add_action('init', 'uiu_cpt_notice', 0);
+
+
+// Register Event Post Type
+function uiu_cpt_event()
+{
+
+    $labels = array(
+        'name'                  => 'Events',
+        'singular_name'         => 'Event',
+        'menu_name'             => 'Events',
+        'name_admin_bar'        => 'Post Type',
+        'archives'              => 'Event Archives',
+        'attributes'            => 'Event Attributes',
+        'parent_item_colon'     => 'Parent Event:',
+        'all_items'             => 'All Events',
+        'add_new_item'          => 'Add New Event',
+        'add_new'               => 'Add New',
+        'new_item'              => 'New Event',
+        'edit_item'             => 'Edit Event',
+        'update_item'           => 'Update Event',
+        'view_item'             => 'View Event',
+        'view_items'            => 'View Events',
+        'search_items'          => 'Search Event',
+        'insert_into_item'      => 'Insert into event',
+        'uploaded_to_this_item' => 'Uploaded to this event',
+        'items_list'            => 'Events list',
+        'items_list_navigation' => 'Events list navigation',
+        'filter_items_list'     => 'Filter events list',
+    );
+    $rewrite = array(
+        'slug'                  => 'event',
+        'with_front'            => true,
+        'pages'                 => true,
+        'feeds'                 => true,
+    );
+    $args = array(
+        'label'                 => 'Event',
+        'description'           => 'Event of Department of CSE',
+        'labels'                => $labels,
+        'supports'              => array('title', 'editor', 'thumbnail', 'revisions'),
+        // 'taxonomies'            => array('category', 'post_tag'),
+        'hierarchical'          => false,
+        'public'                => true,
+        'show_ui'               => true,
+        'show_in_menu'          => true,
+        'menu_position'         => 5,
+        'menu_icon'             => 'dashicons-businessperson',
+        'show_in_admin_bar'     => true,
+        'show_in_nav_menus'     => true,
+        'can_export'            => true,
+        'has_archive'           => true,
+        'exclude_from_search'   => false,
+        'publicly_queryable'    => true,
+        'rewrite'               => $rewrite,
+        'capability_type'       => 'post',
+        'show_in_rest'          => true,
+    );
+    register_post_type('event', $args);
+}
+add_action('init', 'uiu_cpt_event', 0);
+
+
+
+// Register News Post Type
+function uiu_cpt_news()
+{
+
+    $labels = array(
+        'name'                  => 'News',
+        'singular_name'         => 'News',
+        'menu_name'             => 'News',
+        'name_admin_bar'        => 'Post Type',
+        'archives'              => 'News Archives',
+        'attributes'            => 'News Attributes',
+        'parent_item_colon'     => 'Parent News:',
+        'all_items'             => 'All News',
+        'add_new_item'          => 'Add New News',
+        'add_new'               => 'Add New',
+        'new_item'              => 'New News',
+        'edit_item'             => 'Edit News',
+        'update_item'           => 'Update News',
+        'view_item'             => 'View News',
+        'view_items'            => 'View News',
+        'search_items'          => 'Search News',
+        'insert_into_item'      => 'Insert into news',
+        'uploaded_to_this_item' => 'Uploaded to this news',
+        'items_list'            => 'News list',
+        'items_list_navigation' => 'News list navigation',
+        'filter_items_list'     => 'Filter news list',
+    );
+    $rewrite = array(
+        'slug'                  => 'news',
+        'with_front'            => true,
+        'pages'                 => true,
+        'feeds'                 => true,
+    );
+    $args = array(
+        'label'                 => 'News',
+        'description'           => 'News of Department of CSE',
+        'labels'                => $labels,
+        'supports'              => array('title', 'editor', 'thumbnail', 'revisions'),
+        // 'taxonomies'            => array('category', 'post_tag'),
+        'hierarchical'          => false,
+        'public'                => true,
+        'show_ui'               => true,
+        'show_in_menu'          => true,
+        'menu_position'         => 5,
+        'menu_icon'             => 'dashicons-businessperson',
+        'show_in_admin_bar'     => true,
+        'show_in_nav_menus'     => true,
+        'can_export'            => true,
+        'has_archive'           => true,
+        'exclude_from_search'   => false,
+        'publicly_queryable'    => true,
+        'rewrite'               => $rewrite,
+        'capability_type'       => 'post',
+        'show_in_rest'          => true,
+    );
+    register_post_type('news', $args);
+}
+add_action('init', 'uiu_cpt_news', 0);

+ 12 - 4
inc/theme-settings.php

@@ -8,7 +8,7 @@ function new_excerpt_more($more)
 	return '... <a class="readmore" href="' . get_permalink() . ' ">Read more <i class="fa fa-external-link"></i></a>';
 }
 
-add_filter('excerpt_more', 'new_excerpt_more');
+// add_filter('excerpt_more', 'new_excerpt_more');
 
 /**
  * Custome Lenght of excerpt
@@ -95,6 +95,14 @@ function tinymce_settings($settings)
 
 
 // Removing the Editor from a WordPress Post Type
-add_action('init', function () {
-	remove_post_type_support('faculty', 'editor');
-}, 99);
+// add_action('init', function () {
+// 	remove_post_type_support('faculty', 'editor');
+// }, 99);
+
+
+function prefix_disable_gutenberg($current_status, $post_type)
+{
+	if ($post_type === 'news' || $post_type === 'event' || $post_type === 'success_story' || $post_type === 'alumni'  || $post_type === 'notice') return false;
+	return $current_status;
+}
+add_filter('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2);