Forums

[resolved] remove default wordpress menu (10 posts)

  1. riteshskumar
    Member
    Posted 3 years ago #

    Hi,

    Could anybody tell me that how to remove default wordpress menu?

    Rgds,
    Ritesh

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Try adding a widget to the sidebar.

  3. riteshskumar
    Member
    Posted 3 years ago #

    Hi Esmi,

    I am very new to wordpress and to php as well. I don't understand high level difinition.

    Could you please elaborate in low level language?

    Rgds,
    RSK

  4. Saildude
    Member
    Posted 3 years ago #

    Dashboard >> Appearance >> Widgets -

  5. riteshskumar
    Member
    Posted 3 years ago #

    Hi Esmi/Saildude,

    I am at Dashboard >> Appearance >> Widgets, but which widget i should add to the sidebar?

    Rgds,
    RSK

  6. James
    Happiness Engineer
    Posted 3 years ago #

    Which "default wordpress menu" are you trying to remove?

  7. riteshskumar
    Member
    Posted 3 years ago #

    Hi Macmanx,

    Thanks for your reply.

    If you go to my page http://www.rashmi.net/, you can see top horizontal menu - home, about, guest writer, daily video, contact me....

    I want to remove this menu.

    Regards,
    RSK

  8. James
    Happiness Engineer
    Posted 3 years ago #

    In your theme's header.php file, remove the following section:

    <div id="nav">
    <?php function get_the_pa_ges() {
      global $wpdb;
      if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
         $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
    
       }
      return $these_pages;
     }
    
     function list_all_pages(){
    
    $all_pages = get_the_pa_ges ();
    foreach ($all_pages as $thats_all){
    $the_page_id = $thats_all->ID;
    
    if (is_page($the_page_id)) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    $output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
    }
    
    return $output;
     }
    ?>
    <ul>
    <?php
    
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
    echo list_all_pages();?>
    </ul>
    
    <div class="cleared"></div>
    </div> <!-- Closes Nav -->

    You may have to edit the style.css file a little bit to tighten up spacing if any undesirable gap is left by removing the nav menu.

  9. riteshskumar
    Member
    Posted 3 years ago #

    Hi Macmanx,

    Trick worked!! you are a champ.

    Thanks to you.

    Rgds,
    RSK

  10. James
    Happiness Engineer
    Posted 3 years ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.