WordPress Hack #3

Here’s a function that really should be in WordPress core by now. And maybe it is and I just can’t find it. But to get the source url for a post thumbnail you have to hack. Here it is: /** ** ** Parameters: ** Size (optional): The width/height of the source image. Accepts either a [...]

WordPress Hack #2: Protect Your Admin

Ever wanted to protect your admin area from access by non-admin users? Try adding this to your functions.php. add_action(‘auth_redirect’,'custom_admin_access’); function custom_admin_access() { global $current_user; if( !current_user_can(‘manage_options’) && is_admin() ) { wp_redirect( home_url() ); } }