Last active
August 29, 2015 13:56
-
-
Save morktron/9221287 to your computer and use it in GitHub Desktop.
Add css to Wordpress admin via child theme functions.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// hide field table from all pages in admin except 'company profile' | |
add_action('admin_enqueue_scripts', 'my_hide_field_table_func'); | |
function my_hide_field_table_func(){ | |
$arr = array(74); | |
if(get_post_type() == 'page' && !in_array(get_the_ID(), $arr)) | |
{ | |
wp_enqueue_style( 'hide_field_table', bloginfo('stylesheet_directory').'/wp-content/themes/child-theme-name/custom-admin.css'); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in this case the custom-admin.css file is only loaded for Wordpress 'pages' unless the id of the page is 74