Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2011
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. <?php
  2.  
  3. // Add RSS links to <head> section
  4. automatic_feed_links();
  5.  
  6. add_theme_support('post-thumbnails');
  7.  
  8. // Load jQuery
  9. if ( !is_admin() ) {
  10. wp_deregister_script('jquery');
  11. wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"), false);
  12. wp_enqueue_script('jquery');
  13. }
  14.  
  15. // Clean up the <head>
  16. function removeHeadLinks() {
  17. remove_action('wp_head', 'rsd_link');
  18. remove_action('wp_head', 'wlwmanifest_link');
  19. }
  20. add_action('init', 'removeHeadLinks');
  21. remove_action('wp_head', 'wp_generator');
  22.  
  23. // Declare sidebar widget zone
  24. if (function_exists('register_sidebar')) {
  25. register_sidebar(array(
  26. 'name' => 'Basic Sidebar',
  27. 'id' => 'basic-sidebar',
  28. 'description' => 'This is the basic sidebar for basic pages.',
  29. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  30. 'after_widget' => '</div>',
  31. 'before_title' => '<h2>',
  32. 'after_title' => '</h2>'
  33. ));
  34. register_sidebar(array(
  35. 'name' => 'Specific Sidebar',
  36. 'id' => 'specific-sidebar',
  37. 'description' => 'This is the secondary sidebar for specific pages.',
  38. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  39. 'after_widget' => '</div>',
  40. 'before_title' => '<h2>',
  41. 'after_title' => '</h2>'
  42. ));
  43. register_sidebar(array(
  44. 'name' => 'Footer Sidebar',
  45. 'id' => 'footer-sidebar',
  46. 'description' => 'This is the footer container for navigation.',
  47. 'before_widget' => '<nav class="footer-nav">',
  48. 'after_widget' => '</nav>',
  49. 'before_title' => '<h1>',
  50. 'after_title' => '</h1>'
  51. ));
  52.  
  53. }
  54.  
  55. // Declare Custom Menu
  56. add_action( 'init', 'register_my_menus' );
  57.  
  58. function register_my_menus() {
  59. register_nav_menus(
  60. array(
  61. 'main-menu' => __( 'Main Menu' ),
  62. 'sidebar-menu' => __( 'Sidebar Menu' ),
  63. 'footer-menu' => __( 'Footer Menu' )
  64. )
  65. );
  66. }
  67. // END Custom Menu
  68.  
  69. // Remove Menu Classes & Id
  70. add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
  71. add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
  72. add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
  73. add_filter('page_css_id', 'my_css_attributes_filter', 100, 1);
  74. function my_css_attributes_filter($var) {
  75. return is_array($var) ? array_intersect($var, array('current-menu-item')) : '';
  76. }
  77.  
  78. // hook into the init action and call create_property_taxonomies() when it fires
  79. add_action( 'init', 'create_property_taxonomies', 0 );
  80.  
  81. // create taxonomies, type for the post type "properties"
  82. function create_property_taxonomies() {
  83.  
  84. // Add new taxonomy, NOT hierarchical (like tags)
  85. $labels = array(
  86. 'name' => _x( 'Types', 'taxonomy general name' ),
  87. 'singular_name' => _x( 'Type', 'taxonomy singular name' ),
  88. 'search_items' => __( 'Search Types' ),
  89. 'popular_items' => __( 'Popular Types' ),
  90. 'all_items' => __( 'All Types' ),
  91. 'parent_item' => null,
  92. 'parent_item_colon' => null,
  93. 'edit_item' => __( 'Edit Types' ),
  94. 'update_item' => __( 'Update Types' ),
  95. 'add_new_item' => __( 'Add New Type' ),
  96. 'new_item_name' => __( 'New Type Name' ),
  97. 'separate_items_with_commas' => __( 'Separate types with commas' ),
  98. 'add_or_remove_items' => __( 'Add or remove types' ),
  99. 'choose_from_most_used' => __( 'Choose from the most used types' )
  100. );
  101. register_taxonomy( 'types', 'properties', array(
  102. 'hierarchical' => false,
  103. 'labels' => $labels, /* NOTICE: the $labels variable here */
  104. 'show_ui' => true,
  105. 'query_var' => true,
  106. 'rewrite' => array( 'slug' => 'type' ),
  107. ));
  108. } // End of create_property_taxonomies() function.
  109.  
  110. // Remove Unnecassary Menu Items.
  111. function remove_menus () {
  112. global $menu;
  113. $restricted = array(__('Posts'), __('Comments'));
  114. end ($menu);
  115. while (prev($menu)){
  116. $value = explode(' ',$menu[key($menu)][0]);
  117. if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
  118. }
  119. }
  120. add_action('admin_menu', 'remove_menus');
  121. // END Remove Unnecassary Menu Items.
  122.  
  123. // Customize the admin footer.
  124. function modify_footer_admin () {
  125. echo 'Created by <a href="http://scottcarlton.net">Scott Carlton</a>. ';
  126. echo 'Powered by <a href="http://WordPress.org">WordPress</a>.';
  127. }
  128.  
  129. add_filter('admin_footer_text', 'modify_footer_admin');
  130.  
  131. // Customize the admin menus
  132. function custom_menu_order($menu_ord) {
  133. if (!$menu_ord) return true;
  134. return array(
  135. 'index.php', // this represents the dashboard link
  136. 'seperater_1', // this represents the dashboard link
  137. 'edit.php?post_type=page', //the posts tab
  138. 'edit.php?post_type=properties', //the posts tab
  139. 'edit.php?post_type=bios', //the posts tab
  140. 'upload.php', // the media manager
  141. );
  142. }
  143. add_filter('custom_menu_order', 'custom_menu_order');
  144. add_filter('menu_order', 'custom_menu_order');
  145.  
  146. // Customize Admin Login Logo
  147. function my_custom_login_logo()
  148. {
  149. echo '<style type="text/css"> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/main_Logo.png) !important; } </style>';
  150. }
  151. add_action('login_head', 'my_custom_login_logo');
  152.  
  153. // Add Toggle jQuery
  154. add_action( 'wp_enqueue_scripts', 'add_my_js' );
  155.  
  156. function add_my_js() {
  157. wp_register_script( 'my-author-js', get_template_directory_uri() . '/author-toggle.js', array( 'jquery' ), false, true );
  158. wp_enqueue_script( 'my-author-js' );
  159. }
  160.  
  161. ?>
  162.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement