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 | |
function url_spamcheck( $approved , $commentdata ) { | |
return ( strlen( $commentdata['comment_author_url'] ) > 50 ) ? 'spam' : $approved; | |
} | |
add_filter( 'pre_comment_approved', 'url_spamcheck', 99, 2 ); | |
?> |
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 | |
// Standard Size Thumbnail | |
if(false === get_option("thumbnail_crop")) { | |
add_option("thumbnail_crop", "1"); } | |
else { | |
update_option("thumbnail_crop", "1"); | |
} | |
// Medium Size Thumbnail | |
if(false === get_option("medium_crop")) { |
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 | |
/** | |
* The Header for AlbinoMouse. | |
* @package AlbinoMouse | |
*/ | |
?> | |
<!DOCTYPE html> | |
<?php $options = get_option( 'albinomouse' ); ?> | |
<html <?php language_attributes(); ?>> |
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 | |
function new_excerpt_more( $more ) { | |
return '...'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); | |
?> |
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 | |
function custom_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); | |
?> |
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 | |
function excerpt_read_more_link($output) { | |
global $post; | |
return $output . '<a href="'. get_permalink($post->ID) . '">Read All ...</a>'; | |
} | |
add_filter('the_excerpt', 'excerpt_read_more_link'); | |
?> |
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 | |
function show_image_sizes( $sizes ) { | |
$new_sizes = array(); | |
$added_sizes = get_intermediate_image_sizes(); | |
// $added_sizes is an indexed array, therefore need to convert it | |
// to associative array, using $value for $key and $value | |
foreach( $added_sizes as $key => $value) { | |
$new_sizes[$value] = $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 | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code = '<div>Ads code goes here</div>'; |
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
$(‘img’).load(function() { | |
console.log(‘image load successful’); | |
}); |
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
// Back To Top | |
$('a.top').click(function(){ | |
$(document.body).animate({scrollTop : 0},800); | |
return false; | |
}); | |
//Create an anchor tag | |
<a class=”top” href=”#”>Back to top</a> |