ThemeShaper Forums » Thematic

[closed]

Add menu item that's a custom form

(7 posts)
  • Started 10 years ago by bluejpro
  • Latest reply from perryb
  • This topic is not resolved
  1. Hi

    I am looking to add a menu item into to my Thematic child theme. The menu item is a custom subscribe form. I already have the the script that runs the form, and the HTML to format the form in a function.

    What I don't know how to do is hook the form into the menu. I'd like to make it the last <li> item in the ul id="menu-main-menu, or at least position the code in the .main-menu class.

    I am having all sorts of positioning problems in different browsers the way I am doing it now, which is a function that puts it in the header:

    add_action('thematic_header','my_signup_div', 9);

    How can I hook it or filter it into the existing menu?

    If you have the slightest guess please don't be shy.

    Thanks !

    Posted 10 years ago #
  2. The problem with adding this menu item to the header is it floats over the other menu items.

    I am looking for a way to filter it as the last menu item.

    like:

    function my_new_link()
    //link content
    add_filter(somwhere, my_new_link, some position);

    Can anyone fill in the blanks?

    Thanks

    Posted 10 years ago #
  3. freaking akismet doesn't want to let me link to a possible solution. i think i tried to answer you a week ago, but then forgot when i couldn't post.

    you can either write a custom childtheme_override_access() (copying the current thematic_access() and then pasting in your form) or you could try:

    wpfirstaid DOT com/tag/wp_nav_menu/

    Posted 10 years ago #
  4. Hi this seemed to work when I just tested it:

    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    
    // Append your div to the end of the menu div
    function search_access() { ?>
        	<div id="access">
        		<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>
                <?php echo thematic_add_menuclass(wp_page_menu(thematic_page_menu_args()));?>
    
    		<!-- Your DIV/PHP or whatever here -->
    
            </div><!-- #access -->
    <?php }
    add_action('thematic_header','search_access',9);
    Posted 10 years ago #
  5. Beg your pardon - that doesn't add it to the menu li as requested

    Posted 10 years ago #
  6. @perryb - if you're using thematic 0.9.8 then you can just do

    function childtheme_override_access() {  ?>
      	<div id="access">
        		<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>
                <?php echo thematic_add_menuclass(wp_page_menu(thematic_page_menu_args()));?>
    
    		<!-- Your DIV/PHP or whatever here -->
    
            </div><!-- #access -->
    <?php }

    without the add and remove actions

    Posted 10 years ago #
  7. Cheers Helga - I haven't got my head round childtheme_override to date. That looks much tidier :)

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.