Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
/* | |
SCSS Color Methods for Accessibility | |
================================================================================ | |
Adjust given colors to ensure that those color combination provide sufficient | |
contrast. | |
@version 0.1 | |
@link http://eye48.com/go/scsscontrast |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
// Getting current blog_id | |
global $wpdb, $current_blog; | |
$id = $current_blog->blog_id; | |
// Setting variable for current blog_prefix | |
$blog_prefix = $wpdb->get_blog_prefix( $id ); | |
// Start the BuddyPress Ajax Members Loop | |
if ( bp_has_members( bp_ajax_querystring( 'members' ).'&meta_key='.$blog_prefix.'capabilities' ) ) : ?> |
<?php | |
//Add a custom admin dashboard welcome widget | |
function custom_dashboard_widget() { | |
echo '<h1>Welcome to your new WordPress site built by an awesome developer</h1>'; | |
} | |
function add_custom_dashboard_widget() { | |
wp_add_dashboard_widget('custom_dashboard_widget', 'Integrity Welcomes You To WordPress!', 'custom_dashboard_widget'); | |
} | |
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget'); |
<?php | |
/* | |
* Remove any unwanted widgets... | |
* | |
* WP_Widget_Pages = Pages Widget | |
* WP_Widget_Calendar = Calendar Widget | |
* WP_Widget_Archives = Archives Widget | |
* WP_Widget_Links = Links Widget | |
* WP_Widget_Meta = Meta Widget | |
* WP_Widget_Search = Search Widget |
<?php | |
// Remove Meta-Boxes from Posts & Pages Editor Screens | |
function remove_extra_meta_boxes() { | |
remove_meta_box( 'postcustom' , 'post' , 'normal' ); // custom fields for posts | |
remove_meta_box( 'postcustom' , 'page' , 'normal' ); // custom fields for pages | |
remove_meta_box( 'postexcerpt' , 'post' , 'normal' ); // post excerpts | |
remove_meta_box( 'postexcerpt' , 'page' , 'normal' ); // page excerpts | |
remove_meta_box( 'commentsdiv' , 'post' , 'normal' ); // recent comments for posts | |
remove_meta_box( 'commentsdiv' , 'page' , 'normal' ); // recent comments for pages | |
remove_meta_box( 'tagsdiv-post_tag' , 'post' , 'side' ); // post tags |
<?php | |
// Customize Admin toolbar if you do desiced to keep it around... | |
function change_toolbar($wp_toolbar) { | |
$wp_toolbar->remove_node('comments'); | |
$wp_toolbar->add_node(array( | |
'id' => 'myhelp', | |
'title' => 'Help', | |
'meta' => array('target' => 'help') | |
)); | |
$wp_toolbar->add_node(array( |
/* | |
* Mod Default Query | |
* | |
* get at the default query and make your changes before the template ( or whatever is run ) | |
* | |
*/ | |
function ahso_default_query_mods( $query ) { | |
// use conditional tags | |
if ( is_tax('work_cat') ) { |