Jump to content

Wordpress: Help w/ "if/then" statement for excluding nav items on specific pgs


blblalock

Recommended Posts

 

 

I need to create a couple of pages with limited navigation items for a friend's website. I'm thinking what I need to do is use if is_page to create additional exclusions on the pages in question. I'm a PHP newb and not sure how to handle the syntax though.

 

Here's the sandbox_glovalnav section from the site as it is now:

 

I think if I do an if page_is statement with the snipped below used for both the "if" part of the statement and the "then" part of the statement, with the additional pages that need to be excluded, it'd do the trick. Just don't quite know how and don't want to break my friend's site.

 

function sandbox_globalnav() {

if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0&exclude=254,271,274,277,279,465,454,486,545,650,816,831,904,910,946') ) )

 

$menu = '

 

      ' . $menu . '

 

';

$menu = '<div class="menu">' . $menu . "</div>\n";

echo apply_filters( 'globalnav_menu', $menu ); // Filter to override default globalnav: globalnav_menu

}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.