Forums

Different headers and menu in different category (9 posts)

  1. Mika
    Member
    Posted 10 months ago #

    I put an English category in my theme which had other Norwegian categories. I wanted to make the English categories have different menu that I have already customized in the WP Menu section.
    The primary menu works well for the Norwegian pages and categories, but I am not able to get: how to apply the English menu for only the English categories.

    Is there anyone have any idea how to go about this? Is it even possible?

    I really appreciate any help.

    [No bumping, please - especially after only 30 minutes!]

  2. Mika
    Member
    Posted 10 months ago #

    fyi, I am using Weaver 2.0 theme.

  3. Mika
    Member
    Posted 10 months ago #

    Is this not the right category to post or am I asking the impossible? Please please help.

  4. Mika
    Member
    Posted 10 months ago #

    Any help?

  5. Rodni
    Member
    Posted 10 months ago #

    Can you please give me the address of your web site so I can get a better idea of what you're trying to do? Because I can't fully understand...

  6. Mika
    Member
    Posted 10 months ago #

    The address is http://www.tangotango.no
    The English page is http://www.tangotango.no/english

    For the english page template, I couldn't get to have a different menu which are customized different from the main page.

  7. Rodni
    Member
    Posted 10 months ago #

    So you want all the Norwegian menu translated to English on web address http://www.tangotango.no/english? I'm not sure if I'm getting the right idea of what you're trying to do. I was also thinking that you might be trying to add a different menu with different items for the English part. Give me some more tips :P

  8. Mika
    Member
    Posted 10 months ago #

    Hey Rodni, sorry that my question is vague. What I meant is: You can see that the Norwegian pages does have their own menus which are customized and set to primary menus. But after I made the English page, I noticed that the primary menu comes on that page, but I made a secondary menu in English and that is what I want to appear on the English page and its category.

    I hope I am clear this time.

  9. Rodni
    Member
    Posted 10 months ago #

    Now I get it clearly! I've been working for a few hours on a possible solution for your problem, and I think I'm getting closer :) I have to go out right now, but I'll keep working on this as soon as I can, I promise!

    WordPress gives me big headaches, but I really like learning it. After trying hard, I finally got how to register a menu so it works fine on the CMS, using the function refence wp_page_menu(). Using this, you can register your second menu so you'll be able to use it inside your theme. Here's a sample of what you could do, open your functions.php file and add a secondary menu right after the primary:

    register_nav_menus( array(
    		'primary' => __( 'Primary Navigation', 'twentyten' ),
    		'english' => __( 'English Navigation', 'twentyten' ),
    	) );

    This is what I acchieved so far. I know it's not much but it took me a while to define it correctly for my theme. In the Admin panel, go to Appereance > Menus. If you can see a second slot in "Theme Location" saying "English Navigation", it means the registration worked out :)

    Now we just need to find the place to put this code:

    <?php wp_nav_menu( array( 'container_class' => 'menu-header-english', 'theme_location' => 'english' ) ); ?>

    and make the pages recognize when to use the English NavBar. I hope I can get the solution soon!

Reply

You must log in to post.

About this Topic