Skip to content

Instantly share code, notes, and snippets.

@ckpicker
Last active December 13, 2015 18:38
Show Gist options
  • Save ckpicker/4956646 to your computer and use it in GitHub Desktop.
Save ckpicker/4956646 to your computer and use it in GitHub Desktop.
Add this code to your functions.php file. Make sure you upload 'description-count.js' to the following directory: 'YOUR_THEME_DIRECTORY/js/'
// Add our special description count js
add_action( 'wp_enqueue_scripts', 'our_admin_scripts' );
function our_admin_scripts( $hook ) {
global $post_type;
if( tribe_is_community_edit_event_page() ) { // So this only works for posts, would need to edit for events custom post type
$js_dir = trailingslashit( get_template_directory_uri() ) . 'js/';
wp_register_script('our-admin-js', $js_dir . 'description-count.js', array('jquery'), null);
wp_enqueue_script('our-admin-js');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment