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 the support for your CPT in the widget activity of the admin dashboard | |
* ------------------------------------------------------------------------- */ | |
add_filter( 'dashboard_recent_posts_query_args', 'add_page_to_dashboard_activity' ); | |
function add_page_to_dashboard_activity( $query_args ) { | |
// Return all post types | |
$query_args['post_type'] = 'any'; | |
// Or return post types of your choice | |
// query_args['post_type'] = array( 'post', 'foo', 'bar' ); |
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’s instantiate this class in our functions.php file: | |
if( is_admin() ) { | |
require 'simple_settings_page.php'; | |
new simple_settings_page(); | |
} |
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 | |
/* ---------------------------------------------------------------------------- | |
* Change more excerpt | |
* ------------------------------------------------------------------------- */ | |
function custom_more_excerpt( $more ) { | |
return '...'; | |
} | |
add_filter( 'excerpt_more', 'custom_more_excerpt' ); |
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 | |
/* ---------------------------------------------------------------------------- | |
* Modify excerpt length | |
* ------------------------------------------------------------------------- */ | |
function custom_excerpt_length( $length ) { | |
return 25; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
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 | |
/* ---------------------------------------------------------------------------- | |
* Switch default core markup to output valid HTML5 | |
* ------------------------------------------------------------------------- */ | |
add_theme_support( 'html5', array( | |
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', | |
) ); |
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; |
NewerOlder