Jump to content


Photo
- - - - -

How to add additional custom menu? (2)


This topic has been archived. This means that you cannot reply to this topic.
17 replies to this topic

#1 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 18 November 2010 - 04:12 PM

Hi, I've read this post

Please Login or Register to see this Hidden Content

because I need also an additional custom menu so I've created a php file called section.global.php and I've added and the appropriate code into the functions.php file (as explained in the video). Everything seems to work perfect in the backend. I've done the settings (header layout and WP menus) but my globalnav doesn't show up in my site. Do i still have to change something in the CSS or add html code somewhere to make that menu visible in my site? Thanks for your answer

#2 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 18 November 2010 - 06:53 PM

Benoit I'm going to close the other post so we don't double up. So you have a section and a menu created? Can I get a link to look at whether the HTML for it is there?

#3 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 19 November 2010 - 02:29 PM

OK. sorry for the double post.

Unfortunatly my server still have PHP4 version so I cannot install platformpro. I'll try to update it.

actually I work with MAMP in local. But when I inspect the HTML with Firebug, I get that code :

Please Login or Register to see this Hidden Content



#4 nett-ed

nett-ed

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 November 2010 - 05:37 PM

You could add a menu using the Wordpress Menus option under the Appearances section in the admin section. This method is covered in this thread

Please Login or Register to see this Hidden Content



#5 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 22 November 2010 - 03:47 PM

Eduardo, Adam, yes, I did all the settings in the backend... and it works perfectly when I add my GlobalNav to the content section or to the footer. it doesn't work only when I add it to the header section where I already have my main-nav. It seems to be a CSS confict between the main-nav and the top-nav (or global-nav). Both use the same div id but different classes. Should i use an other Id for the global-nav and update files section.globalnav.php and the base.css. How? Thank you

#6 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 22 November 2010 - 09:41 PM

Hmm... When I tested it worked for me. Even if there was conflict it wouldn't be CSS. Maybe dropdowns though if you copied the nav exactly, but it's hard for me to say without a link to check it out. Or link to an image of your new nav file.

#7 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 22 November 2010 - 11:54 PM

Hi Adam,

I still don't have server with PHP5 so I'll show you pictures. I hope it helps to understand.

I saw indeed that it has nothing to do with the CSS.

Here are my problems with the global nav :

1. The global nav is only visible when I position it below the site branding and the primary nav. If I place it above, it's invisible. I don't now why?

see :

Please Login or Register to see this Hidden Content


Please Login or Register to see this Hidden Content



2. It always takes the primary nav content by default. Even when I set a specific content for Global nav in the Menus settings.

see :

Please Login or Register to see this Hidden Content



I've done the test using the demo content. Here is the PHP code I use (which a copy of yours)

Please Login or Register to see this Hidden Content



#8 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 23 November 2010 - 10:49 AM

I think that the issue that needs to be addressed is PHP. It's very important to get you on PHP5. If we don't there will always be issues to workaround. Please see here for good hosts:

Please Login or Register to see this Hidden Content

Thanks, Bryan

#9 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 23 November 2010 - 03:33 PM

Hi Bryan, Thank you for the advice. But for now, i'm running my site in localhost with MAMP which has the PHP 5.3.2 version. Besides if I didn't have PHP5, I wouldn't have been able to install Pagelines. The PHP code I sent (above) is all correct? Thank you and sorry to insist

#10 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 23 November 2010 - 05:01 PM

It seems like it's pulling the callback function despite having the options set. Also, make sure that although you've set the menu location you hit save for both the menu and the location in APPEARANCE - Menus because the saving mechanism for it is nit-picky

#11 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 24 November 2010 - 06:00 PM

Hi Adam, Yes I've set the menu location for both the menu and the location in APPEARANCE. (see test link below) Here's what I've set : Primary nav (green) = page about, page 1, page 2. Global nav = page 3, page 4. I have 2 problems : 1. The global nav is invisible if set above the primary nav 2. It takes all the pages of the site (for menu items) and not only the pages I've set (page 3, 4) Here is a test link to see the test site and check the code :

Please Login or Register to see this Hidden Content

Thanks again for checking Beno?®t

#12 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 24 November 2010 - 07:11 PM

hmmm it appears the location exists but it's not picking it up and using the fallback function. Try removing everything in the wp_nav_menu function so it's like this and see what happens. ` 'globalnav') ); endif;?> `

#13 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 25 November 2010 - 03:01 PM

It partially solved the problem : Now I can set the globalnav above the main nav and it stays visible but it sill takes all the pages of the site (for menu items) and not only the pages I've set (page 3, 4).

Please Login or Register to see this Hidden Content

Thank you

#14 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 27 November 2010 - 11:47 PM

any clue what the problem with the pages could be? I'd really like to add this Globalnav to my site. Thanks by advance

#15 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 28 November 2010 - 12:48 AM

It's hard to say what's going on, but you could just hard code the menu instead? Is that a possibility...what sort of links do you need?

#16 bencloson

bencloson

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 28 November 2010 - 09:57 PM

I've just made a slight change in the wp_nav_menu function and it works now. I don't really understand why?

Please Login or Register to see this Hidden Content


I change

Please Login or Register to see this Hidden Content

by

Please Login or Register to see this Hidden Content


Thank you

#17 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 29 November 2010 - 07:35 PM

Maybe I was using a deprecated function parameters? Hard to believe going from 3.0 to 3.01? Glad you got it though

#18 arretx

arretx

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 17 December 2010 - 05:07 AM

I believe I'm running into the same problem. Any idea what I should do? I have every page showing up on my globalnav menu instead of the ones that I've chosen.

Please Login or Register to see this Hidden Content