• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_page_menu函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_page_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_page_menu函数的具体用法?PHP wp_page_menu怎么用?PHP wp_page_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_page_menu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ecvetstep_primary_menu

    /**
     * Shows the Primary Menu 
     *
     * default load in sidebar-header-right.php
     */
    function ecvetstep_primary_menu()
    {
        ?>
	<div id="header-menu">
        <nav id="access" role="navigation">
            <h2 class="assistive-text"><?php 
        _e('Primary Menu', 'ecvetstep');
        ?>
</h2>
            <div class="assistive-text skip-link"><a href="#content" title="<?php 
        esc_attr_e('Skip to content', 'ecvetstep');
        ?>
"><?php 
        _e('Skip to content', 'ecvetstep');
        ?>
</a></div>
            <?php 
        if (has_nav_menu('primary')) {
            $ecvetstep_primary_menu_args = array('theme_location' => 'primary', 'container_class' => 'menu-header-container', 'items_wrap' => '<ul class="menu">%3$s</ul>');
            wp_nav_menu($ecvetstep_primary_menu_args);
        } else {
            echo '<div class="menu-header-container">';
            wp_page_menu(array('menu_class' => 'menu'));
            echo '</div>';
        }
        ?>
 	         
        </nav><!-- .site-navigation .main-navigation -->  
	</div>
<?php 
    }
开发者ID:EcvetStep,项目名称:ecvet-step.eu,代码行数:36,代码来源:es-menus.php


示例2: page_menu

 /**
  * Default fallback_cb, but filtered with new classnames and nav_menu_container
  */
 public function page_menu($args)
 {
     add_filter('wp_page_menu', array($this, 'nav_menu_container'), 10, 2);
     add_filter('wp_page_menu', array($this, 'shim_classnames'), 10, 2);
     wp_page_menu($args);
     remove_filter('wp_page_menu', array($this, 'nav_menu_container'), 10, 2);
     remove_filter('wp_page_menu', array($this, 'shim_classnames'), 10, 2);
 }
开发者ID:kidfiction,项目名称:wp-favepersonal,代码行数:11,代码来源:patch-nav-menu.php


示例3: bpmagic_main_nav_fallback

function bpmagic_main_nav_fallback($args)
{
    $pages_args = array('depth' => 0, 'echo' => false, 'exclude' => '', 'title_li' => '');
    $menu = wp_page_menu($pages_args);
    $menu = str_replace(array('<div class="menu"><ul>', '</ul></div>'), array('<ul id="nav">', '</ul><!-- #nav -->'), $menu);
    echo $menu;
    do_action('bp_nav_items');
}
开发者ID:buddydev,项目名称:bp-magic,代码行数:8,代码来源:template.php


示例4: fallback

 public function fallback($args)
 {
     if ($args["theme_location"] === "main") {
         add_filter("wp_page_menu", array(&$this, "wp_page_menu_filter"));
         wp_page_menu(array("depth" => 1, "menu_class" => "menu"));
         remove_filter("wp_page_menu", array(&$this, "wp_page_menu_filter"));
     }
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:8,代码来源:PeThemeMenu.php


示例5: rock_add_primary_menu

/**
 * Add primary menu.
 *
 * @action rock_site_navigation
 * @since 1.0.0
 */
function rock_add_primary_menu()
{
    if (!has_nav_menu('primary')) {
        wp_page_menu(array('depth' => 1, 'show_home' => true));
        return;
    }
    wp_nav_menu(array('theme_location' => 'primary', 'walker' => new Rock_Walker_Nav_Menu()));
}
开发者ID:faithmade,项目名称:rock,代码行数:14,代码来源:hooks.php


示例6: catchadaptive_primary_menu

    /**
     * Shows the Primary Menu 
     *
     * default load in sidebar-header.php
     */
    function catchadaptive_primary_menu()
    {
        $options = catchadaptive_get_theme_options();
        ?>
	<nav class="nav-primary" role="navigation">
        <div class="wrapper">
            <div class="screen-reader-text skip-link"><a href="#content" title="<?php 
        esc_attr_e('Skip to content', 'catchadaptive');
        ?>
"><?php 
        _e('Skip to content', 'catchadaptive');
        ?>
</a></div>
            <?php 
        if (has_nav_menu('primary')) {
            $classes = "mobile-menu-anchor primary-menu";
        } else {
            $classes = "mobile-menu-anchor page-menu";
        }
        ?>
                    
                <div id="mobile-header-left-menu" class="<?php 
        echo $classes;
        ?>
">
                    <a href="#mobile-header-left-nav" id="header-left-menu" class="genericon genericon-menu">
                        <span class="mobile-menu-text"><?php 
        _e('Menu', 'catchadaptive');
        ?>
</span>
                    </a>
                </div><!-- #mobile-header-menu -->

                <?php 
        $logo_alt = '' != $options['logo_alt_text'] ? $options['logo_alt_text'] : get_bloginfo('name', 'display');
        if (isset($options['logo_icon']) && $options['logo_icon'] != '' && !empty($options['logo_icon'])) {
            echo '<div id="logo-icon"><a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name', 'display')) . '" rel="home">
                        <img src="' . esc_url($options['logo_icon']) . '" alt="' . esc_attr($logo_alt) . '">
                    </a></div>';
        }
        echo '<h1 class="assistive-text">' . __('Primary Menu', 'catchadaptive') . '</h1>';
        if (has_nav_menu('primary')) {
            $catchadaptive_primary_menu_args = array('theme_location' => 'primary', 'menu_class' => 'menu catchadaptive-nav-menu', 'container' => false);
            wp_nav_menu($catchadaptive_primary_menu_args);
        } else {
            wp_page_menu(array('menu_class' => 'menu catchadaptive-nav-menu'));
        }
        ?>
            <div id="header-toggle" class="genericon genericon-search">
                <a class="screen-reader-text" href="#header-toggle-sidebar"><?php 
        _e('Search', 'catchadaptive');
        ?>
