• Resolved jewessel

    (@jewessel)


    I am using a theme that is a child of Hybrid, and I found the array that I need to edit to get the effect that I want. I want to have two lines of navigation, but only have 3 pages in one navbar, while I have the rest in the 2nd navbar.

    The top nav bar has a home link & “contact” link. The array for that is in the original Hybrid theme in the hooks-filters.php file. It looks like this:

    function news_cat_nav() {
    
    	$args = array(
    		'style' => 'list',
    		'hide_empty' => true,
    		'exclude' => 192,
    		'use_desc_for_title' => false,
    		'depth' => 4,
    		'hierarchical' => true,
    		'echo' => false,	// Leave as is.
    		'title_li' => false,	// Leave as is.
    	);
    
    	echo "\n\t<div id='cat-navigation'>\n\t\t";
    
    	echo '<div id="cat-nav" class="cat-nav"><ul class="menu sf-menu">' . str_replace( array( "\t", "\n", "\r" ), '', wp_list_pages( $args ) ) . '</ul></div>';
    
    	echo '<div id="feed"><ul>';
    	echo '<li class="feed-url"><a href="' . get_bloginfo( 'rss2_url' ) . '" title="' . __('Subscribe to the feed', 'news') . '">' . __('Subscribe', 'news') . '</a></li>';
    	echo '</ul></div>';
    
    	echo "\n\t</div>\n";
    }

    This currently works, and excludes 192, but I would like to add a second page number (538) to the ‘exclude’ line, but when I change it to 'exclude' => 192,538, it breaks.

    Can someone help me figure out how to edit this? Thanks!!!

    (Actually I am using 2.9.2, but the drop-down doesn’t offer that option.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try:

    $excludes = '192,538';
    $args = array(
    		'style' => 'list',
    		'hide_empty' => true,
    		'exclude' => $excludes,
    		'use_desc_for_title' => false,
    		'depth' => 4,
    		'hierarchical' => true,
    		'echo' => false,	// Leave as is.
    		'title_li' => false,	// Leave as is.
    	);
    Thread Starter jewessel

    (@jewessel)

    That didn’t work. 🙁

    Thread Starter jewessel

    (@jewessel)

    Sorry – I didn’t see that you had changed the “exclude” line in the array. But after fooling around, I figured out another fix. I put the numbers inside single quotes and that worked.

    'exclude' => '192,538'

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘‘exclude’ pages in functions.php file’ is closed to new replies.