本文整理汇总了PHP中has_nav_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP has_nav_menu函数的具体用法?PHP has_nav_menu怎么用?PHP has_nav_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了has_nav_menu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: utility_pro_skip_links
/**
* Add skiplinks for screen readers and keyboard navigation
*
* @since 1.0.0
*/
function utility_pro_skip_links()
{
// Call function to add IDs to the markup
utility_skiplinks_markup();
// write HTML, skiplinks in a list with a heading
echo '<h2 class="screen-reader-text">' . __('Skip links', 'utility-pro') . '</h2>' . "\n";
echo '<ul class="wpacc-genesis-skip-link">' . "\n";
if (has_nav_menu('primary')) {
echo ' <li><a href="#genwpacc-genesis-nav-primary" class="screen-reader-shortcut">' . __('Skip to primary navigation', 'utility-pro') . '</a></li>' . "\n";
}
echo ' <li><a href="#genwpacc-genesis-content" class="screen-reader-shortcut">' . __('Skip to content', 'utility-pro') . '</a></li>' . "\n";
if ('sidebar-content' === genesis_site_layout() || 'content-sidebar' === genesis_site_layout()) {
echo ' <li><a href="#genwpacc-sidebar-primary" class="screen-reader-shortcut">' . __('Skip to primary sidebar', 'utility-pro') . '</a></li>' . "\n";
}
if (1 == current_theme_supports('genesis-footer-widgets')) {
$footer_widgets = get_theme_support('genesis-footer-widgets');
}
if (isset($footer_widgets[0]) && is_numeric($footer_widgets[0])) {
echo ' <li><a href="#genwpacc-genesis-footer-widgets" class="screen-reader-shortcut">' . __('Skip to footer widgets', 'utility-pro') . '</a></li>' . "\n";
}
if (has_nav_menu('footer')) {
echo ' <li><a href="#genwpacc-genesis-nav-footer" class="screen-reader-shortcut">' . __('Skip to footer navigation', 'utility-pro') . '</a></li>' . "\n";
}
echo '</ul>' . "\n";
}
示例2: supernova_footer_navigation
function supernova_footer_navigation()
{
echo '<span class="copyright">' . supernova_footer_text() . '</span>';
if (has_nav_menu('Footer_Nav')) {
wp_nav_menu(array('theme_location' => 'Footer_Nav', 'menu' => 'Footer Navigation', 'menu_class' => 'footer_nav'));
}
}
示例3: ck_menu_button
function ck_menu_button()
{
//* Make sure mobile-menu is active
if (has_nav_menu("mobile-menu")) {
echo '<a alt="Toggle Menu" href="#" class="menu-btn right small">' . '<span class="dashicons dashicons-menu"></span></a>';
}
}
开发者ID:timothyjensen,项目名称:Off-Canvas-Navigation-in-Genesis,代码行数:7,代码来源:genesis-off-canvas-mobile-menu.php
示例4: dt_menu
function dt_menu($data = array())
{
$defaults = array('menu_wraper' => '<ul id="%MENU_ID%">%MENU_ITEMS%</ul>', 'menu_items' => '<li class="testingg %ITEM_CLASS%"><a href="%ITEM_HREF%" title="%ESC_ITEM_TITLE%">%ITEM_TITLE%</a>%SUBMENU%</li>', 'submenu' => '<div style="visibility: hidden; display: block;"><ul>%ITEM%</ul><i></i></div>', 'parent_clicable' => true, 'params' => array('act_class' => 'act'), 'force_fallback' => false, 'fallback_cb' => 'dt_page_menu', 'echo' => true, 'location' => 'primary');
$options = wp_parse_args($data, $defaults);
$options['menu_wraper'] = str_replace(array('%MENU_ID%', '%MENU_CLASS%', '%MENU_ITEMS%'), array('%1$s', '%2$s', '%3$s'), $options['menu_wraper']);
$options['menu_items'] = explode('%SUBMENU%', $options['menu_items']);
$options['submenu'] = explode('%ITEM%', $options['submenu']);
$options = apply_filters('dt_menu_options', $options);
$theme_location = $options['location'];
$parent_clicable = apply_filters('dt_menu-parent_clicable', $options['parent_clicable']);
$args = array('container' => false, 'menu_id' => 'mainmenu', 'fallback_cb' => $options['fallback_cb'], 'theme_location' => $theme_location, 'parent_clicable' => $parent_clicable, 'menu_class' => false, 'container_class' => false, 'dt_has_nav_menu' => has_nav_menu($theme_location), 'dt_item_wrap_start' => $options['menu_items'][0], 'dt_item_wrap_end' => $options['menu_items'][1], 'dt_submenu_wrap_start' => $options['submenu'][0], 'dt_submenu_wrap_end' => $options['submenu'][1], 'items_wrap' => $options['menu_wraper'], 'please_be_fat' => true);
$args = array_merge($args, $options['params']);
if ($options['force_fallback']) {
$output = dt_page_menu($args);
if (!isset($options['params'], $options['params']['echo']) || $options['params']['echo']) {
echo $output;
}
return $output;
}
if ($args['dt_has_nav_menu']) {
$walker_args = array('theme_location' => $theme_location, 'parent_clicable' => $parent_clicable);
$args['walker'] = new Dt_Walker_Nav_Menu($walker_args);
}
return wp_nav_menu($args);
}
示例5: motif_infinite_scroll_has_footer_widgets
/**
* Filter the 'infinite_scroll_has_footer_widgets' value.
* If the navigation menu in the footer is used or if the footer sidebar contains any widgets, the scroll will be changed to 'click' from 'scroll'.
*/
function motif_infinite_scroll_has_footer_widgets($has_widgets)
{
if (has_nav_menu('secondary') || is_active_sidebar('sidebar-2') || is_active_sidebar('sidebar-3') || is_active_sidebar('sidebar-4')) {
$has_widgets = true;
}
return $has_widgets;
}
示例6: vc_menu_func
function vc_menu_func($atts, $content)
{
ob_start();
?>
<nav class="navbar navbar-default" id="menunav">
<div class="container">
<div class="row">
<ul class="nav navbar-nav pull-right margin-right-15">
<li class="dropdown resv-dropdown" id="ibe-dropdown">
<a class="resv-link dropdown-toggle" href="#back-to-reserve" id="ibe-dropdown-button"><?php
echo esc_html(get_theme_mod('booking_button_text', esc_attr__('Reservations', 'Property Theme')));
?>
</a>
</li>
</ul>
<?php
if (has_nav_menu('primary_navigation')) {
wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav navbar-right']);
}
?>
</div>
</div>
</nav>
<?php
$returnvariable = ob_get_clean();
return $returnvariable;
}
示例7: atp_secondary_menu
function atp_secondary_menu()
{
if (has_nav_menu('secondary-menu')) {
wp_nav_menu(array('container' => false, 'theme_location' => 'secondary-menu', 'menu_class' => 'sf-menu', 'echo' => true, 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 0, 'walker' => new description_walker()));
} else {
}
}
示例8: listable_body_classes
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
*
* @return array
*/
function listable_body_classes($classes)
{
// Adds a class of group-blog to blogs with more than 1 published author.
if (is_multi_author()) {
$classes[] = 'group-blog';
}
global $post;
if (has_nav_menu('secondary')) {
$classes[] = 'has--secondary-menu';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'jobs') || is_search() || is_tax(array('job_listing_category', 'job_listing_tag', 'job_listing_region'))) {
$classes[] = 'page-listings';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'job_dashboard')) {
$classes[] = 'page-job-dashboard';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'my_bookmarks')) {
$classes[] = 'page-my-bookmarks';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'woocommerce_my_account')) {
$classes[] = 'page-login';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'submit_job_form')) {
$classes[] = 'page-add-listing';
}
if (listable_using_facetwp()) {
$classes[] = 'is--using-facetwp';
}
if (isset($post->post_content) && has_shortcode($post->post_content, 'jobs_by_tag')) {
$classes[] = 'jobs-by-tags-page';
}
return $classes;
}
示例9: cm_menu_button
function cm_menu_button()
{
//* Only add the Menu button if a primary navigation is set. You can switch this for whatever menu you are dealing with
if (has_nav_menu("primary")) {
echo '<a alt="Toggle Menu" href="#" class="menu-btn right small">' . __('Menu', 'CHILD_THEME_TEXT_DOMAIN') . '<span class="dashicons dashicons-menu"></span></a>';
}
}
示例10: calibrefx_do_subnav
/**
* This function is for displaying the "Secondary Navigation" bar.
*/
function calibrefx_do_subnav()
{
global $calibrefx;
/** Do nothing if menu not supported */
if (!calibrefx_nav_menu_supported('secondary')) {
return;
}
$calibrefx->load->library('walker_nav_menu');
$subnav = '';
$args = '';
if (calibrefx_get_option('subnav')) {
if (has_nav_menu('secondary')) {
$args = array('theme_location' => 'secondary', 'container' => '', 'menu_class' => 'nav nav-pills menu-secondary menu superfish', 'echo' => 0, 'walker' => new CFX_Walker_Nav_menu());
$subnav = wp_nav_menu($args);
}
$subnav_output = sprintf('
<div id="subnav">
%2$s
%1$s
%3$s
</div>
<!-- end #subnav -->', $subnav, calibrefx_put_wrapper('subnav', 'open', false), calibrefx_put_wrapper('subnav', 'close', false));
echo apply_filters('calibrefx_do_subnav', $subnav_output, $subnav, $args);
}
}
示例11: get_category_navigation
function get_category_navigation()
{
if (has_nav_menu('category_menu')) {
?>
<div id="menu-category" class="menu-navigation navbar navbar-fixed-top">
<div class="navbar-inner ">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".category-nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse category-nav-collapse">
<?php
wp_nav_menu(array('container_class' => 'menu-header-container', 'theme_location' => 'category_menu', 'items_wrap' => '<ul id="%1$s" class="nav nav-menu %2$s">%3$s</ul>', 'fallback_cb' => 'standard_fallback_nav_menu', 'walker' => new Standard_Nav_Walker()));
?>
</div><!-- /.nav-collapse -->
<div id="social-networking" class="clearfix">
<?php
get_template_part('social-networking');
?>
</div><!-- /#social-networking -->
</div> <!-- /container -->
</div><!-- /navbar-inner -->
</div> <!-- /#menu-above-header -->
<?php
}
// end if
}
示例12: wsm_child_do_footer
function wsm_child_do_footer()
{
echo '<div class="footer-left">';
$contact = genesis_get_option('wsm_contact_info', 'patricia-settings');
if (!empty($contact)) {
echo '<p class="contact-info">' . genesis_get_option('wsm_contact_info', 'patricia-settings') . '</p>';
}
$credit = genesis_get_option('wsm_credit', 'patricia-settings');
if (!empty($contact)) {
echo '<p class="credit">' . genesis_get_option('wsm_credit', 'patricia-settings') . '</p>';
}
echo '</div><!-- end .footer-left -->';
echo '<div class="footer-right">';
if (has_nav_menu('footer')) {
$args = array('theme_location' => 'footer', 'container' => '', 'menu_class' => genesis_get_option('nav_superfish') ? 'nav genesis-nav-menu superfish' : 'nav genesis-nav-menu', 'echo' => 0);
$nav = wp_nav_menu($args);
}
$nav_output = sprintf('<div class="footer-nav">%2$s%1$s%3$s</div>', $nav, genesis_structural_wrap('nav', '<div class="menu-wrap">', 0), genesis_structural_wrap('nav', '</div><!-- end .wrap -->', 0));
echo apply_filters('wsm_do_footer_nav', $nav_output, $nav, $args);
$copyright = genesis_get_option('wsm_copyright', 'patricia-settings');
if (!empty($copyright)) {
echo '<p class="copy">' . genesis_get_option('wsm_copyright', 'patricia-settings') . '</p>';
}
echo '</div><!-- end .footer-right -->';
}
示例13: reactor_do_top_bar
/**
* Top bar
* in header.php
*
* @since 1.0.0
*/
function reactor_do_top_bar()
{
if (has_nav_menu('top-bar-l') || has_nav_menu('top-bar-r')) {
$topbar_args = array('title' => reactor_option('topbar_title', get_bloginfo('name')), 'title_url' => reactor_option('topbar_title_url', home_url()), 'fixed' => reactor_option('topbar_fixed', 0), 'contained' => reactor_option('topbar_contain', 1));
reactor_top_bar($topbar_args);
}
}
示例14: get_context
/**
* Custom implementation for get_context method.
*/
public function get_context()
{
global $content_width;
if (class_exists('Easy_Digital_Downloads')) {
global $edd_options;
}
$context = Timber::get_context();
$sidebar_primary = Timber::get_widgets('sidebar_primary');
$sidebar_footer = Timber::get_widgets('sidebar_footer');
$context['theme_mods'] = get_theme_mods();
$context['site_options'] = wp_load_alloptions();
$context['teaser_mode'] = apply_filters('maera/teaser/mode', 'excerpt');
$context['thumbnail']['width'] = apply_filters('maera/image/width', 600);
$context['thumbnail']['height'] = apply_filters('maera/image/height', 371);
$context['menu']['primary'] = has_nav_menu('primary_navigation') ? new TimberMenu('primary_navigation') : null;
$context['sidebar']['primary'] = apply_filters('maera/sidebar/primary', $sidebar_primary);
$context['sidebar']['footer'] = apply_filters('maera/sidebar/footer', $sidebar_footer);
$context['pagination'] = Timber::get_pagination();
$context['comment_form'] = TimberHelper::get_comment_form();
$context['comments_args'] = array('style' => 'ul', 'reply_text' => __('Reply', 'maera'), 'short_ping' => true, 'avatar_size' => 60);
$context['site_logo'] = get_option('site_logo', false);
$context['content_width'] = $content_width;
$context['sidebar_template'] = maera_templates_sidebar();
if (class_exists('Easy_Digital_Downloads')) {
$data['edd_options'] = $edd_options;
$data['download_categories'] = Timber::get_terms('download_category');
$data['download_tags'] = Timber::get_terms('download_tag');
$data['default_image'] = new TimberImage(get_template_directory_uri() . '/assets/images/default.png');
}
return apply_filters('maera/timber/context', $context);
}
示例15: presscore_ubermenu_body_class_filter
function presscore_ubermenu_body_class_filter($classes = array())
{
if (has_nav_menu('primary')) {
$classes[] = 'dt-style-um';
}
return $classes;
}