</a>
            </div>
        </div><!-- .wrapper -->
    </nav><!-- .nav-primary -->
    <?php 
    }
开发者ID:jpbender,项目名称:wp_beta,代码行数:63,代码来源:catchadaptive-menus.php


示例7: sith_fallback_pages

function sith_fallback_pages()
{
    $args = array('depth' => 0, 'sort_column' => 'menu_order, post_title', 'menu_class' => '', 'include' => '', 'exclude' => '', 'echo' => false, 'show_home' => true, 'link_before' => '', 'link_after' => '');
    $pages = wp_page_menu($args);
    $prepend = '<div class="teste">';
    $append = '</div>';
    $output = $prepend . $pages . $append;
    echo $output;
}
开发者ID:klebercarvalho,项目名称:demo,代码行数:9,代码来源:theme-functions.php


示例8: om_primary_menu_fallback

 function om_primary_menu_fallback($args)
 {
     $menu = wp_page_menu(array('echo' => false));
     $args['menu_class'] .= ' primary-menu-fallback';
     $menu = str_replace('<div class="menu"><ul>', '<div class="menu"><ul class="' . esc_attr($args['menu_class']) . '">', $menu);
     if (isset($args) && $args['echo'] == false) {
         return $menu;
     } else {
         echo om_esc_wpcf($menu);
     }
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:11,代码来源:functions.php


示例9: joints_main_nav_fallback

function joints_main_nav_fallback() {
	wp_page_menu( array(
		'show_home' => true,
    	'menu_class' => '',      // Adding custom nav class
		'include'     => '',
		'exclude'     => '',
		'echo'        => true,
        'link_before' => '',                            // Before each link
        'link_after' => ''                             // After each link
	) );
}
开发者ID:supahseppe,项目名称:path-of-gaming,代码行数:11,代码来源:menu.php


示例10: mesocolumn_revert_wp_menu_page

function mesocolumn_revert_wp_menu_page($args)
{
    global $bp, $bp_active;
    $pages_args = array('depth' => 0, 'echo' => false, 'exclude' => '', 'title_li' => '');
    $menu = wp_page_menu($pages_args);
    $menu = str_replace(array('<div class="menu"><ul>', '</ul></div>'), array('<ul class="sf-menu">', '</ul>'), $menu);
    echo $menu;
    if ($bp_active == 'true') {
        do_action('bp_nav_items');
    }
}
开发者ID:jrbranaa,项目名称:pitchperspectives,代码行数:11,代码来源:functions.php


示例11: section_nav

 public function section_nav($args = array())
 {
     if (!is_array($args)) {
         $args = array();
     }
     $exclude = EdcMenu::nav_excluded_page_ids();
     if (isset($args['exclude']) && is_array($args['exclude'])) {
         $exclude = array_merge($args['exlude'], $exclude);
         unset($args['exclude']);
     }
     $topPage = $this->getSectionID();
     echo '<h2>' . (0 == $topPage ? '' : get_the_title($topPage)) . '</h2>';
     return wp_page_menu(array_merge(array('child_of' => $topPage, 'depth' => 2, 'sort_column' => 'menu_order', 'exclude' => $exclude), $args));
 }
开发者ID:huntercoxIG,项目名称:edc,代码行数:14,代码来源:edc-menu.php


示例12: pixopoint_page_menu_shortcode

/**
 * [page_menu] shortcode
 * @since 0.1
 */
function pixopoint_page_menu_shortcode($atts)
{
    // Grabbing parameters and setting default values
    extract(shortcode_atts(array('include' => '', 'exclude' => '', 'show_home' => 'true', 'link_before' => '', 'link_after' => ''), $atts));
    // Sanitise as comma delimited list of numbers
    $include = pixopoint_validate_comma_numeric($include);
    $exclude = pixopoint_validate_comma_numeric($exclude);
    // True or false settings
    if ('false' == $show_home) {
        $show_home = 0;
    } else {
        $show_home = 1;
    }
    // Sanitise HTML
    $link_before = sanitize_title($link_before, '');
    $link_after = sanitize_title($link_after, '');
    return wp_page_menu('echo=0&include=' . $include . '&exclude=' . $exclude . '&show_home=' . $show_home . '&link_before=' . $link_before . '&link_after=' . $link_after);
}
开发者ID:pemiu01,项目名称:wppaintbrush,代码行数:22,代码来源:shortcodes.php


示例13: widget

    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        echo $args['before_widget'];
        ?>

			<nav id="nav" class="site_nav">

				<?php 
        $args = array('depth' => 0, 'sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'include' => '', 'exclude' => '', 'echo' => true, 'show_home' => false, 'post_type' => 'article', 'link_before' => '', 'link_after' => '');
        ?>

				<?php 
        wp_page_menu($args);
        ?>


			</nav>

		<?php 
        echo $args['after_widget'];
    }
开发者ID:joshevensen,项目名称:theunassistedbaby.com,代码行数:29,代码来源:article-menu.php


示例14: sfhiv_draw_page_navigation

function sfhiv_draw_page_navigation($post_ids, $args = array())
{
    extract($args);
    if (!is_array($post_ids)) {
        $post_ids = array($post_ids);
    }
    $ids_to_show = array();
    ?>
<nav><?php 
    foreach ($post_ids as $ID) {
        array_push($ids_to_show, $ID);
        if (!isset($show_children) || $show_children) {
            $children = get_pages(apply_filters('sfhiv_filter_args', array("parent" => $ID, "hierarchical" => 0, "post_type" => get_post_type($ID))));
            foreach ($children as $child) {
                array_push($ids_to_show, $child->ID);
            }
        }
        $parents = get_ancestors($ID, get_post_type($ID));
        if (!isset($show_parents) || $show_parents) {
            foreach ($parents as $parent) {
                array_push($ids_to_show, $parent);
            }
        }
        if (!isset($show_siblings) || $show_siblings) {
            if (count($parents) > 0) {
                $parent_ID = $parents[0];
                $siblings = get_pages(apply_filters('sfhiv_filter_args', array("parent" => $parent_ID, "hierarchical" => 0, "post_type" => get_post_type($ID))));
                foreach ($siblings as $sibling) {
                    array_push($ids_to_show, $sibling->ID);
                }
            }
        }
    }
    wp_page_menu(array_merge($args, array('show_home' => false, 'sort_column' => 'menu_order', 'include' => implode(",", $ids_to_show), 'post_type' => get_post_type($ID), 'walker' => new SFHIV_Post_Type_Walker_Menu())));
    ?>
</nav><?php 
}
开发者ID:nickdotreid,项目名称:SFHIV-Wordpress-Theme,代码行数:37,代码来源:menu_wrapper.php


示例15: chip_zero_primary_menu

/**
* Chip Menu(s) Callback
*/
function chip_zero_primary_menu()
{
    wp_page_menu(array('menu_class' => 'primary-container'));
}
开发者ID:ericgnelson,项目名称:ericgnelson,代码行数:7,代码来源:methods.php


示例16: weaverii_page_menu

 function weaverii_page_menu()
 {
     /* handle sf-menu for wp_page_menu */
     $menu = wp_page_menu(array('echo' => false));
     if (weaverii_use_sf()) {
         $ulpos = stripos($menu, '<ul>');
         if ($ulpos !== false) {
             echo substr_replace($menu, '<ul class="sf-menu">', $ulpos, 4);
         }
     } else {
         echo $menu;
     }
 }
开发者ID:mystified7545,项目名称:MyBlog,代码行数:13,代码来源:functions.php


示例17: bloginfo

    bloginfo('description');
    ?>
</div>
<?php 
}
?>
            </div><!-- #branding -->
            
						<div id="access">
						    <div class="skip-link"><a href="#content" title="<?php 
