@vemuez
you need to enqueue js and css files to admin_print_script and admin_print_style
here is the example to how to do it
// Register datepicker ui for properties
function admin_homes_for_sale_javascript()
{
global $post;
if($post->post_type == 'homes-for-sale' && is_admin()) {
wp_enqueue_script('jquery-ui-datepicker', WP_CONTENT_URL . '/themes/yourthemename/js/jquery-ui-datepicker.min.js');
}
}
add_action('admin_print_scripts', 'admin_homes_for_sale_javascript');
// Register ui styles for properties
function admin_homes_for_sale_styles(){
global $post;
if($post->post_type == 'homes-for-sale' && is_admin()) {
wp_enqueue_style('jquery-ui', WP_CONTENT_URL . '/themes/yourthemename/css/jquery-ui-1.8.11.custom.css');
}
}
add_action('admin_print_styles', 'admin_homes_for_sale_styles');
or try this
https://en.bainternet.info/how-i-add-a-wordpress-metabox/#toc-dn
Related Posts:
- Custom Post Type Archives by Year & Month?
- Set post date before 1970
- How to order posts of a custom post type by date DESC in dashboard Admin?
- WP_Query() show posts that end later than today
- Uploading DB to server from local is not matching the post dates
- Permalinks using event date (year & month) instead of publication date
- How to sort CPT by custom meta value (date), and return posts month by month
- Date query for a custom meta field
- How to make an archive page displaying posts in a date range
- Query current and future events, ordered by begin date
- Displaying custom posts only if custom meta box’s date is not expired
- Get the next event using date_query
- get_queried_object error How to show post count by month in the taxonomy page
- Custom Post Type Events Archive Grouped By Month
- query_posts with a custom post type, a meta_query and sorting by post date?
- Default sort on admin columns with meta date hides draft posts with empty date value
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Post count by month of taxonmy term
- Meta Query posts not showing on ending date of custom field
- Use the same date-based permalink structure for all post types
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Order post by date with ACF
- Sort custom post type by most current date picker
- I am trying to get cutom post cout by month of current taxonmy term
- How to display a WordPress Custom Field only on a specific day of the week?
- WordPress giving a 404 page when passing a year argument different than the current year
- Using WP meta query to show custom post types by a start and finish date
- Why does my URL keep returning 404 error code?
- Problem with date comparison for custom fields
- Using global $post; with custom post types
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- How to set post date in post_type so that it’s same as latest post in category
- Display post count for a specific month
- Compare ACF Date field to today or yesterday
- get_queried_object not work in taxonomy page
- Want to display my custom date archive to date.php but dont know how
- Pre_get_posts comparison with custom field doesn’t work
- Display year value before a set of posts
- date archive future posts
- Get month and day from a Date Picker custom field
- Loop posts in a table ordered by a custom field value
- group posts by month/date ignore years
- How to get past and upcoming post by defining date in custom field?
- How to display custom post type ordered by a custom field date
- Change custom post status to draft before today
- How to save an integer as taxonomy term?
- Generate daily archive whenever any post type is added
- Create a list of months based posts
- How to randomize published date for WordPress custom post type
- ACF Field to set Publish Date – Post Duplication upon Update
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Order Wp Query by earliest of 3 dates meta query
- WP_Query() displaying past post / event
- How to display *block number* instead *date value* on WordPress posts?
- How to query for posts (in hierarchical custom post type) that have children?
- 404 error PageNavi custom type taxonomy | wordpress
- Registering tags taxonomy for a custom post type
- Message on Custom Posts Type admin page
- Why do my custom post types show up in the dashboard, but not on my site?
- Export Custom Post Type posts with all Custom Fields and Custom Texonomy associated with it
- Displaying a custom post types custom taxonomy value?
- wpdb custom post_type problem
- Custom Post Type Not working like a Post?
- Show the same Article Available in Other Categories
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- register_post_meta show “Null”
- Custom Posts on homepage
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom Post Conditional for Parent & Child Single.php?
- Autocomplete or suggest from post titles inside plugin
- How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?
- Convert post type to another
- WordPress wp_query() basic question about args
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- How can I set a meta value that will then affect other post meta values?
- Get a list of all custom post type names/slugs [duplicate]
- WP_Query get post from a category and from another post type
- Custom Post Type View Button in Admin Gives 400 Error
- either single-{custom}.php 404’s OR /taxonomy/ 404’s – custom post type and taxonomy permalinks
- How do I list the next 7 days and any events (cpt) contained in those days
- Custom Post Types Not Showing Up In query_posts Result
- Do I need a loop to display an object that attached to posts?
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- Select custom post type do display from page editor
- Get Custom Post types data from the API
- Search only one custom post type
- If ACF Post Object post has custom taxonomy term…
- How to filter taxonomy of a custom post type and display it in the single post type page in the back end?
- sorting in wp query based on custom field value
- Include images from pages in wp search.php results in default wp search
- Custom post type post_type_link gives “page not found” on any other custom post type
- getting a blank login page :( any way I can fix this without having to do a clean install?
- Page to show custom posts and one category
- Custom Search not working
- Pagination not working with custom loop
- Hide custom post type and use its slug in new plugin menu
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- How to display posts from IMPress for IDX Broker on home page? [closed]
- Permalinks for Custom Post Types and Taxonomies