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


PHP show_page_menu函数代码示例

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


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

示例1: et_pb_fullwidth_menu

function et_pb_fullwidth_menu($atts, $content = null)
{
    extract(shortcode_atts(array('module_id' => '', 'module_class' => '', 'background_color' => '', 'background_layout' => 'light', 'text_orientation' => 'left', 'menu_id' => ''), $atts));
    $style = '';
    if ('' !== $background_color) {
        $style .= sprintf(' style="background-color: %s;"', esc_attr($background_color));
    }
    $class = " et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}";
    $menu = '<nav id="top-menu-nav">';
    $menuClass = 'nav';
    if ('on' == et_get_option('divi_disable_toptier')) {
        $menuClass .= ' et_disable_top_tier';
    }
    $primaryNav = '';
    $menu_args = array('theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false);
    if ('' !== $menu_id) {
        $menu_args['menu'] = (int) $menu_id;
    }
    $primaryNav = wp_nav_menu(apply_filters('et_fullwidth_menu_args', $menu_args));
    if ('' == $primaryNav) {
        $menu .= sprintf('<ul id="top-menu" class="%1$s">
				%2$s
			</ul>', esc_attr($menuClass), 'on' === et_get_option('divi_home_link') ? sprintf('<li%1$s><a href="%2$s">%3$s</a></li>', is_home() ? ' class="current_page_item"' : '', esc_url(home_url('/')), esc_html_e('Home', 'Divi')) : '');
        ob_start();
        show_page_menu($menuClass, false, false);
        show_categories_menu($menuClass, false);
        $menu .= ob_get_contents();
        ob_end_clean();
    } else {
        $menu .= $primaryNav;
    }
    $menu .= '</nav>';
    $output = sprintf('<div%4$s class="et_pb_fullwidth_menu%3$s%5$s"%2$s>
			<div class="et_pb_row clearfix">
				%1$s
				<div id="et_mobile_nav_menu">
					<a href="#" class="mobile_nav closed">
						<span class="mobile_menu_bar"></span>
					</a>
				</div>
			</div>
		</div>', $menu, $style, esc_attr($class), '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
    return $output;
}
开发者ID:ahmedghazi,项目名称:tpls,代码行数:44,代码来源:functions.php

示例2: esc_url

            echo 'class="current_page_item"';
        }
        ?>
><a href="<?php 
        echo esc_url(home_url('/'));
        ?>
"><?php 
        esc_html_e('Home', 'Harmony');
        ?>
</a></li>
						<?php 
    }
    ?>

						<?php 
    show_page_menu($menuClass, false, false);
    ?>
						<?php 
    show_categories_menu($menuClass, false);
    ?>
					</ul>
			<?php 
} else {
    echo $primaryNav;
}
?>
			</nav>

			<div id="social-icons">
			<?php 
$et_rss_url = '' != et_get_option('harmony_rss_url') ? et_get_option('harmony_rss_url') : get_bloginfo('comments_rss2_url');
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:header.php

示例3: wp_nav_menu

?>
			
			<div id="footer-bottom" class="clearfix<?php 
if (!is_home()) {
    echo ' nobg';
}
?>
">
				<?php 
$menuID = 'bottom-menu';
$footerNav = '';
if (function_exists('wp_nav_menu')) {
    $footerNav = wp_nav_menu(array('theme_location' => 'footer-menu', 'container' => '', 'fallback_cb' => '', 'menu_id' => $menuID, 'echo' => false, 'depth' => '1'));
}
if ($footerNav == '') {
    show_page_menu($menuID);
} else {
    echo $footerNav;
}
?>
				<p id="copyright"><?php 
esc_html_e('Designed by ', 'MyCuisine');
?>
 <a href="http://www.listentothewindmedia.com" title="For premium WordPress design work">Listen to the Wind Media</a> | <?php 
esc_html_e('Powered by ', 'MyCuisine');
?>
 <a href="http://www.wordpress.org">WordPress</a></p>
			</div> 	<!-- end #footer-bottom -->	
		</div> 	<!-- end .container -->	
	</div> <!-- end #footer -->
	
开发者ID:Bobcatou,项目名称:lakemillsyoga,代码行数:30,代码来源:footer.php