_e('Skip to content', 'your-theme');
?>
"><?php 
_e('Skip to content', 'your-theme');
?>
</a></div>
						    <?php 
wp_page_menu(array('sort_column' => 'menu_order', 'exclude_tree' => 40));
?>

						</div><!-- #access -->
 
        </div><!-- #masthead -->
    </div><!-- #header -->
 
    <div id="main">
    	<ul id="products">
				<?php 
wp_list_pages(array('child_of' => 40, 'title_li' => ''));
?>
			</ul>
开发者ID:projet-ID,项目名称:Bonepup,代码行数:31,代码来源:header.php


示例18: wp_head

wp_head();
?>
	</head>
	<body>
		<div id="wrapper">
			<header>

				<!-- Gets the WordPress site name and links it to it's URL. -->
				<h1><a href="<?php 
bloginfo('url');
?>
"><?php 
bloginfo('name');
?>
</a></h1>

				<!-- Load the search form. -->
				<?php 
get_search_form();
?>

				<p class="hr_sep"></p>

				<!-- Load the page navigation into an unordered list. -->
				<nav>
					<?php 
wp_page_menu('show_home=1');
?>
				</nav>
			</header>
			<section>
开发者ID:nedf23,项目名称:simply_grey,代码行数:31,代码来源:header.php


