Advertisement
Guest User

functions.php

a guest
Feb 24th, 2012
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.    
  3.     // Add RSS links to <head> section
  4.     automatic_feed_links();
  5.    
  6.     // Load jQuery
  7.     if ( !is_admin() ) {
  8.        wp_deregister_script('jquery');
  9.        wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"), false);
  10.        wp_enqueue_script('jquery');
  11.     }
  12.    
  13.     // Clean up the <head>
  14.     function removeHeadLinks() {
  15.         remove_action('wp_head', 'rsd_link');
  16.         remove_action('wp_head', 'wlwmanifest_link');
  17.     }
  18.     add_action('init', 'removeHeadLinks');
  19.     remove_action('wp_head', 'wp_generator');
  20.    
  21.     // Declare sidebar widget zone
  22.    
  23.      if (function_exists('register_sidebar')) {
  24.         register_sidebar(array(
  25.             'name' => 'Footer Widgets',
  26.             'id'   => 'footer-widgets',
  27.             'description'   => 'These are widgets for the footer.',
  28.             'before_widget' => '<div id="%1$s" class="widget %2$s">',
  29.             'after_widget'  => '</div>',
  30.             'before_title'  => '<h2>',
  31.             'after_title'   => '</h2>'
  32.         ));
  33.     }
  34.    
  35.     if (function_exists('register_nav_menus')) {
  36.     register_nav_menus(
  37.         array(
  38.             'mainav' => 'Main Navigation Menu'
  39.            
  40.             )
  41.             );
  42.         }
  43.  
  44. if (function_exists('register_sidebar')) {
  45.         register_sidebar(array(
  46.             'name' => 'Feature Widget',
  47.             'id'   => 'feature-widgets',
  48.             'description'   => 'These are widgets for the features.',
  49.             'before_widget' => '<div id="%1$s" class="widget %2$s">',
  50.             'after_widget'  => '</div>',
  51.             'before_title'  => '<h2>',
  52.             'after_title'   => '</h2>'
  53.         ));
  54.     }
  55.  
  56.     if (function_exists('register_sidebar')) {
  57.         register_sidebar(array(
  58.             'name' => 'Ical Sidebar',
  59.             'id'   => 'ical',
  60.             'description'   => 'These are widgets for the  Ical.',
  61.             'before_widget' => '<div id="%1$s" class="widget %2$s">',
  62.             'after_widget'  => '</div>',
  63.             'before_title'  => '<h2>',
  64.             'after_title'   => '</h2>'
  65.         ));
  66.     }
  67. function groups_subnav_hook() {
  68.     global $bp;
  69.  
  70.     $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/';
  71.  
  72.     bp_core_new_subnav_item( array(
  73.         'name' => 'Create New Group' ,
  74.         'slug' => 'create',
  75.         'parent_slug' => $bp->groups->slug,
  76.         'parent_url' => $groups_link,
  77.         'position' => 10,
  78.         'screen_function' => 'groups_screen_group_members',
  79.         'user_has_access' => bp_is_my_profile() // Only the logged in user can access this on his/her profile
  80.     ) );
  81. }
  82. add_action( 'wp', 'groups_subnav_hook', 2 );
  83. add_action( 'admin_menu', 'groups_subnav_hook', 2 );
  84.    
  85. ?>
Advertisement
RAW Paste Data Copied
Advertisement