Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
I have created my own theme in wordpress and i have added below mentioned pages in that theme

header.php
footer.php
index.php
sidebar.php
functions.php
page.php
style.css

In functions.php i have written this code
XML
<?php
function register_my_menu()
{
register_nav_menu('Primary-Menu',__( 'Primary Menu' ));
}

add_action( 'init', 'register_my_menu' );
/* end of code */
 /*by writing this line menu displayed on theme  menu code finished */
?>

<?php
  register_sidebar(array (
'name' => __( 'Primary Widget Area'),//__ returns the translated text
'id' => 'widget-name',
'description' => __( 'The primary widget area'),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => "</li>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
add_action( 'widgets_init', 'register_sidebar' );//function to load my widget


    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Welcome Message','before_widget' => '','after_widget' => '',
                    'before_title' => '<h1>','after_title' => '</h1>',));
    register_sidebar(array('name'=>'Top Ten Articles','before_widget' => '','after_widget' => '',
                    'before_title' => '<h4 class="top-ten">','after_title' => '</h4>',));
    register_sidebar(array('name'=>'Reviews','before_widget' => '<div id="reviews">','after_widget' => '</div>',
                    'before_title' => '','after_title' => '',));
?>



My menu and sub menus are visible on theme but sub menus are not coming under the mentioned menu.
What to do??
Thanx in advance
Posted
Comments
Sunasara Imdadhusen 8-May-14 5:34am    
I think there is CSS issue, please share CSS code as well
[no name] 15-May-14 2:01am    
what is style in your css file, can you share your code, so i can give you better answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900