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
<? | |
$thumb = get_post_thumbnail_id(); | |
$path = wp_get_attachment_image_src($thumb); | |
$dimensions = getimagesize($path[0]); | |
$size = 300; | |
if ($dimensions[1] < $size) echo 'Larger than ' . $size . 'px'; |
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
<? | |
/* In functions.php */ | |
// Disable Wordpress update check | |
add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); | |
wp_clear_scheduled_hook('wp_version_check'); | |
// Disable theme update check | |
remove_action('load-update-core.php', 'wp_update_themes'); |
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
<? | |
$args = array( | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => false | |
); | |
$categories = get_terms('taxonomy_name', $args); |
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 | |
/* in function.php */ | |
// For debugging - display current template file | |
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
print_r($template); | |
} |
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 | |
/* add this to functions.php */ | |
// allow SVG uploads | |
function allow_svg_mime_types( $mimes ){ | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'allow_svg_mime_types'); |
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 this in functions.php */ | |
// avoid auto <p> | |
remove_filter('the_content', 'wpautop'); |
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 this in functions.php */ | |
// remove elements from head | |
remove_action('wp_head', 'rsd_link'); | |
remove_action('wp_head', 'wp_generator'); | |
remove_action('wp_head', 'feed_links', 2); | |
remove_action('wp_head', 'index_rel_link'); | |
remove_action('wp_head', 'wlwmanifest_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
<? | |
/* add one of this lines in WP-config.php (before Auth key) */ | |
/** Define revision number */ | |
define('WP_POST_REVISIONS', 10); | |
/** Disabled revision */ | |
define('WP_POST_REVISIONS', false); |
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 one of this lines in WP-config.php (before Auth key) */ | |
// Define number of days old to empty trash | |
define('EMPTY_TRASH_DAYS', 3); |
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
<? | |
/* in functions.php*/ | |
// remove emoticons external script | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
// remove completely CSS/JS scripts (new emoticons are always enabled) | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('admin_print_scripts', 'print_emoji_detection_script'); |
OlderNewer