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 | |
/* ---------------------------------------------------------------------------- | |
* Let WordPress manage the document title | |
* ------------------------------------------------------------------------- */ | |
// Add the following to functions.php and remove the <title> tag from your header. | |
add_theme_support( 'title-tag' ); |
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 welcome panel in dashboard | |
* ------------------------------------------------------------------------- */ | |
remove_action('welcome_panel', 'wp_welcome_panel'); |
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 all dashboard widgets | |
* ------------------------------------------------------------------------- */ | |
function remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] ); | |
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); | |
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] ); |
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 category and tag archives | |
* ------------------------------------------------------------------------- */ | |
function simple_add_custom_types( $query ) { | |
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$post_types = get_post_types(); | |
$query->set( 'post_type', $post_type ); | |
return $query; |
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