This is a work-in-progress cheatsheet for JS arrays. Please feel free to leave a comment if this has helped you or you would like to suggest anything.
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 jk_masonry() { | |
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) ); | |
} | |
add_action( 'wp_enqueue_scripts', 'jk_masonry' ); | |
/* | |
How to use? | |
$('#container').masonry({ singleMode: true }); |
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
<title> | |
<?php | |
if (function_exists('is_tag') && is_tag()) { | |
single_tag_title("Tag Archive for ""); echo '" - '; } | |
elseif (is_archive()) { | |
wp_title(''); echo ' Archive - '; } | |
elseif (is_search()) { | |
echo 'Search for "'.wp_specialchars($s).'" - '; } | |
elseif (!(is_404()) && (is_single()) || (is_page())) { | |
wp_title(''); echo ' - '; } |
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 if( is_home() || is_front_page() ) : ?> | |
<!-- Homepage Only Code --> | |
<?php else : ?> | |
<!-- Other Page Code --> | |
<?php endif; ?> |
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
$animations = array( | |
'bounce' => 'bounce', | |
'flash' => 'flash', | |
'pulse' => 'pulse', | |
'rubberBand' => 'rubberBand', | |
'shake' => 'shake', | |
'swing' => 'swing', | |
'tada' => 'tada', | |
'wobble' => 'wobble', | |
'jello' => 'jello', |
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
Windows Registry Editor Version 5.00 | |
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder] | |
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder] |
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
/* | |
* Change img src for disable img cache. | |
* @TODO remove on Production. | |
*/ | |
function wpse_84670_time_as_img_version($src) { | |
$src[0] = add_query_arg('dummy', time(), $src[0]); | |
return $src; | |
} |
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
/* | |
* Remove Website Field for Comment form | |
*/ | |
function ar_comment_website_remove( $fields ) { | |
if ( isset( $fields['url'] ) ) { | |
unset( $fields['url'] ); | |
} | |
return $fields; | |
} |
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
/* | |
* Show Custom Message After post Comment. | |
*/ | |
function ar_set_comment_cookies( $comment, $user ) { | |
setcookie( 'ta_comment_wait_approval', '1', 0, '/' ); | |
} | |
add_action( 'set_comment_cookies', 'ar_set_comment_cookies', 10, 2 ); | |
function ar_comment_sent_message() { |
OlderNewer