ThemeShaper Forums » Thematic

[closed]

Pages not showing in top nav

(2 posts)
  • Started 12 years ago by candregg
  • Latest reply from candregg
  • This topic is not resolved
  1. I'm trying to filter the main (top) navigation to show only pages. In the previous version of Thematic, this code worked like a charm:

    //  Restrict Nav menu to pages
    
    function main_menu() { ?>
                   <div class="menu">
                   <ul class="sf-menu">
    
    <li><a>/">Home</a></li>
    			   <?php wp_list_pages('title_li='); ?>
    
                   </div>
    <?php }
    add_action('wp_page_menu','main_menu');

    Since updating to the most recent version, this doesn't work, nor does the 'Show Home" argument included in the child theme functions file work.

    What is the new function code to display only pages in the main navigation (formerly 'wp-page-menu')?

    Posted 12 years ago #
  2. Got it! For anyone with a similar problem, here is the fix.

    I used the suggestions in Helgathevikings excellent post "http://forums.themeshaper.com/topic/thematic-menus-demystified-1"
    and modified this code snippet:

    // Remove the default Thematic Access
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    // My custom menu
    
    function custom_childtheme_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');?></div>
    	<div class="menu">
    		<ul class="menu">
    		<li class="tab tab-home"><a href="#/">Home</a></li>
    		<li class="tab tab-1"><a href="#">About</a></li>
    		<li class="tab tab-2"><a href="#">Contact</a></li>
    		<li class="tab tab-3"><a href="#">Projects</a></li>
    		<li class="tab tab-4"><a href="#">Inspire</a></li>
    		<li class="tab tab-5"><a href="#">Featured</a></li>
    		<li class="tab tab-6"><a href="#">Advertise</a></li>
    		</ul>
    	</div><!-- #menu -->
    	</div><!-- #access --> 
    
    <?php }
    
    add_action('thematic_header','custom_childtheme_access',9);

    to this variation, showing only a home link and pages:

    // Remove the default Thematic Access
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    // My custom menu
    
    function custom_childtheme_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');?></div>
    	<div class="menu">
                   <ul class="sf-menu">
                   <li><a href="<?php bloginfo('url'); ?>/">Home</a></li>
    			   <?php wp_list_pages('title_li='); ?>
                   </ul>
    	</div><!-- #menu -->
    	</div><!-- #access --> 
    
    <?php }
    
    add_action('thematic_header','custom_childtheme_access',9);

    It solved everything quite quickly. Thanks, Helga!

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.