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
/** | |
* Add a rel="nofollow" to the comment reply links | |
*/ | |
function comment_reply_link_nofollow( $link ) { | |
global $user_ID; | |
return str_replace( '")\'>', '")\' rel=\'nofollow\'>', $link ); | |
} | |
add_filter( 'comment_reply_link', 'comment_reply_link_nofollow' ); |
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
<?php | |
function getLatandLong($addr,$city,$state) | |
{ | |
global $lat; | |
global $lng; | |
$doc = new DOMDocument(); | |
$doc->load("http://maps.google.com/maps/api/geocode/xml?address=".$addr.",+".$city.",+".$state."&sensor=false"); //input address | |
//traverse the nodes to get to latitude and longitude |
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
add_action( 'save_post', 'wptuts_save_thumbnail' ); | |
function wptuts_save_thumbnail( $post_id ) { | |
// Get Thumbnail | |
$post_thumbnail = get_post_meta( $post_id, $key = '_thumbnail_id', $single = true ); | |
// Verify that post is not a revision | |
if ( !wp_is_post_revision( $post_id ) ) { | |
// Check if Thumbnail exists |
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
function modify_post_mime_types( $post_mime_types ) { | |
// select the mime type, here: 'application/pdf' | |
// then we define an array with the label values | |
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) ); | |
// then we return the $post_mime_types variable | |
return $post_mime_types; |
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
if (is_admin()) : | |
function my_remove_meta_boxes() { | |
if(!current_user_can('administrator')) { | |
remove_meta_box('linktargetdiv', 'link', 'normal'); | |
remove_meta_box('linkxfndiv', 'link', 'normal'); | |
remove_meta_box('linkadvanceddiv', 'link', 'normal'); | |
remove_meta_box('postexcerpt', 'post', 'normal'); | |
remove_meta_box('trackbacksdiv', 'post', 'normal'); | |
remove_meta_box('commentstatusdiv', 'post', 'normal'); | |
remove_meta_box('postcustom', 'post', 'normal'); |
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
/** | |
* Function: sanitize | |
* Returns a sanitized string | |
* | |
* Parameters: | |
* $string - The string to sanitize. | |
* $force_lowercase - Force the string to lowercase? | |
* $anal - If set to *true*, will remove all non-alphanumeric characters. | |
*/ | |
function sanitize($string, $force_lowercase = true, $anal = false) { |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} domain.com | |
RewriteRule (.*)$ http://newdomain.com/$1 [L] | |
RewriteRule ^index\.php$ - [L] | |
RewriteRule ^css/(.*) /wp-content/themes/roots/css/$1 [QSA,L] | |
RewriteRule ^js/(.*) /wp-content/themes/roots/js/$1 [QSA,L] | |
RewriteRule ^img/(.*) /wp-content/themes/roots/img/$1 [QSA,L] |
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
/** | |
* Desc: Get image source from feature image | |
* @param $id | |
* @param $icon = 'thumbnail, medium, large or full' | |
* @return $image source | |
*/ | |
function get_me_the_thumbnail_src($id , $size = 'full'){ | |
$tmp = wp_get_attachment_image_src ( get_post_thumbnail_id ( $id ), $icon ) ; | |
$str = $tmp[0]; | |
return $str; |
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
<?php | |
//set images directory | |
$directory = 'wp-content/themes/mizzou/images/banners/'; | |
try { | |
// create slideshow div to be manipulated by the above jquery function | |
echo "<div id=\"slideshow\">"; | |
//iterate through the directory, get images, set the path and echo them in img tags. | |
foreach ( new DirectoryIterator($directory) as $item ) { | |
if ($item->isFile()) { | |
$path = $directory . "/" . $item; |
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
$states = array(''=>"STATE",'AL'=>"Alabama",'AK'=>"Alaska",'AZ'=>"Arizona",'AR'=>"Arkansas", 'CA'=>"California", 'CO'=>"Colorado", 'CT'=>"Connecticut", 'DE'=>"Delaware", 'DC'=>"District Of Columbia", 'FL'=>"Florida", 'GA'=>"Georgia", 'HI'=>"Hawaii", 'ID'=>"Idaho", 'IL'=>"Illinois", 'IN'=>"Indiana", 'IA'=>"Iowa", 'KS'=>"Kansas", 'KY'=>"Kentucky", 'LA'=>"Louisiana", 'ME'=>"Maine", 'MD'=>"Maryland", 'MA'=>"Massachusetts", 'MI'=>"Michigan", 'MN'=>"Minnesota", 'MS'=>"Mississippi", 'MO'=>"Missouri", 'MT'=>"Montana", 'NE'=>"Nebraska", 'NV'=>"Nevada", 'NH'=>"New Hampshire", 'NJ'=>"New Jersey", 'NM'=>"New Mexico", 'NY'=>"New York", 'NC'=>"North Carolina", 'ND'=>"North Dakota", 'OH'=>"Ohio", 'OK'=>"Oklahoma", 'OR'=>"Oregon", 'PA'=>"Pennsylvania", 'RI'=>"Rhode Island",'SC'=>"South Carolina",'SD'=>"South Dakota",'TN'=>"Tennessee",'TX'=>"Texas",'UT'=>"Utah",'VT'=>"Vermont",'VA'=>"Virginia",'WA'=>"Washington",'WV'=>"West Virginia",'WI'=>"Wisconsin",'WY'=>"Wyoming"); | |
$states = array('AL'=>"Alabama", | |
'AK'=>" |