WordPress.org

Forums

Bogo
[resolved] English (main) menu not showing (3 posts)

  1. bayuhen
    Member
    Posted 11 months ago #

    good day,
    Im setting up this website http://wedding.bayuhendarto.web.id with 3 language translation; english (main), indonesian and malaysian. what I will ask is why in english version the menu are not showing up? it works fine in indonesian and malaysian.

    en http://wedding.bayuhendarto.web.id
    id http://wedding.bayuhendarto.web.id/id/
    ms http://wedding.bayuhendarto.web.id/ms/

    https://wordpress.org/plugins/bogo/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 11 months ago #

    It has nothing to do with Bogo plugin. The theme you use doesn't apply proper style to the nav menu. Try switching to another theme.

  3. bayuhen
    Member
    Posted 11 months ago #

    Solved. in mer registration at function.php i change it to

    /* Register Menu */
    function register_menu() {
      register_nav_menu('en_US_primary-menu', __('Primary Menu EN', 'stag'));
      register_nav_menu('id_ID_primary-menu', __('Primary Menu ID', 'stag'));
      register_nav_menu('ms_MY_primary-menu', __('Primary Menu MY', 'stag'));
    }
    
    add_action('init', 'register_menu');
    
    function add_language_prefix($menu_identifier) {
        global $post;
        $language_prefix = get_post_meta( $post->ID, '_locale', true );
        return $language_prefix . '_' . $menu_identifier;
    }
    add_filter('language_prefix_menu', 'add_language_prefix');

    and in header I add this

    <nav id="navigation" role="navigation" class="clearfix">
    
        <?php
          if(has_nav_menu('primary-menu')){
            wp_nav_menu(array(
              'theme_location' => apply_filters( 'language_prefix_menu', 'primary-menu'),
              'container' => 'menu-primary-container',
              'items_wrap'      => '<ul id="primary-menu" class="%2$s">%3$s</ul>',
              ));
          }
        ?>

    good plugin Mr. Takayuki

Reply

You must log in to post.

About this Plugin

  • Bogo
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic