ThemeShaper Forums » Thematic

[closed]

Navigation menu disappears on update

(9 posts)
  • Started 3 years ago by Brett Holt
  • Latest reply from janimal
  • This topic is not resolved
  1. I updated about 30 minutes ago with the latest update to the theme and my navigation tabs are gone. Any suggestions?

    Posted 3 years ago #
  2. aftershock
    Member

    Same thing happened to me.

    I had #access stripped out in my functions.php file, and put my own in using wp_page_menu()
    I think it's wp_page_menu() that's not working, but I'm not sure why.

    Posted 3 years ago #
  3. what do you have in your functions.php ?? if you have modified the menu arguments to show a home link then you could be experiencing this:

    http://developing.thematic4you.com/2010/04/breaking-things-to-fix-others/

    Posted 3 years ago #
  4. aftershock
    Member

    No home link in my case, I just have this:

    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
        }
    add_action('init','remove_thematic_actions');
    
    function new_menu(){
    	?> <div id="newmenu"><?php wp_page_menu(); ?></div> <?
    }
    
    add_action('thematic_header','new_menu');

    Which I believe is pretty straightforward? I replaced the menu with my own for styling purposes. I'm still learning how to modify things with hooks/filters, so my code may be a little janky.

    Posted 3 years ago #
  5. you need a priority i think

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

    but i still don't understand why you'd do it. you can change the menu CSS.... the sections devoted to menu are pretty clear. you can delete them completely and rewrite your own.

    Posted 3 years ago #
  6. Same thing for me. Using, in functions.php

    // Add the Logo and Search Box next to the menu
    function childtheme_access(){ ?>
    	<div id="access">
    		<div class="skip-link"><a href="#content">"><?php _e('Skip to content', 'thematic'); ?></a></div>
    		<div id="menu">
    			<?php wp_page_menu('sort_column=menu_order') ?>
    		</div>
    		<div id="access-search">
    				<form id="searchform" method="get" action="<?php bloginfo('home') ?>">
    					<div>
    						<input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="20" tabindex="1" />
    						<input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('', 'thematic') ?>" tabindex="2" />
    					</div>
    				</form>
    		</div>
        </div><!-- #access -->
    <?php
    }
    add_action('thematic_header', 'childtheme_access', 4);

    The menu disappears. The <div id="menu">, is empty.

    Posted 3 years ago #
  7. I had exactly the same issue, ie strip the default access using

    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
        }
    add_action('init','remove_thematic_actions');

    and add my own menu stuff using

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

    Note: including the priority. The custom menu isn't added back in.

    In this particular case I simply removed the custom code and used the default menu and it all worked again.

    As for why you might want to do this? Read on...

    I have Another client site which was originally a simple handcrafted site. Then he wanted an online catalog & bought 3rd party catalog software & asked me to integrate it into his site. Then a year later he wanted blog functionality so a wp installation was added.

    So the menu that needs to be displayed on the WP pages has to link all the various parts of the site together. My solution is that the menu is defined in one single php file that all the various installations use by inclusion.

    So I definitely still need to be able to remove the default #access and be able to implement my own entirely.

    So I would like to know why

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

    doesn't work, I won't be looking at it for a few days though, first I have to redo my content filters & post thumbnail functions for several other sites - that's not a complaint BTW :)

    Posted 3 years ago #
  8. i figured it out. if you read here: http://developing.thematic4you.com/2010/04/breaking-things-to-fix-others/ then you will see that the default menu argument is now echo=>FALSE which means nothing gets echoed/printed on the screen. therefore when calling the wp_page_menu you must echo wp_page_menu.

    from the link, try this:

    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
        }
    add_action('init','remove_thematic_actions');
    
    function childtheme_menu_args($args) {
    	$args = array(
    		'show_home' => 'Home',
    		'sort_column' => 'menu_order',
    		'menu_class' => 'menu',
    		'echo' => false
    	);
    	return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    
    function new_menu(){ ?>
    <div id="new-menu"> <?php
    
    echo thematic_add_menuclass(wp_page_menu(thematic_page_menu_args)); ?>
    
    </div>
    <?php }
    
    add_action('thematic_header','new_menu',9);
    Posted 3 years ago #
  9. ah yes that works! I am too embarassed to tell you how many times I have seen that post about the menu and not thought about it :0!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.