Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function my_editor_style() {
- global $current_screen;
- switch ($current_screen->post_type) {
- case 'post':
- //echo '<script>alert("post");</script>';
- break;
- case 'page':
- echo '<script type="text/javascript" src="'.get_bloginfo('template_directory') .'/custom-fields/options.js"></script>
- <link rel="stylesheet" href="'.get_bloginfo('template_directory').'/custom-fields/editing.css" type="text/css" media="all" />';
- break;
- case 'acf': // CPT
- //echo '<script>alert("post");</script>';
- break;
- }
- /*
- // GET BY PAGE TEMPLATE
- // I couldn't make the add_editor_style work, so I used the above echo '<script>...';
- switch ($GLOBALS['post']->page_template) {
- case 'page-two-column.php': // Change to your template filename
- add_editor_style('editor-style-two-column.css');
- break;
- default:
- add_editor_style('editor-style.css');
- break;
- }
- */
- }
- add_action( 'admin_head', 'my_editor_style' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement