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
//form toggle function | |
jQuery.fn.ToggleInputValue = function (){ | |
return jQuery( this ).each(function (){ | |
var Input = jQuery( this ); | |
var default_value = Input.val(); | |
Input.focus(function () { | |
if( Input.val() == default_value ) Input.val( '' ); | |
}).blur(function(){ | |
if( Input.val().length == 0 ) Input.val( default_value ); |
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 | |
add_action( 'widgets_init', 'load_custom_widgets' ); | |
/* register widgets */ | |
function load_custom_widgets() { | |
register_widget( 'basic_widget' ); | |
} | |
/* add basic widget */ |
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 | |
// shorten up string if need be | |
function truncate_string($string, $desired_width) { | |
$small_string = strlen($string) > $desired_width ? substr( $string, 0, $desired_width ) . "..." : $string; | |
return $small_string; | |
} |
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 | |
// replace excerpt ellipsis with read more | |
add_filter('excerpt_more', 'excerpt_read_more'); | |
function excerpt_read_more( $text ) { | |
return '... <a href="'. get_permalink($post->ID) . '">' . 'Read More »' . '</a>'; | |
} |
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 | |
$featured_image_id = get_post_thumbnail_id(); | |
if ( $featured_image_id ) { | |
$featured_image_array = wp_get_attachment_image_src( $featured_image_id, 'medium', true ); | |
$featured_image_url = $featured_image_array[0]; | |
} |
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_value upload_max_filesize 64M | |
php_value post_max_size 64M | |
php_value max_execution_time 259200 | |
php_value max_input_time 259200 | |
php_value memory_limit 256M |
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 | |
// this is a very specific script that moves pages to posts and assigns a category based on the parent. it also out outputs text for 301 redirects | |
$baseYear = 82; // 1998 | |
$monthArr = array('1' => 'Jan/Feb', '2' => 'March/April', '3' => 'May/June', '4' => 'July/August', '5' => 'September/October', '6' => 'November/December'); | |
$redirectStr = ''; | |
global $wpdb; | |
$pages = $wpdb->get_results( | |
" |
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 | |
// set up custom post types | |
add_action( 'init', 'add_cpt' ); | |
function add_cpt() { | |
$faq_labels = array( | |
'name' => 'FAQ', | |
'singular_name' => 'FAQ', |