SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unique menu for home page only

    I am using wordpress 3.3 and need the home page horizontal menu to a specific way while ALL the interior pages have a more involved drop down menu.
    So, one menu for home page and all other pages get a detailed menu/

    Code:
    <?php include_header(); ?>
            		<?php mainmenu(); ?>
    how can I make it detect if it is homepage to use mainmenu, and if not to use a secondmenu for all other pages?

    I am not a programmer, more of a stylist.

    Thanks

  2. #2
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,015
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Set the homepage to use its own template in the admin panel. As your design evolves you are likely to come up with other differences between the two layouts, so separating the templates now will be easier than later.

    Also, we have a Wordpress specific forum. This one is for general PHP questions.

  3. #3
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    Set the homepage to use its own template in the admin panel. As your design evolves you are likely to come up with other differences between the two layouts, so separating the templates now will be easier than later.

    Also, we have a Wordpress specific forum. This one is for general PHP questions.
    In the theme editor area? the home.php or index.php they both have <?php get_header(); ?>
    so you would simply edit it to get_headerhome(); ?> and make a headerhome.php file ?

    we can move this question to wordpress if necessary.

  4. #4
    SitePoint Evangelist snecz's Avatar
    Join Date
    Mar 2007
    Location
    Warsaw, Poland
    Posts
    429
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lukkas View Post
    In the theme editor area? the home.php or index.php they both have <?php get_header(); ?>
    so you would simply edit it to get_headerhome(); ?> and make a headerhome.php file ?

    we can move this question to wordpress if necessary.
    One possible way is to make two headers and different template for home page.
    So you can have header.php and header-home.php.
    Than for home page template you can call <?php get_header('home'); ?> and for page.php just <?php get_header(''); ?>.
    Hope that helps.
    Warsaw - the city that survived its own death.
    EMM8 - Profesjonalne Strony Internetowe
    Projektowanie Stron WWW

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,107
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    I would question the wisdom of having a different menu on different parts of the site. Sounds confusing to me.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  6. #6
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want it to be hierachical. Instead of bloating the homepage with a full menu. it is menu "a" (no dropdown) and ALL pages inside the site get menu "b" (which has dropdown)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •