本文整理汇总了PHP中genesis_structural_wrap函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_structural_wrap函数的具体用法?PHP genesis_structural_wrap怎么用?PHP genesis_structural_wrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了genesis_structural_wrap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jumbotron_widget_area_callback
function jumbotron_widget_area_callback()
{
if (is_active_sidebar('jumbotron-widget-area')) {
?>
<header <?php
echo genesis_attr('jumbotron-header');
?>
>
<?php
genesis_structural_wrap('jumbotron-outer');
?>
<div class="jumbotron">
<?php
genesis_structural_wrap('jumbotron-inner');
?>
<?php
dynamic_sidebar('jumbotron-widget-area');
?>
<?php
genesis_structural_wrap('jumbotron-inner', 'close');
?>
</div>
<?php
genesis_structural_wrap('jumbotron-outer', close);
?>
</header>
<?php
}
}
示例2: uci_footer_widget_areas
/**
* Pulled from genesis/lib/structure/footer.php with one minor change to always display footer widgets.
*
* Echo the markup necessary to facilitate the footer widget areas.
*
* Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
*
* The child theme must style the widget areas.
*
* Applies the `genesis_footer_widget_areas` filter.
*
* @since 1.6.0
*
* @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
*
* @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
*/
function uci_footer_widget_areas()
{
$footer_widgets = get_theme_support('genesis-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
// Commented out to always display widget areas, even if footer-1 is empty.
//* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
//if ( ! is_active_sidebar( 'footer-1' ) )
// return;
$inside = '';
$output = '';
$counter = 1;
while ($counter <= $footer_widgets) {
//* Darn you, WordPress! Gotta output buffer.
ob_start();
dynamic_sidebar('footer-' . $counter);
$widgets = ob_get_clean();
$inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
$counter++;
}
if ($inside) {
$output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets'));
$output .= genesis_structural_wrap('footer-widgets', 'open', 0);
$output .= $inside;
$output .= genesis_structural_wrap('footer-widgets', 'close', 0);
$output .= '</div>';
}
echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
示例3: gmdl_footer_widget_areas
/**
* Echo the markup necessary to facilitate the footer widget areas.
*
* Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
*
* The child theme must style the widget areas.
*
* Applies the `genesis_footer_widget_areas` filter.
*
* @since 1.6.0
*
* @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
*
* @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
*/
function gmdl_footer_widget_areas()
{
$footer_widgets = get_theme_support('genesis-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
$footer_widget_large_class = 12 / $footer_widgets;
//* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
if (!is_active_sidebar('footer-1')) {
return;
}
$inside = '';
$output = '';
$counter = 1;
while ($counter <= $footer_widgets) {
//* Darn you, WordPress! Gotta output buffer.
ob_start();
dynamic_sidebar('footer-' . $counter);
$widgets = ob_get_clean();
$inside .= sprintf('<div class="mdl-cell mdl-cell--4-col-tablet mdl-cell-%d-col footer-widgets-%d widget-area">%s</div>', $footer_widget_large_class, $counter, $widgets);
$counter++;
}
if ($inside) {
$output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets mdl-mega-footer">', 'context' => 'footer-widgets'));
$output .= genesis_structural_wrap('footer-widgets', 'open', 0);
$output .= $inside;
$output .= genesis_structural_wrap('footer-widgets', 'close', 0);
$output .= '</div>';
}
echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
示例4: desertvista_home_loop_helper
/**
* Display widget content for homepage sections.
*
*/
function desertvista_home_loop_helper()
{
if (is_active_sidebar('properties')) {
echo '<div class="properties">';
dynamic_sidebar('properties');
echo '</div><!-- end .properties -->';
}
if (is_active_sidebar('welcome')) {
echo '<div class="welcome">';
genesis_structural_wrap('welcome');
dynamic_sidebar('welcome');
genesis_structural_wrap('welcome', 'close');
echo '</div><!-- end .welcome -->';
}
if (is_active_sidebar('communities')) {
echo '<div class="communities">';
echo '<h4>' . __('Communities', 'desertvista') . '</h4>';
dynamic_sidebar('communities');
echo '</div><!-- end .communities -->';
}
if (is_active_sidebar('featured-bottom-left') || is_active_sidebar('featured-bottom-right')) {
echo '<div class="featured-bottom">';
echo '<div class="featured-bottom-left">';
dynamic_sidebar('featured-bottom-left');
echo '</div><!-- end .featured-bottom-left -->';
echo '<div class="featured-bottom-right">';
dynamic_sidebar('featured-bottom-right');
echo '</div><!-- end .featured-bottom-right -->';
echo '</div><!-- end .featured-bottom -->';
}
}
示例5: 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 -->';
}
示例6: zp_get_portfolio_sidebar
function zp_get_portfolio_sidebar()
{
global $post;
// retrieve post meta values
$button_label = get_post_meta($post->ID, 'button_label', true);
$button_link = get_post_meta($post->ID, 'button_link', true);
$date_label = get_post_meta($post->ID, 'date_label', true);
$date_value = get_post_meta($post->ID, 'date_value', true);
$client_label = get_post_meta($post->ID, 'client_label', true);
$client_value = get_post_meta($post->ID, 'client_value', true);
$category_label = get_post_meta($post->ID, 'category_label', true);
$video_link = get_post_meta($post->ID, 'video_link', true);
$output = '';
if (have_posts()) {
while (have_posts()) {
the_post();
$output .= '<div class="col-md-12 single_portfolio_sidebar">';
if ($button_link) {
$output .= '<div class="single_portfolio_section single_portfolio_button col-m-12"><a class="btn btn-hg btn-primary " href="' . $button_link . '">' . $button_label . '</a></div>';
}
$output .= '<div class="single_portfolio_section single_portfolio_content col-m-12">' . get_the_content() . '</div>';
if ($date_value || $client_value || $category_label) {
$output .= '<div class="single_portfolio_section single_portfolio_meta col-m-12">';
if ($date_value) {
$output .= '<div class="meta_value date_meta"><span class="meta_label">' . $date_label . '</span>' . $date_value . '</div>';
}
if ($client_value) {
$output .= '<div class="meta_value client_meta"><span class="meta_label">' . $client_label . '</span>' . $client_value . '</div>';
}
// retrieve portfolio category
if ($category_label) {
$output .= '<div class="meta_value category_meta"><span class="meta_label">' . $category_label . '</span>';
$categories = wp_get_post_terms($post->ID, 'portfolio_category');
foreach ($categories as $category) {
$output .= $category->name . ' ';
}
$output .= '</div>';
}
$output .= '</div>';
}
$output .= '<div class="single_portfolio_section single_portfolio_nav col-m-12">';
$prev_post = get_previous_post();
if (!empty($prev_post)) {
$output .= '<div class="single_nav_prev"><a href="' . get_permalink($prev_post->ID) . '" class="btn btn-sm btn-primary">' . __('previous', 'start') . '</a></div>';
}
$next_post = get_next_post();
if (!empty($next_post)) {
$output .= '<div class="single_nav_next inline"><a href="' . get_permalink($next_post->ID) . '" class="btn btn-sm btn-primary">' . __('next', 'start') . '</a></div>';
}
$output .= '</div>';
$output .= '</div>';
}
}
genesis_structural_wrap('sidebar');
do_action('genesis_before_sidebar_widget_area');
echo $output;
do_action('genesis_after_sidebar_widget_area');
genesis_structural_wrap('sidebar', 'close');
}
示例7: bfg_do_home_featured
function bfg_do_home_featured()
{
genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="home-featured">', 'context' => 'home-featured'));
genesis_structural_wrap('home-featured');
genesis_widget_area('home-featured', array('before' => '', 'after' => ''));
genesis_structural_wrap('home-featured', 'close');
echo '</div>';
}
示例8: agentpress_disclaimer
/**
* Add disclaimer widget area on Genesis after hook
*
*/
function agentpress_disclaimer()
{
if (is_active_sidebar('disclaimer')) {
echo '<div class="disclaimer">';
genesis_structural_wrap('disclaimer');
dynamic_sidebar('disclaimer');
genesis_structural_wrap('disclaimer', 'close');
echo '</div><!-- end .disclaimer -->';
}
}
示例9: utility_pro_add_home_gallery
/**
* Display content for the "Home Gallery" section.
*
* @since 1.0.0
*/
function utility_pro_add_home_gallery()
{
printf('<div %s>', genesis_attr('home-gallery'));
genesis_structural_wrap('home-gallery');
genesis_widget_area('utility-home-gallery-1', array('before' => '<div class="home-gallery-1 widget-area">', 'after' => '</div>'));
genesis_widget_area('utility-home-gallery-2', array('before' => '<div class="home-gallery-2 widget-area">', 'after' => '</div>'));
genesis_widget_area('utility-home-gallery-3', array('before' => '<div class="home-gallery-3 widget-area">', 'after' => '</div>'));
genesis_widget_area('utility-home-gallery-4', array('before' => '<div class="home-gallery-4 widget-area">', 'after' => '</div>'));
genesis_structural_wrap('home-gallery', 'close');
echo '</div>';
}
示例10: minimum_home_featured
function minimum_home_featured()
{
printf('<div %s>', genesis_attr('home-featured'));
genesis_structural_wrap('home-featured');
genesis_widget_area('home-featured-1', array('before' => '<div class="home-featured-1 widget-area">', 'after' => '</div>'));
genesis_widget_area('home-featured-2', array('before' => '<div class="home-featured-2 widget-area">', 'after' => '</div>'));
genesis_widget_area('home-featured-3', array('before' => '<div class="home-featured-3 widget-area">', 'after' => '</div>'));
genesis_widget_area('home-featured-4', array('before' => '<div class="home-featured-4 widget-area">', 'after' => '</div>'));
genesis_structural_wrap('home-featured', 'close');
echo '</div>';
//* end .home-featured
}
示例11: menu_in_footer
function menu_in_footer()
{
$class = 'menu-footer';
$args = array('menu' => 'Footer', 'container' => '', 'menu_class' => $class, 'echo' => 0, 'depth' => 1);
$nav = wp_nav_menu($args);
$nav_markup_open = genesis_markup(array('html5' => '<nav %s>', 'xhtml' => '<div id="nav">', 'context' => 'nav-footer', 'echo' => false));
$nav_markup_open .= genesis_structural_wrap('menu-footer', 'open', 0);
$nav_markup_close = genesis_structural_wrap('menu-footer', 'close', 0);
$nav_markup_close .= genesis_html5() ? '</nav>' : '</div>';
$nav_output = $nav_markup_open . $nav . $nav_markup_close;
echo $nav_output;
}
示例12: bfg_footer_widget_areas
function bfg_footer_widget_areas()
{
$footer_widgets = get_theme_support('genesis-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
//* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
if (!is_active_sidebar('footer-1')) {
return;
}
switch ($footer_widgets) {
case '1':
default:
$class = 'col-sm-12';
break;
case '2':
$class = 'col-sm-6';
break;
case '3':
$class = 'col-sm-4';
break;
case '4':
$class = 'col-sm-3';
break;
case '6':
$class = 'col-sm-2';
break;
case '12':
$class = 'col-sm-1';
break;
}
$inside = '';
$output = '';
$counter = 1;
while ($counter <= $footer_widgets) {
//* Darn you, WordPress! Gotta output buffer.
ob_start();
dynamic_sidebar('footer-' . $counter);
$widgets = ob_get_clean();
$inside .= sprintf('<div class="footer-widgets-%d %s widget-area">%s</div>', $counter, $class, $widgets);
$counter++;
}
if ($inside) {
$output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets'));
$output .= genesis_structural_wrap('footer-widgets', 'open', 0);
$output .= $inside;
$output .= genesis_structural_wrap('footer-widgets', 'close', 0);
$output .= '</div>';
}
echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
示例13: gb_genesis_get_nav_menu
/**
* Return the markup to display a menu consistent with the Genesis format.
*
* Applies the `genesis_$location_nav` filter e.g. `genesis_header_nav`. For primary and secondary menu locations, it
* also applies the `genesis_do_nav` and `genesis_do_subnav` filters for backwards compatibility.
*
* Makes Genesis Structural Wrap optional for better Bootstrap 3 compatibility
*
* @since 2.1.0
*
* @uses genesis_markup() Contextual markup.
* @uses genesis_html5() Check for HTML5 support.
* @uses genesis_structural_wrap() Adds optional internal wrap divs.
*
* @param string $args Menu arguments.
*
* @return string Navigation menu markup.
*/
function gb_genesis_get_nav_menu($args = array(), $structural_wrap = false)
{
$args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'echo' => 0));
//* If a menu is not assigned to theme location, abort
if (!has_nav_menu($args['theme_location'])) {
return;
}
$sanitized_location = sanitize_key($args['theme_location']);
$nav = wp_nav_menu($args);
//* Do nothing if there is nothing to show
if (!$nav) {
return;
}
$xhtml_id = $args['theme_location'];
if ('primary' === $args['theme_location']) {
$xhtml_id = 'nav';
} elseif ('secondary' === $args['theme_location']) {
$xhtml_id = 'subnav';
}
$nav_markup_open = genesis_markup(array('html5' => '<nav %s>', 'xhtml' => '<div id="' . $xhtml_id . '">', 'context' => 'nav-' . $sanitized_location, 'echo' => false));
$nav_markup_close = '';
if ($structural_wrap) {
$nav_markup_open .= genesis_structural_wrap('menu-' . $sanitized_location, 'open', 0);
$nav_markup_close .= genesis_structural_wrap('menu-' . $sanitized_location, 'close', 0);
}
$nav_markup_close .= genesis_html5() ? '</nav>' : '</div>';
$nav_output = $nav_markup_open . $nav . $nav_markup_close;
$filter_location = 'genesis_' . $sanitized_location . '_nav';
//* Handle back-compat for primary and secondary nav filters.
if ('primary' === $args['theme_location']) {
$filter_location = 'genesis_do_nav';
} elseif ('secondary' === $args['theme_location']) {
$filter_location = 'genesis_do_subnav';
}
/**
* Filter the navigation markup.
*
* @since 2.1.0
*
* @param string $nav_output Opening container markup, nav, closing container markup.
* @param string $nav Navigation list (`<ul>`).
* @param array $args {
* Arguments for `wp_nav_menu()`.
*
* @type string $theme_location Menu location ID.
* @type string $container Container markup.
* @type string $menu_class Class(es) applied to the `<ul>`.
* @type bool $echo 0 to indicate `wp_nav_menu()` should return not echo.
* }
*/
return apply_filters($filter_location, $nav_output, $nav, $args);
}
示例14: minimum_site_tagline
function minimum_site_tagline()
{
printf('<div %s>', genesis_attr('site-tagline'));
genesis_structural_wrap('site-tagline');
printf('<div %s>', genesis_attr('site-tagline-left'));
printf('<p %s>%s</p>', genesis_attr('site-description'), esc_html(get_bloginfo('description')));
echo '</div>';
printf('<div %s>', genesis_attr('site-tagline-right'));
genesis_widget_area('site-tagline-right');
echo '</div>';
genesis_structural_wrap('site-tagline', 'close');
echo '</div>';
}
示例15: genesis_do_subnav
/**
* This function is responsible for displaying the "Secondary Navigation" bar.
*
* @uses genesis_nav(), genesis_get_option(), wp_nav_menu
* @since 1.0.1
*
*/
function genesis_do_subnav()
{
if (genesis_get_option('subnav')) {
if (has_nav_menu('secondary')) {
$args = array('theme_location' => 'secondary', 'container' => '', 'menu_class' => genesis_get_option('subnav_superfish') ? 'nav superfish' : 'nav', 'echo' => 0);
$subnav = wp_nav_menu($args);
} elseif ('nav-menu' != genesis_get_option('subnav_type', 'genesis-vestige')) {
$args = array('theme_location' => 'secondary', 'menu_class' => genesis_get_option('subnav_superfish', 'genesis-vestige') ? 'nav superfish' : 'nav', 'show_home' => genesis_get_option('subnav_home', 'genesis-vestige'), 'type' => genesis_get_option('subnav_type', 'genesis-vestige'), 'sort_column' => genesis_get_option('subnav_pages_sort', 'genesis-vestige'), 'orderby' => genesis_get_option('subnav_categories_sort', 'genesis-vestige'), 'depth' => genesis_get_option('subnav_depth', 'genesis-vestige'), 'exclude' => genesis_get_option('subnav_exclude', 'genesis-vestige'), 'include' => genesis_get_option('subnav_include', 'genesis-vestige'), 'echo' => false);
$subnav = genesis_nav($args);
}
$subnav_output = sprintf('<div id="subnav">%2$s%1$s%3$s</div>', $subnav, genesis_structural_wrap('subnav', '<div class="wrap">', 0), genesis_structural_wrap('subnav', '</div><!-- end .wrap -->', 0));
echo apply_filters('genesis_do_subnav', $subnav_output, $subnav, $args);
}
}