0

現在、次のもので構築されたナビゲーションメニューがあります。

<?php 
            if(!is_user_logged_in()) {
                wp_page_menu('show_home=1&exclude=214&exclude_tree=80');
            } else {
                wp_page_menu('show_home=1&exclude=214');
            }
        ?>

私の問題は、WordPress によって作成された親に追加する必要がある BuddyPress ページがいくつかあることです。基本的に、「メンバーコンテンツ」と呼ばれる親があります。

そのメンバー コンテンツには「Surveys」、「Documents」などの子がありますが、BuddyPress インストールのフォーラム、グループ、メンバーもメンバー コンテンツの子にする必要があります。

4

1 に答える 1

0

Buddypress には、呼び出す必要のあるページがいくつかあります。ページを手動で含める必要があるため、次のようになります。

<?php 
        if(!is_user_logged_in()) {
            wp_page_menu('show_home=1&exclude=214&exclude_tree=80');
        } else {
            wp_page_menu('show_home=1&exclude=214');

class="selected"> //" タイトル="">

        <li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="selected"<?php endif; ?>>
            <a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
        </li>

        <?php if ( bp_is_active( 'groups' ) ) : ?>
            <li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="selected"<?php endif; ?>>
                <a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
            </li>

            <?php if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
                <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
                    <a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
                </li>
            <?php endif; ?>
        <?php endif; ?>

        <?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
            <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
                <a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
            </li>
        <?php endif; ?>


        }
    ?>
于 2010-10-16T11:45:32.210 に答える