Skip to:
Content
Pages
Categories
Search
Top
Bottom

WP Menu not displayed

  • Avatar of LPH2005
    LPH2005
    Participant

    @lph2005

    Plugin (All Nav Links to BP Adminbar) installed, all options enabled. WP custom menu built. Theme location set for wp menu (BP-WP-Navbar Menu 1). Saved multiple times but no WordPress menu is showing and not all of the buddypress components enabled are showing. Admin bar clearly is moved, width set correctly but the items in the menu are missing all buddypress components and wordpress.

    Any suggestions on what is wrong?

    SiteURL: http://www.thechembook.com

    Disabled – Hide Main Theme Nav – until can figure out how to add all bp and wp components. :)

Viewing 17 replies - 1 through 17 (of 17 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Is this the bug you referred to recently in a thread which you mention in passing you emailed pcwriter about?

    You might need to provide a little detail about versions you are using of WP/BP and possibly show the exact code you used in your theme to implement the WP 3.0 menus.

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @hnla

    I’ve tested the plugin (both V2.1.1 from the repo, and with modifications as suggested by @LPH2005) on several themes and it works just fine.

    Tested successfully on both my live and dev installs (WP3.0.1multisite/BP1.2.5.2) with the following themes:
    BP Columns and BuddyPress Widget Theme by modemlooper
    Darwin and Fishbook (BuddyPress BuddyPack) by Michael Kuhlmann
    Cosmic Buddy by Brajesh Singh (Hide main nav function requires slight code change in bp-wp-navbar.php)
    …and of course my own custom child theme

    Even on non-buddypress-aware themes (like P2, TwentyTen, Arras, Arjuna), the BP components are picked up and displayed (of course, they lead nowhere… but they are there).

    I’m at a loss as to what may be buggering the thing up for some folks! Any clues would be a relief :-(

    Avatar of LPH2005
    LPH2005
    Participant

    @lph2005

    WordPress 3.0.1 (Single)
    BP Version 1.2.5.2
    Child theme and tried default theme

    Also tried locally on a WP 3.0.1 and BP 1.2.5.2 clean install.

    Neither the BP component or WP pages loads. Everything else works beautifully. Here is the code for those two areas, right @pcwriter ?

    `function pages()
    {
    global $current_blog, $pageLinkDropdown, $wpListPagesLabel, $bpCommunityLinks, $addBpComponents, $addWpPages ; ?>

    blog_id == ’1′) : ?>
    <?php
    function return_wp_nav_title($menu_region)
    {
    $location_actual = get_nav_menu_locations(); // all the menu regions available and the terms_id
    $menu_term_id = $location_actual[$menu_region]; // isolate a single region and menu term_id
    $menu_title = wp_get_nav_menu_object($menu_term_id); // feed the term_id to the menu object
    echo $menu_title = $menu_title->name; // return menu name object
    } ?>

    <li class=”selected”> <a href="//” title=””>

      <li class=”selected”>
      <a href="//” title=””>

      <li class=”selected”>
      <a href="//” title=””>

      <li class=”selected”>
      <a href="//” title=””>

      <li class=”selected”>
      <a href="//” title=””>

      <li class=”selected”>
      <a href="//” title=””>

  • <a href="”>
    ‘menu_order’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘theme_location’ => ‘bp_adminbar_pages1′)) ?>
  • <a href="”>
    ‘menu_order’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘theme_location’ => ‘bp_adminbar_pages2′)) ?>
  • <a href="”>
    ‘menu_order’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘theme_location’ => ‘bp_adminbar_pages3′)) ?>
  • <a href="”>
    ‘menu_order’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘theme_location’ => ‘bp_adminbar_pages4′)) ?>
  • <a href="”>
    ‘menu_order’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘theme_location’ => ‘bp_adminbar_pages5′)) ?>
  • <?php
    }
    add_action( ‘bp_adminbar_menus’, ‘pages’, 15 );
    include ‘bp-wp-navbar-admin.php’;`

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@LPH2005

Maybe a clue: would you check the blog ID of your site.
I’m thinking that on WP single, blog ID might be “0″ instead of “1″.

(…or did we do that already?)

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@hnla

Or maybe we need to add a check for single v multisite?
If multisite, then use the $current_blog global.

Avatar of LPH2005
LPH2005
Participant

@lph2005

@pcwriter – tried setting blog_id to 0 in code but that didn’t work. Where is the blog_id found?

Update: Why the question? Just for kicks, removed the line `blog_id == ’0′) : ?>` and corresponding endif. Menu shows! ;)

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@LPH2005

Great news! Do both the BP Community dropdown and WP menus display correctly?

Why the question? It suddenly occurred to me that on a single install, the blog ID might be different or non-existent (no real need to differentiate ‘cuz there’s only the one).

Avatar of LPH2005
LPH2005
Participant

@lph2005

@pcwriter – yes – both menus show when the blog_id code is removed :)

If you’re trying to make that part affect only the site that BuddyPress is active on (or in the case of multisite, its main blog), compare $current_blog->blog_id to BP_ROOT_BLOG.

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@DJPaul Thanks! This works just fine on my WP3multisite install

@LPH2005 Just checked and, yup! Looks great!

Could you help with one final test? Now that I know you’re running WP3single, I’ve gotta ask :-)
Insert “ where `blog_id == ’0′) : ?>` used to be and add the appropriate endif tag.

If it works on both your single install and my multisite one, I’ll run a bug-fix version over to the repo lickety split!

Avatar of LPH2005
LPH2005
Participant

@lph2005

@pcwriter – works great with the BP_ROOT_BLOG

Can you also change the wp-admin setting location? Can it be placed in BuddyPress area (/wp-admin/admin.php?page=bp-general-settings) rather than /wp-admin/options-general.php.

This discussion might help:

http://buddypress.org/community/groups/creating-extending/forum/topic/example-skeleton-admin-options-pane/

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@LPH2005

Thanks for checking the code (credit is forthcoming in the bug fix)!

Will do for the settings location. Couldn’t quite figure that one out last time around but, looking through code from other plugins, I should manage this time ;-)

Avatar of pcwriter
pcwriter
Participant

@pcwriter

Nope, still can’t get it to work in the BP admin area.
I’ll try again some other time but, for now, the plugin is updated and options are under “Settings”.

Cheers!

Avatar of Hugo
Hugo
Moderator

@hnla

@DJPaulThanks for the correction.

That was ‘My Bad ‘ as that was somewhat temp code that should have been revisited.

Patrick it highlights the need, when coding stuff like this, for rigorous testing on a number of types of installs, in the case of WP/BP that means at least Single Install and Multi Site preferably BP latest or branch and preferably current stable release. I remember vaguely that we discussed localhost dev environment have you not set up a few installs for testing against?

Avatar of pcwriter
pcwriter
Participant

@pcwriter

@hnla

That would be my bad ;-)

I set up a local test environment identical to my live multisite install, but never took the time to go any further.
Now I’ve got a single install set up too, so I don’t have to bother the neighbors :-)

Avatar of Hugo
Hugo
Moderator

@hnla

It’s all too easy to forget at times that some section might need revisiting , especially when it may work perfectly well under certain circumstances. Often it’s testing that tends to absorb more time than anything :)

Avatar of pcwriter
pcwriter
Participant

@pcwriter

That describes my eager beaver personality quite succinctly :-)

Viewing 17 replies - 1 through 17 (of 17 total)

You must be logged in to reply to this topic.