This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="author" content="Martin Bean" /> | |
<title>Twitter’s Bootstrap with Ryan Fait’s Sticky Footer</title> | |
<link rel="stylesheet" href="css/bootstrap.min.css" /> | |
<style> | |
html, body { | |
height: 100%; |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/updated-add-featured-thumbnail-to-admin-post-page-columns/ | |
if (function_exists( 'add_theme_support' )){ | |
add_filter('manage_posts_columns', 'posts_columns', 5); | |
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2); | |
add_filter('manage_pages_columns', 'posts_columns', 5); | |
add_action('manage_pages_custom_column', 'posts_custom_columns', 5, 2); | |
} | |
function posts_columns($defaults){ | |
$defaults['wps_post_thumbs'] = __('Thumbs'); |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/update-automatically-create-media_buttons-for-shortcode-selection/ | |
add_action('media_buttons','add_sc_select',11); | |
function add_sc_select(){ | |
global $shortcode_tags; | |
/* ------------------------------------- */ | |
/* enter names of shortcode to exclude bellow */ | |
/* ------------------------------------- */ | |
$exclude = array("wp_caption", "embed"); | |
echo ' <select id="sc_select"><option>Shortcode</option>'; |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/change-publish-metabox-text-for-custom-post-type/ | |
function wps_translation_mangler($translation, $text, $domain) { | |
global $post; | |
if ($post->post_type == 'events') { | |
$translations = &get_translations_for_domain( $domain); | |
if ( $text == 'Scheduled for: <b>%1$s</b>') { | |
return $translations->translate( 'Event Date: <b>%1$s</b>' ); | |
} | |
if ( $text == 'Published on: <b>%1$s</b>') { |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/add-html-to-feature-image-metabox/ | |
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_html'); | |
function add_featured_image_html( $html ) { | |
return $html .= '<p>This is some sample text that can be displayed within the feature image box.</p>'; | |
} |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/remove-the-screen-options-tab-with-screen_options_show_screen-hook/ | |
function remove_screen_options(){ | |
return false; | |
} | |
add_filter('screen_options_show_screen', 'remove_screen_options'); |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/display-db-queries-time-spent-and-memory-consumption/ | |
function performance( $visible = false ) { | |
$stat = sprintf( '%d queries in %.3f seconds, using %.2fMB memory', | |
get_num_queries(), | |
timer_stop( 0, 3 ), | |
memory_get_peak_usage() / 1024 / 1024 | |
); | |
echo $visible ? $stat : "<!-- {$stat} -->" ; | |
} |
This file contains hidden or 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
// Prevent direct file access to functions.php | |
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'functions.php' == basename($_SERVER['SCRIPT_FILENAME'])) | |
{ | |
die ('No access!'); | |
} |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/update-create-custom-post-status-mesasges-in-admin/ | |
// for layout fixes: http://pastebin.com/zNHEZMKR | |
add_filter( 'display_post_states', 'custom_post_state' ); | |
function custom_post_state( $states ) { | |
global $post; | |
$show_custom_state = get_post_meta( $post->ID, '_status' ); | |
// We are using "None" as a way to disable this feature for the current post. | |
if ( $show_custom_state && $show_custom_state[0] != 'None' ) $states[] = '<span class="custom_state ' . strtolower( $show_custom_state[0] ) . '">' . $show_custom_state[0] . '</span>'; |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/highlight-post_states-within-admin-posts-and-pages/ | |
function custom_post_states( $post_states ) { | |
foreach ( $post_states as &$state ){ | |
$state = '<span class="'.strtolower( $state ).' states">' . str_replace( ' ', '-', $state ) . '</span>'; | |
} | |
return $post_states; | |
} | |
add_filter( 'display_post_states', 'custom_post_states' ); | |
function custom_post_states_css(){ |
OlderNewer