ThemeShaper Forums » Thematic

[closed]

custom menu in thematic childtheme

(5 posts)
  • Started 4 years ago by Furfur
  • Latest reply from helgatheviking
  • This topic is resolved
  1. I've been trying to add a custom menu in the thematic above header to display
    a custom menu, but I get the problem that the background image for the menu is appearing below the menu istead of behind it

    the link to my site is Furfur.org
    any help would be greatly appreciated.

    here's the function and css

    function childtheme_menu() {
                   echo '
                     <ul id=\'menu2\'> '.wp_list_bookmarks('title_li=&categorize=0&category=2') .' ';
    
          }
    
          add_action( 'thematic_aboveheader', 'childtheme_menu' );
    #menu2
    {
        background: url(img/catbgnew2.png)repeat;
        height:10px;
    
    }

    and heres what firebug is outputting

    <li>
    <a href="http://gallery.furfur.org">Gallery</a>
    </li>
    <ul id="menu2">
    Posted 4 years ago #
  2. I presume the link to your Gallery is supposed to be in the #menu2 id? The fact that it is current NOT, explains why the background is appearing below instead of behind... they are being outputted as 2 separate things so they are getting stacked on top of each other.

    Rather than try to figure out what isn't working, I will just point you to what I think is the easiest way to create a custom menu:

    http://www.keighl.com/plugins/menus-plus/

    I have used this and it is great. Then you should be able to hook it into your theme all wrapped in a div (since if you are injecting it to the thematic_aboveheader you are really only inside the #wrapper div) w/ the following

    <?php
    
    function childtheme_menu() { ?>
    
    <div id="aboveheader">
    
    <?php menusplus(#); ?>
    
    </div>
    
    }
    
    add_action( 'thematic_aboveheader', 'childtheme_menu');
    
    ?>

    where the # is the number for the menu you are trying to use.

    Posted 4 years ago #
  3. ok I've added the plugin and the code into the functions.php and it is kind of working, the only problem is the links are stacked instead of inline, any ideas?

    Posted 4 years ago #
  4. never min I managed to get this sorted, thanks for the plugin reference and the help helgatheviking

    Jay

    Posted 4 years ago #
  5. glad I could help. I just realized that I used the following code in my own theme. Adding the div class=menu and especially the ul class taps into Thematic's default menu styling.

    <div id="aboveheader">
    <div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>	
    
    <div class="menu menusplus">
    <ul class="sf-menu sf-js-enabled">
    <?php menusplus(1); ?>
    </ul>
    </div>
    
    </div>
    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.