示例4: shortcode_callback

    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $background_color = $this->shortcode_atts['background_color'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $text_orientation = $this->shortcode_atts['text_orientation'];
        $menu_id = $this->shortcode_atts['menu_id'];
        $submenu_direction = $this->shortcode_atts['submenu_direction'];
        $fullwidth_menu = $this->shortcode_atts['fullwidth_menu'] === 'on' ? ' et_pb_fullwidth_menu_fullwidth' : '';
        $active_link_color = $this->shortcode_atts['active_link_color'];
        $dropdown_menu_bg_color = $this->shortcode_atts['dropdown_menu_bg_color'];
        $dropdown_menu_line_color = $this->shortcode_atts['dropdown_menu_line_color'];
        $dropdown_menu_text_color = $this->shortcode_atts['dropdown_menu_text_color'];
        $dropdown_menu_animation = $this->shortcode_atts['dropdown_menu_animation'];
        $mobile_menu_bg_color = $this->shortcode_atts['mobile_menu_bg_color'];
        $mobile_menu_text_color = $this->shortcode_atts['mobile_menu_text_color'];
        if (is_rtl() && 'left' === $text_orientation) {
            $text_orientation = 'right';
        }
        $style = '';
        if ('' !== $background_color) {
            $style .= sprintf(' style="background-color: %s;"', esc_attr($background_color));
        }
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation} et_dropdown_animation_{$dropdown_menu_animation}{$fullwidth_menu}";
        $menu = '<nav class="fullwidth-menu-nav">';
        $menuClass = 'fullwidth-menu nav';
        if (!et_is_builder_plugin_active() && 'on' == et_get_option('divi_disable_toptier')) {
            $menuClass .= ' et_disable_top_tier';
        }
        $menuClass .= '' !== $submenu_direction ? sprintf(' %s', esc_attr($submenu_direction)) : '';
        $primaryNav = '';
        $menu_args = array('theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => '', 'echo' => false);
        if ('' !== $menu_id) {
            $menu_args['menu'] = (int) $menu_id;
        }
        $primaryNav = wp_nav_menu(apply_filters('et_fullwidth_menu_args', $menu_args));
        if ('' == $primaryNav) {
            $menu .= sprintf('<ul class="%1$s">
					%2$s
				</ul>', esc_attr($menuClass), !et_is_builder_plugin_active() && 'on' === et_get_option('divi_home_link') ? sprintf('<li%1$s><a href="%2$s">%3$s</a></li>', is_home() ? ' class="current_page_item"' : '', esc_url(home_url('/')), esc_html_e('Home', 'et_builder')) : '');
            ob_start();
            // @todo: check if Fullwidth Menu module works fine with no menu selected in settings
            if (et_is_builder_plugin_active()) {
                wp_page_menu();
            } else {
                show_page_menu($menuClass, false, false);
                show_categories_menu($menuClass, false);
            }
            $menu .= ob_get_contents();
            ob_end_clean();
        } else {
            $menu .= $primaryNav;
        }
        $menu .= '</nav>';
        if ('' !== $active_link_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu ul li a:active', 'declaration' => sprintf('color: %1$s !important;', esc_html($active_link_color))));
        }
        if ('' !== $dropdown_menu_bg_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul', 'declaration' => sprintf('background-color: %1$s !important;', esc_html($dropdown_menu_bg_color))));
        }
        if ('' !== $dropdown_menu_line_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul', 'declaration' => sprintf('border-color: %1$s;', esc_html($dropdown_menu_line_color))));
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu', 'declaration' => sprintf('border-color: %1$s;', esc_html($dropdown_menu_line_color))));
        }
        if ('' !== $dropdown_menu_text_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul a', 'declaration' => sprintf('color: %1$s !important;', esc_html($dropdown_menu_text_color))));
        }
        if ('' !== $mobile_menu_bg_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu, %%order_class%%.et_pb_fullwidth_menu .et_mobile_menu ul', 'declaration' => sprintf('background-color: %1$s !important;', esc_html($mobile_menu_bg_color))));
        }
        if ('' !== $mobile_menu_text_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu a', 'declaration' => sprintf('color: %1$s !important;', esc_html($mobile_menu_text_color))));
        }
        $output = sprintf('<div%4$s class="et_pb_fullwidth_menu%3$s%5$s"%2$s%6$s>
				<div class="et_pb_row clearfix">
					%1$s
					<div class="et_mobile_nav_menu">
						<a href="#" class="mobile_nav closed">
							<span class="mobile_menu_bar"></span>
						</a>
					</div>
				</div>
			</div>', $menu, $style, esc_attr($class), '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', '' !== $style ? sprintf(' data-bg_color=%1$s', esc_attr($background_color)) : '');
        return $output;
    }
开发者ID:acchs,项目名称:test,代码行数:87,代码来源:main-modules.php

示例5: get_fullwidth_menu

    /**
     * Get fullwidth menu markup for fullwidth menu module
     *
     * @return string of fullwidth menu markup
     */
    static function get_fullwidth_menu($args = array())
    {
        $defaults = array('submenu_direction' => '', 'menu_id' => '');
        // modify the menu item to include the required data
        add_filter('wp_setup_nav_menu_item', array('ET_Builder_Module_Fullwidth_Menu', 'modify_fullwidth_menu_item'));
        $args = wp_parse_args($args, $defaults);
        $menu = '<nav class="fullwidth-menu-nav">';
        $menuClass = 'fullwidth-menu nav';
        if (!et_is_builder_plugin_active() && 'on' == et_get_option('divi_disable_toptier')) {
            $menuClass .= ' et_disable_top_tier';
        }
        $menuClass .= '' !== $args['submenu_direction'] ? sprintf(' %s', esc_attr($args['submenu_direction'])) : '';
        $primaryNav = '';
        $menu_args = array('theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => '', 'echo' => false);
        if ('' !== $args['menu_id']) {
            $menu_args['menu'] = (int) $args['menu_id'];
        }
        $primaryNav = wp_nav_menu(apply_filters('et_fullwidth_menu_args', $menu_args));
        if ('' == $primaryNav) {
            $menu .= sprintf('<ul class="%1$s">
					%2$s', esc_attr($menuClass), !et_is_builder_plugin_active() && 'on' === et_get_option('divi_home_link') ? sprintf('<li%1$s><a href="%2$s">%3$s</a></li>', is_home() ? ' class="current_page_item"' : '', esc_url(home_url('/')), esc_html__('Home', 'et_builder')) : '');
            ob_start();
            // @todo: check if Fullwidth Menu module works fine with no menu selected in settings
            if (et_is_builder_plugin_active()) {
                wp_page_menu();
            } else {
                show_page_menu($menuClass, false, false);
                show_categories_menu($menuClass, false);
            }
            $menu .= ob_get_contents();
            $menu .= '</ul>';
            ob_end_clean();
        } else {
            $menu .= $primaryNav;
        }
        $menu .= '</nav>';
        remove_filter('wp_setup_nav_menu_item', array('ET_Builder_Module_Fullwidth_Menu', 'modify_fullwidth_menu_item'));
        return $menu;
    }
开发者ID:pacificano,项目名称:pacificano,代码行数:44,代码来源:main-modules.php

示例6: nxt_nav_menu

if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer')) {
    ?>
						<?php 
}
?>
					</div> <!-- end #footer-widgets -->	
					
					<div id="footer-bottom" class="clearfix">	
						<?php 
$menuClass = 'bottom-nav';
$footerNav = '';
if (function_exists('nxt_nav_menu')) {
    $footerNav = nxt_nav_menu(array('theme_location' => 'footer-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'echo' => false, 'depth' => '1'));
}
if ($footerNav == '') {
    show_page_menu($menuClass);
} else {
    echo $footerNav;
}
?>
												
						<p id="copyright"><?php 
esc_html_e('Designed by', 'Modest');
?>
 <a href="http://www.elegantthemes.com">Elegant NXTClass Themes</a> | <?php 
esc_html_e('Powered by', 'Modest');
?>
 <a href="http://www.opensource.nxtclass.tk">NXTClass</a></p>
					</div> <!-- end #footer-bottom -->
				</div> <!-- end .container -->	
			</div> <!-- end #footer-top -->	
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:31,代码来源:footer.php

示例7: get_sidebar

	<?php 
get_sidebar('footer');
?>

	<div id="footer-bottom">
		<div class="container clearfix">
			<?php 
$menu_class = 'bottom-nav';
$footerNav = '';
if (function_exists('wp_nav_menu')) {
    $footerNav = wp_nav_menu(array('theme_location' => 'footer-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menu_class, 'echo' => false, 'depth' => '1'));
}
if ('' == $footerNav) {
    show_page_menu($menu_class);
} else {
    echo $footerNav;
}
?>

			<p id="copyright"><?php 
printf(__('Designed by %1$s | Powered by %2$s', 'Fusion'), '<a href="http://www.elegantthemes.com" title="Premium WordPress Themes">Elegant Themes</a>', '<a href="http://www.wordpress.org">WordPress</a>');
?>
</p>
		</div> <!-- end .container -->
	</div> <!-- end #footer-bottom -->

	<?php 
wp_footer();
?>
</body>
</html>
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:footer.php


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