Skip to content

Instantly share code, notes, and snippets.

View crossreftech's full-sized avatar

CrossRefTech crossreftech

View GitHub Profile
/**************************************
****** Add Style to first post *******
**************************************/
.first-post {
color: #333;
background: #eaeaea;
border: solid #ccc 2px;
padding: 15px;
}
<?php // Dont't include php tags when adding to the functions file
add_filter( 'show_admin_bar', '__return_false' );
?>
<?php
// Change the default Enter Title Here text
function custom_title_here_text( $title ){
$screen = get_current_screen();
if ( 'POST_TYPE' == $screen->post_type ) {
$title = 'Enter Custom Title';
}
return $title;
}
add_filter( 'enter_title_here', 'custom_title_here_text' );
<?php
// Hide update notification
function hide_update_notification() {
echo '<style type="text/css">
.update-nag {display: none}
</style>';
}
add_action('admin_head', 'hide_update_notification');
<?php
// Disable draggable metaboxes
function non_draggable_metabox() {
wp_deregister_script('postbox');
}
add_action( 'admin_init', 'non_draggable_metabox' );
<?php
// Create a custom theme for your login page
function plugin_drawer_login() {
echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/wp-login.css"/>';
}
add_action('login_head', 'plugin_drawer_login');
?>
<?php
//set a custom excerpt length
function pd_custom_excerpt_length( $length ) {
//change the following to the number of words you would like to display
return 20;
}
add_filter( 'excerpt_length', 'pd_custom_excerpt_length');
?>
<?php
// Change the login screen error messages
function pd_login_error(){ return '<strong>Sorry!</strong>: It looks like you my have the wrong login information.';}
add_filter( 'login_errors', 'pd_login_error' );
?>
<?php
// Remove the theme and plugin editors from the dashboard
define('DISALLOW_FILE_EDIT', true);
?>