This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add custom CTA styles to TinyMCE editor | |
if ( ! function_exists('tdav_css') ) { | |
function tdav_css($wp) { | |
$wp .= ',' . get_bloginfo('stylesheet_directory') . '/css/tinymce.css'; | |
return $wp; | |
} | |
} | |
add_filter( 'mce_css', 'tdav_css' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// basic sequence with LDAP is connect, bind, search, interpret search | |
// result, close connection | |
// using ldap bind | |
$ldaprdn = 'userid'; // ldap rdn or dn | |
$ldappass = 'password'; // associated password | |
echo "<h3>LDAP query test</h3>"; | |
echo "Connecting ..."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'manage_edit-events_columns', 'my_edit_events_columns' ) ; | |
function my_edit_events_columns( $columns ) { | |
$columns = array( | |
'cb' => '<input type="checkbox" />', | |
'title' => __( 'Event' ), | |
'event-date' => __( 'Event Date' ), | |
'category' => __( 'Category' ), | |
'date' => __( 'Date' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_login_logo() { | |
echo '<style type="text/css"> | |
.login h1 a { background-image: url("http://craveacademy.com/wp-content/uploads/wordpress-logo.png") !important; } | |
</style>'; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
function custom_login_url(){ | |
return 'http://www.craveacademy.com/'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'page_template', 'wpa3396_page_template' ); | |
function wpa3396_page_template( $page_template ) | |
{ | |
if ( is_page( 'my-custom-page-slug' ) ) { | |
$page_template = dirname( __FILE__ ) . '/custom-page-template.php'; | |
} | |
return $page_template; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add a custom message to the post message function | |
add_filter('post_updated_messages', 'listing_updated_messages'); | |
function listing_updated_messages( $messages ) { | |
$messages['listing'] = array( | |
0 => '', // Unused. Messages start at index 1. | |
1 => sprintf( __('Listing updated. <a href="%s">View Listing</a>'), esc_url( get_permalink($post_ID) ) ), | |
2 => __('Custom field updated.'), | |
3 => __('Custom field deleted.'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The register_post_type() function is not to be used before the 'init'. | |
add_action( 'init', 'my_custom_init' ); | |
/* Here's how to create your customized labels */ | |
function my_custom_init() { | |
$labels = array( | |
'name' => _x( 'Portfolio Galleries', 'post type general name' ), // Tip: _x('') is used for localization | |
'singular_name' => _x( 'Portfolio Gallery', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'Portfolio Gallery' ), | |
'add_new_item' => __( 'Add New Portfolio Gallery' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //view comments for instructions ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=Your App ID Here"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<meta property="fb:app_id" content="Your App ID Here"/> |
OlderNewer