Make WordPress Editor Allow iFrames

// make TinyMCE allow iframes add_filter(‘tiny_mce_before_init’, create_function( ‘$a’, ‘$a[“extended_valid_elements”] = “iframe[id|class|title|style|align| frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]”; return $a;’) );

Read More

Display Specific Content only for logged in users

Tested on: WordPress 3.0.1 function content_only4logged_in($content) { // ALL LOGGED IN USERS if ( is_user_logged_in() && !is_null($content) && !is_feed() ) { return $content; } else { $content = wp_html_excerpt( $content, 80 ); $content .= ‘ …’; $content .= __( ‘Sorry, more of this content is only available for logged users.’, FB_TEXTDOMAIN ); return $content; } […]

Read More

Custom excerpt length

function excerpt($num) { $limit = $num+1; $excerpt = explode(‘ ‘, get_the_excerpt(), $limit); array_pop($excerpt); $excerpt = implode(” “,$excerpt).”… (<a href='” .get_permalink($post->ID) .” ‘>Read more</a>)”; echo $excerpt; } Limit the length of the displayed excerpt by writing in the theme: excerpt(’20’); Example: <?php excerpt(’22’); ?> This will limit the excerpt to 22 characters. The excerpt will be […]

Read More

Custom Dashboard CSS

/* Change WordPress dashboard CSS */ function custom_admin_styles() { echo ‘<style type=”text/css”>#wphead{background:#069}</style>’; } add_action(‘admin_head’, ‘custom_admin_styles’); function custom_admin_styles() {     echo ‘<style type=”text/css”>#wp-admin-bar-new-content{display:none;}</style>’;     echo ‘<style type=”text/css”>#wp-admin-bar-comments{display:none;}</style>’;     echo ‘<style type=”text/css”>#wp-admin-bar-wp-logo{display:none;}</style>’;     echo ‘<style type=”text/css”>#screen-meta-links{display:none;}</style>’; } You can add any changes to the css between the tags.

Read More

Custom Admin Footer

function custom_admin_footer() { echo ‘Welcome to my blog! No More Documentation Links!’; } add_filter(‘admin_footer_text’, ‘custom_admin_footer’);

Read More

Custom Favicon WP-Admin

function admin_favicon() { echo ‘<link rel=”shortcut icon” type=”image/x-icon” href=”‘ . get_bloginfo(‘template_directory’) . ‘/images/favicon.ico” />’; } add_action( ‘admin_head’, ‘admin_favicon’ );  

Read More

Excerpt Ending

function new_excerpt_more($more) { return ‘…’; } add_filter(‘excerpt_more’, ‘new_excerpt_more’);  

Read More

Change the “Howdy” message to “Welcome”

This is what is running on this site: function change_howdy($translated, $text, $domain) { if (!is_admin() || ‘default’ != $domain) return $translated; if (false !== strpos($translated, ‘Howdy’)) return str_replace(‘Howdy’, ‘Welcome’, $translated); return $translated; } add_filter(‘gettext’, ‘change_howdy’, 10, 3);   With this function you can customize the “Howdy” message in top right of your admin area. This […]

Read More

Custom Admin Footer

// customize admin footer text function custom_admin_footer() { echo ‘add your custom footer text and html here’; } add_filter(‘admin_footer_text’, ‘custom_admin_footer’); I use this for client sites as a simple point of reference to contact me as the dev.

Read More