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
$(document).on('replace', 'img', function() { | |
$(document).foundation('equalizer', 'reflow'); | |
}); |
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
// fix for forcing close of foundation modals with close button | |
$('.close-reveal-modal').on('click tap touchstart', function() { | |
return $('[data-reveal]').foundation('reveal', 'close'); | |
}); |
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
var rtime = new Date(1, 1, 2000, 12,00,00); | |
var timeout = false; | |
var delta = 200; | |
$(window).resize(function() { | |
rtime = new Date(); | |
if (timeout === false) { | |
timeout = true; | |
setTimeout(resizeend, delta); | |
} | |
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
***** for functions.php ***** | |
// custom pagination | |
function custom_pagination($numpages = '', $pagerange = '', $paged='') { | |
if (empty($pagerange)) { | |
$pagerange = 10; | |
} | |
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
============================ | |
/***** a more complex way to get adjacent records based on some parameters *****/ | |
THE CODE | |
============================ | |
<?php | |
// grab the id for the current post | |
$theBookId = get_the_ID(); | |
// grab some related taxonomy to filter by |
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
/* Manipulate the BOOKS ADMIN columns | |
* ================================================== */ | |
add_filter('manage_edit-book_columns', 'ep_remove_unwanted_columns'); | |
add_filter('manage_edit-book_columns', 'ep_add_book_columns', 5); | |
add_action('manage_book_posts_custom_column', 'ep_get_book_column_values', 5, 2); | |
// Remove unwanted columns | |
function ep_remove_unwanted_columns($defaults){ | |
unset($defaults['author']); | |
return $defaults; |
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
// apply tags to attachments | |
function wptp_add_tags_to_attachments() { | |
register_taxonomy_for_object_type( 'post_tag', 'attachment' ); | |
} | |
add_action( 'init' , 'wptp_add_tags_to_attachments' ); |
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
/* Disable visual tab for ALL USERS | |
* ================================================== */ | |
add_filter('user_can_richedit' , create_function('' , 'return false;') , 50); |
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
//Add custom column | |
add_filter('manage_edit-YOURPOSTTYPENAME_columns', 'my_columns_head'); | |
function my_columns_head($defaults) { | |
$defaults['YOURCOLUMNNAME'] = 'YOURCOLUMNTITLE'; | |
return $defaults; | |
} | |
//Add rows data | |
add_action( 'manage_YOURPOSTTYPENAME_posts_custom_column' , 'my_custom_column', 10, 2 ); | |
function my_custom_column($column, $post_id ){ | |
switch ( $column ) { |
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
/* Upgrade the Media search to allow for searching the filename. | |
* =========================================================== */ | |
add_filter( 'posts_search', 'guid_search_media', 10, 2 ); | |
function guid_search_media( $search, $a_wp_query ) | |
{ | |
global $wpdb, $pagenow; | |
// Only Admin side && Only Media Library page |
NewerOlder