Skip to:
Content

BuddyPress.org

Changeset 3325


Ignore:
Timestamp:
10/27/2010 10:05:52 PM (16 years ago)
Author:
djpaul
Message:

First pass of menu support for BP-Default. See #2691.

Location:
trunk/bp-themes/bp-default
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r3300 r3325  
    17621762                color: #bbb;
    17631763        }
     1764
     1765/* Menu
     1766-------------------------------------------------------------- */
     1767
     1768#nav ul {
     1769        display: none;
     1770        position: absolute;
     1771        z-index: 99999;
     1772        right: 0;
     1773}
     1774        #nav li:hover > ul {
     1775                display: block;
     1776        }
     1777
     1778        #nav ul li {
     1779                margin-right: 0;
     1780                min-width: 186px;
     1781        }
  • trunk/bp-themes/bp-default/functions.php

    r3312 r3325  
    11<?php
    2 
    32// Stop the theme from killing WordPress if BuddyPress is not enabled.
    43if ( !class_exists( 'BP_Core_User' ) )
     
    1514        )
    1615);
     16
     17// Register navigation menu
     18register_nav_menus( array(
     19        'primary' => __( 'Primary Navigation', 'buddypress' ),
     20) );
    1721
    1822// Load the AJAX functions for the theme
     
    336340        add_action( 'admin_notices', 'bp_dtheme_show_notice' );
    337341
     342/**
     343 * wp_nav_menu() callback from the main navigation in header.php
     344 *
     345 * Used when the custom menus haven't been configured.
     346 *
     347 * @param array Menu arguments from wp_nav_menu()
     348 * @package BuddyPress Theme
     349 * @see wp_nav_menu()
     350 * @since 1.3
     351 */
     352function bp_dtheme_main_nav( $args ) {
     353?>
     354        <ul id="nav">
     355                <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
     356                        <a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
     357                </li>
     358
     359                <?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
     360                <?php do_action( 'bp_nav_items' ); ?>
     361        </ul><!-- #nav -->
     362<?php
     363}
    338364
    339365// Member Buttons
     
    357383if ( bp_is_active( 'blogs' ) )
    358384        add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
    359 
    360385?>
  • trunk/bp-themes/bp-default/header.php

    r3300 r3325  
    4444                        <h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
    4545
    46                         <ul id="nav">
    47                                 <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
    48                                         <a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
    49                                 </li>
    50 
    51                                 <?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
    52 
    53                                 <?php do_action( 'bp_nav_items' ); ?>
    54                         </ul><!-- #nav -->
     46                        <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
    5547
    5648                        <div id="search-bar">
  • trunk/bp-themes/bp-default/style.css

    r2863 r3325  
    66Author: BuddyPress.org
    77Author URI: http://buddypress.org
    8 Tags: buddypress, two-columns, custom-header, white, blue
     8Tags: buddypress, two-columns, custom-header, white, blue, translation-ready
    99
    1010** IMPORTANT - DO NOT COPY THIS THEME **
Note: See TracChangeset for help on using the changeset viewer.