This file contains hidden or 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 Login Page | |
| function custom_login() { | |
| echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/custom-login/custom-login.css" />'; | |
| } | |
| add_action('login_head', 'custom_login'); |
This file contains hidden or 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
| //Drafts Dashboard Widget For Custom Post Type | |
| function project_drafts(){ | |
| $posts_query = new WP_Query( array( | |
| // Leave this as "post" if you just want blog posts | |
| 'post_type' => 'projects', | |
| 'post_status' => 'draft', | |
| 'posts_per_page' => 5, | |
| 'orderby' => 'date', | |
| 'order' => 'DESC' | |
| ) ); |
This file contains hidden or 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 Elements For TinyMCE | |
| // add style selector drop down | |
| add_filter( 'mce_buttons_2', 'my_mce_buttons_2' ); | |
| function my_mce_buttons_2( $buttons ) { | |
| array_unshift( $buttons, 'styleselect' ); | |
| return $buttons; | |
| } | |
| // add styles - more info: http://alisothegeek.com/2011/05/tinymce-styles-dropdown-wordpress-visual-editor/ |
This file contains hidden or 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
| //Exclude Categories From The Feed | |
| function myFeedExcluder($query) { | |
| if ($query->is_feed) { | |
| $query->set('cat','-178,-9'); | |
| } | |
| return $query; | |
| } | |
| add_filter('pre_get_posts','myFeedExcluder'); |
This file contains hidden or 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
| //Force Post type to be Private | |
| function force_type_private($post){ | |
| if ($post['post_type'] == 'my_post_type') | |
| $post['post_status'] = 'private'; | |
| return $post; | |
| } | |
| add_filter('wp_insert_post_data', 'force_type_private'); |
This file contains hidden or 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
| //Hide Admin Bar Except For Administrators | |
| function my_function_admin_bar($content) { | |
| return ( current_user_can("administrator") ) ? $content : false; | |
| } | |
| add_filter( 'show_admin_bar' , 'my_function_admin_bar'); |
This file contains hidden or 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
| //Move Featured Image Box by Post Type | |
| add_action('do_meta_boxes', 'customposttype_image_box'); | |
| function customposttype_image_box() { | |
| remove_meta_box( 'postimagediv', 'art', 'side' ); | |
| add_meta_box('postimagediv', __('Custom Image'), 'post_thumbnail_meta_box', 'art', 'normal', 'high'); | |
| } |