我的网站位于:http: //math.pixelworklab.com/home-study
我希望仅在两页上隐藏导航栏
基本上防止用户在结帐时被其他链接分心。
如何使用 IF 语句在这些页面上隐藏此 div?
更新:
/* 导航 */
if ( ! function_exists( 'woo_nav' ) ) {
function woo_nav() {
global $woo_options;
woo_nav_before();
?>
<?php if (strpos($_SERVER['REQUEST_URI'],'/checkout/') === false
|| strpos($_SERVER['REQUEST_URI'],'/cart/') === false ):?>
<div id="navigation" class="col-full">
<?php woo_nav_inside(); ?>
<?php
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output' ) )
woo_custom_navigation_output( "name=Woo Menu 1" );
} else { ?>
<?php if ( is_page() ) $highlight = "page_item"; else $highlight = "page_item current_page_item"; ?>
<li class="<?php echo $highlight; ?>"><a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
<?php } ?>
</ul><!-- /#nav -->
<?php } ?>
<?php endif;?>
</div><!-- /#navigation -->
<?php
woo_nav_after();
} // End woo_nav()
}