Why is my sub-menu not loading in main menu? &lt;div class="row" id="mainNav"&gt;
 &lt;?php print theme('links__system_main_menu', array(
    'links' =&gt; $main_menu,
    'attributes' =&gt; array(
      'class' =&gt; 'menu',
    ),
  )); ?&gt;
&lt;/div&gt;


I've used the above code to load main menu in page template. This code fails to display submenus. Please suggest.
Go to /admin/structure/menu/manage/main-menu 
Edit your parent link
Enable "Show as expanded" checkbox
(Repeat the same for all the parent links)
Go to the front page and see the main menu expanded.


Update:

You can use next code to render menu:

 $main_menu = variable_get('menu_main_links_source', 'main-menu');
 $tree = menu_tree($main_menu);
 print render($tree);