How to customize menu in wordpress theme?

7 replies
  • WEB DESIGN
  • |
Hi

My site is currently hosted with Hostgator and I just installed the wordpress. The problem with all the theme is they dont have custom menus. I have 10 pages, but I only want 8 of them on the top menu and 2 of them in my side bar. How am I suppose to edit the top menu?

Please advise

thanks
#customize #menu #theme #wordpress
  • Profile picture of the author phpbbxpert
    It all depends what theme you are using.

    The default WP theme you can do it by using the Appearance -> Menu feature
    Create a menu and add the pages you want, it will over ride the default.

    Then just add a widget to the sidebar, it could even be just a text widget if you know a little HTML to make the 2 links you want.

    Or create another Menu under the menus and add your 2 links to it.
    Then add a custom Menu Widget to the sidebar with your new menu.
    {{ DiscussionBoard.errors[3600707].message }}
  • Profile picture of the author jlandells
    I have exactly the same issue with my own theme!

    I can tell you how I fixed it, but you'll need to be happy editing your PHP code...

    You need to go into your Wordpress dashboard and go to the list of Pages. Hover your mouse over one of the pages that you don't want and look at the status bar at the bottom of your browser. You'll see the internal URL of that page come up and part of it will say something like "post=23". You'll need to make a note of the number in each case - that's the post ID of the pages that you don't want.

    Next, go into the appearance section and select 'Editor'. In my theme, I need to select the 'Header' template from the list on the right. You're looking for something that says:

    PHP Code:
    wp_page_menu(); 
    or

    PHP Code:
    wp_page_menu'show_home=1' ); 
    and this is what we need to modify. We exclude the pages that we don't want by adding an exclude parameter as follows:

    PHP Code:
    wp_page_menu'exclude=23,52,175' ); 
    or

    PHP Code:
    wp_page_menu'show_home=1&exclude=23,52,175' ); 
    To be honest, if you can find a theme that uses custom menus, you'll be better off in the long run, otherwise every time you add a page, you'll have to exclude it here. I'm currently planning on upgrading my own theme to use custom menus for this very reason.

    Hope this helps!

    Kind regards,
    -John.
    {{ DiscussionBoard.errors[3600716].message }}
    • Profile picture of the author adrian8311
      I don't seem to find the wp_page_menu

      Here is the header.php :

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

      <head profile="http://gmpg.org/xfn/11">
      <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

      <title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>

      <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
      <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
      <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
      <link href="<?php echo bloginfo('stylesheet_directory'); ?>/style.css" rel="stylesheet" type="text/css" />
      <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
      <?php wp_head(); ?>
      <?php wp_enqueue_script('jquery'); ?>
      <script type='text/javascript'>
      jQuery(document).ready(function() {
      jQuery("#dropmenu ul").css({display: "none"}); // Opera Fix
      jQuery("#dropmenu li").hover(function(){
      jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(100);
      },function(){
      jQuery(this).find('ul:first').css({visibility: "hidden"});
      });
      });
      </script>
      </head>
      <body>
      <div id="container">
      <div id="frame">
      <div id="top">
      <?php
      $logotype = get_option('skyline_logo_type');
      $logoimage = get_option('skyline_logo_image');
      if($logoimage == ""){ $logoimage = get_bloginfo('stylesheet_directory') . "/images/logo.gif"; }
      ?>
      <?php if($logotype ==0 || $logotype == ""){ ?>
      <div id="logo">
      <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
      <span class="desc"><?php bloginfo('description'); ?></span>
      </div>
      <?php }else{ ?>
      <div id="logoimg">
      <a href="<?php echo get_option('home'); ?>/"><img src="<?php echo $logoimage ?>" alt="<?php bloginfo('name'); ?>" border="0" width="300" height="105" /></a>
      </div>
      <?php }?>
      </div>
      <div id="top_menu">
      <ul id="dropmenu">
      <li class="page_item<?php if (is_home()) echo ' current_page_item'; ?> noborder">
      <a href="<?php echo get_option('home'); ?>/">Home</a>
      </li>
      <?php wp_list_pages('title_li=0&sort_column=menu_order') ; ?>
      </ul>
      </div>
      <div id="header">
      <?php
      $mainimageurl = get_option('skyline_mainimageurl');
      if($mainimageurl == ""){
      ?>
      <img src="<?php echo get_bloginfo('stylesheet_directory')?>/images/header.jpg" alt="<?php bloginfo('name'); ?>" border="0" />
      <?php }else{?>
      <img src="<?php echo $mainimageurl ?>" alt="<?php bloginfo('name'); ?>" border="0" width="900" height="238" />
      <?php }?>

      </div>
      <div id="top_search">
      <div id="box_search">
      <div id="icon_search">
      <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
      <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" class="inputbox" />
      <input type="image" class="button" src="<?php echo bloginfo('stylesheet_directory'); ?>/images/but_go.gif" />
      </form>
      </div>
      </div>
      </div>
      <div id="main">
      <div id="main_left">
      <div id="block_sidebar">
      <?php get_sidebar();?>
      </div>
      </div>
      <div id="main_right">
      <div id="main_content">
      <!--start main_content-->
      {{ DiscussionBoard.errors[3601109].message }}
  • Profile picture of the author jlandells
    It's a similar method for your theme. Where you have the line:

    PHP Code:
    <?php wp_list_pages('title_li=0&sort_column=menu_order')  ; ?>
    you need to add on the excluded pages in the same manner that I described. So for example, if you want to exclude page ID's 51, 76 and 125, you'd edit the line to be:

    PHP Code:
    <?php wp_list_pages('title_li=0&sort_column=menu_order&exclude=51,76,125')  ; ?>
    Hope this helps!

    Kind regards,
    -John.
    {{ DiscussionBoard.errors[3602064].message }}
  • Profile picture of the author xtrapunch
    WordPress allows themes to register menus for use in the theme. If your theme lacks it, go read on WordPres Codex site.
    Signature
    >> Web Design, Wordpress & SEO - XtraPunch.com <<
    Web Design & SEO Agency | Serving World Wide from New Delhi, India

    {{ DiscussionBoard.errors[3603309].message }}
    • Profile picture of the author joebel
      Try to go to your setting on your theme. There I believe you can found a checkbox to all of your pages and just check it if you want your page to be visible. If you want to appear it to the side just go to widget and just drag the CUSTOM MENU tab. I think it depends what theme you are using. These setting is can implement on FLEX themes.
      {{ DiscussionBoard.errors[3605470].message }}
  • Profile picture of the author haymanpl
    Use the menu option in your wordpress dashboard to customise your menu

    You can also install a plugin that will exclude pages

    Maybe its time to upgrade to a more flexible and easy to customise theme
    {{ DiscussionBoard.errors[3605521].message }}

Trending Topics