From 68d84424ba7589180afb5a68c0edc99601aed15d Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 9 Nov 2023 12:28:28 +0100 Subject: [PATCH] adding jobs post type --- includes/admin.php | 1 + includes/post_types.php | 18 ++++++++++++++++++ resources/css/admin-style.css | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/includes/admin.php b/includes/admin.php index 36e53f1..f4d2140 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -309,6 +309,7 @@ function my_new_admin_menu_order($menu_order) 'edit.php?post_type=brochures' => 3, 'edit.php?post_type=fiches-infos' => 4, 'edit.php?post_type=vocabulaire' => 5, + 'edit.php?post_type=jobs' => 10, ); // helper function to move an element inside an array function move_element(&$array, $a, $b) diff --git a/includes/post_types.php b/includes/post_types.php index d290ed1..d244302 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -131,6 +131,24 @@ function create_posttype() 'supports' => array('title', 'custom-fields'), ) ); + register_post_type( + 'jobs', + array( + 'labels' => array( + 'name' => __('Jobs', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Job', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => true, + 'rewrite' => array('slug' => 'fiche'), + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-id-alt', + 'menu_position' => 5.1, + 'supports' => array('title', 'custom-fields'), + 'supports' => array('title', 'editor', 'custom-fields', 'page-attributes'), + + ) + ); } add_action('init', 'create_posttype'); diff --git a/resources/css/admin-style.css b/resources/css/admin-style.css index 560f952..f3c685c 100644 --- a/resources/css/admin-style.css +++ b/resources/css/admin-style.css @@ -1,6 +1,13 @@ /* body { background: red !important; } */ + +.edit-post-visual-editor__post-title-wrapper { + h1 { + font-weight: revert; + font-size: revert; + } +} #menu-posts { border-top: 1px solid rgba(255, 255, 255, 0.2) !important; }