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
//New User Alert | |
add_action( 'admin_notices', 'custom_error_notice' ); | |
function custom_error_notice(){ | |
global $current_user; | |
get_currentuserinfo(); | |
$author_info = get_userdata($current_user->ID); | |
if($author_info->title == '') | |
echo '<div class="error"><p><strong>New User:</strong> Please visit your <a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php" title="Your Profile">Profile</a> to Fill in your Job Title and set your Display Name. This alert will go away when you Job Title is set.</p></div>'; | |
} |
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 all custom post types and taxonomies to the "Right Now" box on the Dashboard | |
add_action( 'right_now_content_table_end' , 'ucc_right_now_content_table_end' ); | |
function ucc_right_now_content_table_end() { | |
$args = array( | |
'public' => true , | |
'_builtin' => false | |
); | |
$output = 'object'; | |
$operator = 'and'; |
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 category nicenames in body and post class | |
function category_id_class($classes) { | |
global $post; | |
foreach((get_the_category($post->ID)) as $category) | |
$classes[] = $category->category_nicename; | |
return $classes; | |
} | |
add_filter('post_class', 'category_id_class'); | |
add_filter('body_class', 'category_id_class'); |
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
/////////////////////////////////////////////////////////// | |
//Custom Backend Column from Custom Field. Be sure to edit post-type- "manage_edit-POSTTYPE_columns"- and Custom Field Name. | |
/////////////////////////////////////////////////////////// | |
add_filter('manage_edit-staff_columns', 'my_columns'); | |
function my_columns($columns) { | |
unset($columns['author']); | |
unset($columns['date']); | |
$columns['Name'] = 'Name'; | |
$columns['author'] = 'Author'; | |
$columns['date'] = 'Date'; |
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 Custom Post Type To Feed | |
function mysite_feed_request($vars) { | |
if (isset($vars['feed']) && !isset($vars['post_type'])) | |
$vars['post_type'] = array('post', 'projects'); | |
return $vars; | |
} | |
add_filter('request', 'mysite_feed_request'); |
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 Instructions to Featured Image Box | |
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_html'); | |
function add_featured_image_html( $html ) { | |
return $html .= '<p>This is some sample text that can be displayed within the feature image box.</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
/** | |
Made with the help of a tutorial at WPShout.com => http://wpshout.com. | |
Courtesy of the Hybrid theme - themehybrid.com | |
* Adds the Hybrid Settings meta box on the Write Post/Page screeens | |
* | |
* @package Hybrid | |
* @subpackage Admin | |
*/ |
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_theme_support('post-thumbnails'); | |
set_post_thumbnail_size( 150, 120, true ); // Normal post thumbnails | |
add_image_size( 'magazine-post-thumbnail', 260, 174, true ); // Permalink thumbnail size | |
add_image_size( 'home-post-thumbnail', 168, 89, true ); // Permalink thumbnail size | |
add_image_size( 'single-post-thumbnail', 527, 317, true ); // Permalink thumbnail size |
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 Post Thumbnail to Feed | |
function feedFilter($query) { | |
if ($query->is_feed) { | |
add_filter('the_content', 'feedContentFilter'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','feedFilter'); | |
function feedContentFilter($content) { |
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 Post Type To Category Archives | |
add_filter('pre_get_posts', 'query_post_type'); | |
function query_post_type($query) { | |
if(is_category() || is_tag()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array('nav_menu_item','post','private_post'); // replace private_post to your custom post type, Leave nav_menu_item where it is! | |
$query->set('post_type',$post_type); |
OlderNewer