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 | |
/* ---------------------------------------------------------------------------- | |
* Remove default image sizes | |
* ------------------------------------------------------------------------- */ | |
function remove_default_image_sizes( $sizes ) { | |
/* Default WordPress */ | |
unset( $sizes['thumbnail'] ); // Remove Thumbnail (150 x 150 hard cropped) | |
unset( $sizes['medium'] ); // Remove Medium resolution (300 x 300 max height 300px) |
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 numeric pagination to your theme | |
* ------------------------------------------------------------------------- */ | |
function numeric_posts_nav() { | |
if( is_singular() ) | |
return; |
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 | |
/* ---------------------------------------------------------------------------- | |
* Create custom WordPress dashboard widget | |
* ------------------------------------------------------------------------- */ | |
function dashboard_widget_function() { | |
echo ' | |
<h2>Custom Dashboard Widget</h2> | |
<p>Custom content here</p> | |
'; |
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 CPT count action to WordPress dashboard | |
* ------------------------------------------------------------------------- */ | |
add_action( 'dashboard_glance_items', 'simple_glance_items' ); | |
// Showing all custom posts count | |
function simple_glance_items() { | |
$glances = array(); |
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 CPT to your main WordPress RSS feed | |
* ------------------------------------------------------------------------- */ | |
function simple_feed_request( $rss ) { | |
if ( isset( $rss[ 'feed' ] ) && !isset( $rss['post_type'] ) ) { | |
// Return all post types | |
$rss['post_type'] = | |
// Return posts of post types of your choice like 'post' and 'news' |
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 | |
/* ---------------------------------------------------------------------------- | |
* Remove comments | |
* ------------------------------------------------------------------------- */ | |
// Removes from admin menu | |
add_action( 'admin_menu', 'my_remove_admin_menus' ); | |
function my_remove_admin_menus() { | |
remove_menu_page( 'edit-comments.php' ); | |
} |
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 | |
/* ---------------------------------------------------------------------------- | |
* Disable WordPress emoji | |
* ------------------------------------------------------------------------- */ | |
function disable_wp_emojicons() { | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
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 | |
/* ---------------------------------------------------------------------------- | |
* Disable built-in post type | |
* ------------------------------------------------------------------------- */ | |
add_action( 'init', 'simple_remove_default_post_type', 1 ); | |
function simple_remove_default_post_type() { | |
register_post_type( 'post', array( | |
'map_meta_cap' => 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
<?php | |
/* ---------------------------------------------------------------------------- | |
* Remove WordPress version from header | |
* ------------------------------------------------------------------------- */ | |
function simple_remove_version_info() { | |
return ''; | |
} | |
add_filter( 'the_generator', 'simple_remove_version_info' ); |
NewerOlder