示例19: sds_primary_menu_fallback

 function sds_primary_menu_fallback()
 {
     wp_page_menu(array('menu_class' => 'primary-nav menu', 'echo' => true, 'show_home' => true, 'link_before' => '', 'link_after' => ''));
 }
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:4,代码来源:theme-functions.php


示例20: attitude_headerdetails


//.........这里部分代码省略.........
							</h1>
						<?php 
        }
    }
    ?>
					
				</hgroup><!-- #site-logo -->
			
		</div><!-- .hgroup-wrap -->
	</div><!-- .container -->	
	<?php 
    $header_image = get_header_image();
    if (!empty($header_image)) {
        ?>
				<a href="<?php 
        echo esc_url(home_url('/'));
        ?>
" title="<?php 
        echo esc_attr(get_bloginfo('name', 'display'));
        ?>
"><img src="<?php 
        echo esc_url($header_image);
        ?>
" class="header-image" width="<?php 
        echo get_custom_header()->width;
        ?>
" height="<?php 
        echo get_custom_header()->height;
        ?>
" alt="<?php 
        echo esc_attr(get_bloginfo('name', 'display'));
        ?>
"></a>
			<?php 
    }
    ?>
	
	<?php 
    if (has_nav_menu('primary')) {
        $args = array('theme_location' => 'primary', 'container' => '', 'items_wrap' => '<ul class="root">%3$s</ul>');
        echo '<nav id="access" class="clearfix">
					<div class="container clearfix">';
        wp_nav_menu($args);
        echo '</div><!-- .container -->
					</nav><!-- #access -->';
    } else {
        echo '<nav id="access" class="clearfix">
					<div class="container clearfix">';
        wp_page_menu(array('menu_class' => 'root'));
        echo '</div><!-- .container -->
					</nav><!-- #access -->';
    }
    ?>
 		
		<?php 
    global $options, $array_of_default_settings;
    $options = wp_parse_args(get_option('attitude_theme_options', array()), attitude_get_option_defaults());
    if ('above-slider' == $options['slogan_position'] && (is_home() || is_front_page())) {
        if (function_exists('attitude_home_slogan')) {
            attitude_home_slogan();
        }
    }
    if (is_home() || is_front_page()) {
        if (0 == $options['disable_slider']) {
            if (function_exists('attitude_pass_cycle_parameters')) {
                attitude_pass_cycle_parameters();
            }
            if (function_exists('attitude_featured_post_slider')) {
                attitude_featured_post_slider();
            }
        }
    } else {
        if ('' != attitude_header_title() || function_exists('bcn_display_list')) {
            ?>
			<div class="page-title-wrap">
	    		<div class="container clearfix">
	    			<?php 
            if (function_exists('attitude_breadcrumb')) {
                attitude_breadcrumb();
            }
            if ('' != attitude_header_title()) {
                ?>
				   <h1 class="page-title"><?php 
                echo attitude_header_title();
                ?>
</h1><!-- .page-title -->
				   <?php 
            }
            ?>
				</div>
	    	</div>
	   <?php 
        }
    }
    if ('below-slider' == $options['slogan_position'] && (is_home() || is_front_page())) {
        if (function_exists('attitude_home_slogan')) {
            attitude_home_slogan();
        }
    }
}
开发者ID:alexdbrown,项目名称:wordpress_practice,代码行数:101,代码来源:header-extensions.php



注:本文中的wp_page_menu函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_page_numbers函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_original_referer_field函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap