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
////////////////////////////////// | |
// DELETE ALL TERMS IN TAXONOMY // | |
////////////////////////////////// | |
function landbryo_delete_terms() { | |
if ( is_admin() ) { | |
$tax = 'tax-slug'; | |
$terms = get_terms( $tax, array( 'fields' => 'ids', 'hide_empty' => false ) ); | |
foreach ( $terms as $value ) { | |
wp_delete_term( $value, $tax ); |
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
///////////////////////////////////// | |
// CHANGE THEME OPTIONS MENU TITLE // | |
///////////////////////////////////// | |
add_filter('avia_filter_backend_page_title', 'change_theme_title'); | |
function change_theme_title() { | |
return 'Theme Options'; | |
} |
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
////////////////////////////// | |
// REMOVE ENFOLD POWERED BY // | |
////////////////////////////// | |
function remove_backlink($link) { | |
return ''; | |
} | |
add_filter('kriesi_backlink', 'remove_backlink', 10, 1); |
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
///////////////////////// | |
// CUSTOM QUERY FILTER // | |
///////////////////////// | |
function orderby_lastname($orderby_statement) { | |
$orderby_statement = "RIGHT(post_title, LOCATE(' ', REVERSE(post_title)) - 1) ASC"; | |
return $orderby_statement; | |
} | |
// add filter with function before args |
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
////////////////////////////////// | |
// DIABLE PLUGIN UPDATE COUNTER // | |
////////////////////////////////// | |
add_filter('site_transient_update_plugins', '__return_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
/* enqueue child script if not in dashboard */ | |
if (!(is_admin())) { | |
function change_aviajs() { | |
wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); | |
} | |
add_action( 'wp_print_scripts', 'change_aviajs', 100 ); | |
} | |
/* dequeue child script */ |
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
////////////////// | |
// DEFER JQUERY // | |
////////////////// | |
if (!(is_admin())) { | |
function defer_parsing($url) { | |
if (FALSE === strpos($url, '.js')) return $url; | |
if (strpos($url, 'jquery.js')) return $url; | |
return "$url' defer onload='"; |
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
/////////////////////// | |
// CHANGE IMG EDITOR // | |
/////////////////////// | |
function landbryo_img_edit($array) { | |
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); | |
} | |
add_filter( 'wp_image_editors', 'landbryo_img_edit' ); |
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
jQuery('img').removeAttr('title'); |
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
git clone https:// // clone repository | |
git add -A // stages all | |
git add . // stages new and modified, without deleted | |
git add -u // stages modified and deleted, without new | |
git commit -m "add message here" //commit changes with a message | |
git push origin master //push changes to master branch | |
git reset --hard | |
git pull |