当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_page_menu函数代码示例

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


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


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