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


PHP genesis_markup函数代码示例

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


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

示例1: genesis_404

/**
 * This function outputs a 404 "Not Found" error message.
 *
 * @since 1.6
 */
function genesis_404()
{
    genesis_markup(array('open' => '<article class="entry">', 'context' => 'entry-404'));
    printf('<h1 class="entry-title">%s</h1>', apply_filters('genesis_404_entry_title', __('Not found, error 404', 'genesis')));
    echo '<div class="entry-content">';
    if (genesis_html5()) {
        echo apply_filters('genesis_404_entry_content', '<p>' . sprintf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it by using the search form below.', 'genesis'), trailingslashit(home_url())) . '</p>');
        get_search_form();
    } else {
        ?>

			<p><?php 
        printf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it with the information below.', 'genesis'), trailingslashit(home_url()));
        ?>
</p>



	<?php 
    }
    if (genesis_a11y('404-page')) {
        echo '<h2>' . __('Sitemap', 'genesis') . '</h2>';
        genesis_sitemap('h3');
    } else {
        genesis_sitemap('h4');
    }
    echo '</div>';
    genesis_markup(array('close' => '</article>', 'context' => 'entry-404'));
}
开发者ID:netmagik,项目名称:netmagik,代码行数:34,代码来源:404.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);
}
开发者ID:quantegy,项目名称:wp-genesis-child-theme,代码行数:48,代码来源:functions_footer_widget_always_display.php

示例3: scwd_home_feature

function scwd_home_feature()
{
    global $post, $SCWD_CUSTOM;
    genesis_markup(array('html5' => '<article id="home-feature" %s>', 'xhtml' => '<div id="home-feature">', 'context' => 'home-feature'));
    if (($home_slides = $SCWD_CUSTOM->acf_get_field('_scwd_slides')) !== false) {
        $i = 0;
        print '<div class="home-slides">';
        foreach ($home_slides as $value) {
            $att_data = '';
            if ($i === 0) {
                $attr_data = ' style="background-image:url(\'' . $value['sizes']['large'] . '\');"';
            } else {
                $attr_data = ' data-imgurl="' . $value['sizes']['large'] . '"';
            }
            print '<div class="slide"' . $attr_data . '></div>';
            $i++;
        }
        print '</div>';
    }
    print '<div class="wrap"><div class="inner">';
    print '<div class="left"></div><div class="right"><div class="pad">';
    //print the_title('<h1>','</h1>');
    print the_content();
    print '</div></div>';
    print '</div></div>';
    genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
}
开发者ID:scarydakis,项目名称:WPTest,代码行数:27,代码来源:home-page.php

示例4: mb_do_header

function mb_do_header()
{
    global $wp_registered_sidebars;
    genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="title-area" id="title-area">', 'context' => 'title-area'));
    if (get_theme_mod('logo', false)) {
        echo '<h1 class="site-title" itemprop="headline">';
        echo '<a href="' . get_bloginfo('url') . '" class="logo" title="' . get_bloginfo('name') . '">';
        echo '<img src="' . get_theme_mod('logo') . '" width="' . $width . '" height="' . $height . '" alt="' . get_bloginfo('name') . '"/>';
        echo '</a>';
        echo '</h1>';
    } else {
        do_action('genesis_site_title');
        do_action('genesis_site_description');
    }
    echo '</div>';
    if (isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right') || has_action('genesis_header_right')) {
        genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div class="widget-area header-widget-area">', 'context' => 'header-widget-area'));
        do_action('genesis_header_right');
        add_filter('wp_nav_menu_args', 'genesis_header_menu_args');
        add_filter('wp_nav_menu', 'genesis_header_menu_wrap');
        dynamic_sidebar('header-right');
        remove_filter('wp_nav_menu_args', 'genesis_header_menu_args');
        remove_filter('wp_nav_menu', 'genesis_header_menu_wrap');
        genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>'));
    }
}
开发者ID:WayneStratton,项目名称:Bootstrap-for-Genesis,代码行数:26,代码来源:header.php

示例5: 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);
}
开发者ID:kosovish,项目名称:genesis-material-design-lite-child-theme,代码行数:47,代码来源:footer.php

示例6: widget

 /**
  * Echo the widget content.
  *
  * @since 0.1.8
  *
  * @global WP_Query $wp_query Query object.
  * @global integer  $more
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     //* Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     if (!empty($instance['url'])) {
         $instance['url'] = do_shortcode($instance['url']);
     }
     if (!empty($instance['image_url'])) {
         $instance['image_url'] = do_shortcode($instance['image_url']);
     }
     if (!empty($instance['description'])) {
         $instance['description'] = do_shortcode($instance['description']);
     }
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'] . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $args['after_title'];
     }
     genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
     if (!empty($instance['url'])) {
         echo '<a href="' . $instance['url'] . '" title="' . $instance['title'] . '" class="' . esc_attr($instance['image_alignment']) . '">' . '<img src="' . $instance['image_url'] . '" class="entry-image" itemprop="image" />' . '</a>';
     }
     if (!empty($instance['description'])) {
         echo genesis_html5() ? '<div class="entry-content">' : '';
         echo esc_html($instance['description']);
         echo genesis_html5() ? '</div>' : '';
     }
     genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
     echo $args['after_widget'];
 }
开发者ID:unity3software,项目名称:unity3,代码行数:40,代码来源:plugin.php

示例7: gmdl_numeric_posts_nav

/**
 * Echo archive pagination in page numbers format.
 *
 * Applies the `genesis_prev_link_text` and `genesis_next_link_text` filters.
 *
 * The links, if needed, are ordered as:
 *
 *  * previous page arrow,
 *  * first page,
 *  * up to two pages before current page,
 *  * current page,
 *  * up to two pages after the current page,
 *  * last page,
 *  * next page arrow.
 *
 * @since 0.2.3
 *
 * @global WP_Query $wp_query Query object.
 *
 * @return null Return early if on a single post or page, or only one page present.
 */
function gmdl_numeric_posts_nav()
{
    if (is_singular()) {
        return;
    }
    global $wp_query;
    //* Stop execution if there's only 1 page
    if ($wp_query->max_num_pages <= 1) {
        return;
    }
    $paged = get_query_var('paged') ? absint(get_query_var('paged')) : 1;
    $max = intval($wp_query->max_num_pages);
    //* Add current page to the array
    if ($paged >= 1) {
        $links[] = $paged;
    }
    //* Add the pages around the current page to the array
    if ($paged >= 3) {
        $links[] = $paged - 1;
        $links[] = $paged - 2;
    }
    if ($paged + 2 <= $max) {
        $links[] = $paged + 2;
        $links[] = $paged + 1;
    }
    genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="navigation">', 'context' => 'archive-pagination'));
    echo '<ul class="mdl-cell mdl-cell--12-col pagination">';
    //* Previous Post Link
    if (get_previous_posts_link()) {
        printf('<li class="pagination-previous alignleft">%s</li>' . "\n", get_previous_posts_link(apply_filters('genesis_prev_link_text', '<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">arrow_back</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span>' . __('Previous Page', 'genesis'))));
    }
    //* Link to first page, plus ellipses if necessary
    if (!in_array(1, $links)) {
        $class = 1 == $paged ? ' class="current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1');
        if (!in_array(2, $links)) {
            echo '<li class="pagination-omission">&#x02026;</li>';
        }
    }
    //* Link to current page, plus 2 pages in either direction if necessary
    sort($links);
    foreach ((array) $links as $link) {
        $class = $paged == $link ? ' class="current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($link)), $link);
    }
    //* Link to last page, plus ellipses if necessary
    if (!in_array($max, $links)) {
        if (!in_array($max - 1, $links)) {
            echo '<li class="pagination-omission">&#x02026;</li>' . "\n";
        }
        $class = $paged == $max ? ' class="current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($max)), $max);
    }
    //* Next Post Link
    if (get_next_posts_link()) {
        printf('<li class="pagination-next alignright">%s</li>' . "\n", get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . '<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent  mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">arrow_forward</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span>')));
    }
    echo '</ul></div>' . "\n";
}
开发者ID:kosovish,项目名称:genesis-material-design-lite-child-theme,代码行数:80,代码来源:pagination.php

示例8: ygf_numeric_posts_nav

/**
 * Echo archive pagination in page numbers format.
 *
 * Applies the `genesis_prev_link_text` and `genesis_next_link_text` filters.
 *
 * The links, if needed, are ordered as:
 *
 *  * previous page arrow,
 *  * first page,
 *  * up to two pages before current page,
 *  * current page,
 *  * up to two pages after the current page,
 *  * last page,
 *  * next page arrow.
 *
 * @since 0.2.3
 *
 * @global WP_Query $wp_query Query object.
 *
 * @return null Return early if on a single post or page, or only one page present.
 */
function ygf_numeric_posts_nav()
{
    if (is_singular()) {
        return;
    }
    global $wp_query;
    //* Stop execution if there's only 1 page
    if ($wp_query->max_num_pages <= 1) {
        return;
    }
    $paged = get_query_var('paged') ? absint(get_query_var('paged')) : 1;
    $max = intval($wp_query->max_num_pages);
    //* Add current page to the array
    if ($paged >= 1) {
        $links[] = $paged;
    }
    //* Add the pages around the current page to the array
    if ($paged >= 3) {
        $links[] = $paged - 1;
        $links[] = $paged - 2;
    }
    if ($paged + 2 <= $max) {
        $links[] = $paged + 2;
        $links[] = $paged + 1;
    }
    genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="navigation">', 'context' => 'archive-pagination'));
    echo '<ul class="pagination">';
    //* Previous Post Link
    if (get_previous_posts_link()) {
        printf('<li class="pagination-previous">%s</li>' . "\n", get_previous_posts_link(apply_filters('genesis_prev_link_text', '&#x000AB;' . __('Previous Page', 'genesis'))));
    }
    //* Link to first page, plus ellipses if necessary
    if (!in_array(1, $links)) {
        $class = 1 == $paged ? ' class="active current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1');
        if (!in_array(2, $links)) {
            echo '<li class="pagination-omission">&#x02026;</li>';
        }
    }
    //* Link to current page, plus 2 pages in either direction if necessary
    sort($links);
    foreach ((array) $links as $link) {
        $class = $paged == $link ? ' class="active current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($link)), $link);
    }
    //* Link to last page, plus ellipses if necessary
    if (!in_array($max, $links)) {
        if (!in_array($max - 1, $links)) {
            echo '<li class="pagination-omission">&#x02026;</li>' . "\n";
        }
        $class = $paged == $max ? ' class="active current"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($max)), $max);
    }
    //* Next Post Link
    if (get_next_posts_link()) {
        printf('<li class="pagination-next">%s</li>' . "\n", get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . '&#x000BB;')));
    }
    echo '</ul></div>' . "\n";
}
开发者ID:g-kanoufi,项目名称:genesis-foundation6-child-theme,代码行数:80,代码来源:pagination.php

示例9: 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>';
}
开发者ID:WayneStratton,项目名称:Bootstrap-for-Genesis,代码行数:8,代码来源:misc.php

示例10: theme_wrapper_end

 /**
  * Add closing wrapper after WooCommerce loop.
  */
 public function theme_wrapper_end()
 {
     do_action('genesis_after_loop');
     genesis_markup(array('html5' => '</main>', 'xhtml' => '</div>'));
     do_action('genesis_after_content');
     echo '</div>';
     //* end .content-sidebar-wrap or #content-sidebar-wrap
     do_action('genesis_after_content_sidebar_wrap');
 }
开发者ID:ThemeMix,项目名称:thememix-pro-genesis,代码行数:12,代码来源:class-woocommerce-compat.php

示例11: widget

 /**
  * Echo the widget content.
  *
  * @since 0.1.8
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     global $wp_query;
     extract($args);
     //* Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     echo $before_widget;
     //* Set up the author bio
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $wp_query = new WP_Query(array('page_id' => $instance['page_id']));
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
             $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-page-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
             if ($instance['show_image'] && $image) {
                 printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), $image);
             }
             if (!empty($instance['show_title'])) {
                 if (genesis_html5()) {
                     printf('<header class="entry-header"><h2 class="entry-title"><a href="%s" title="%s">%s</a></h2></header>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 } else {
                     printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 }
             }
             if (!empty($instance['show_content'])) {
                 echo genesis_html5() ? '<div class="entry-content">' : '';
                 if (empty($instance['content_limit'])) {
                     global $more;
                     $more = 0;
                     the_content($instance['more_text']);
                 } else {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 }
                 echo genesis_html5() ? '</div>' : '';
             }
             if (!empty($instance['custom_text'])) {
                 $text = wp_kses_post($instance['custom_text']);
                 echo '<div class="custom-text">';
                 echo $instance['filter'] ? wpautop($text) : $text;
                 if (!empty($instance['more_text'])) {
                     echo '<span class="more-link"><a href="' . get_permalink($instance['page_id']) . '">' . $instance['more_text'] . '</a></span>';
                 }
                 echo '</div>';
             }
             genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
         }
     }
     //* Restore original query
     wp_reset_query();
     echo $after_widget;
 }
开发者ID:Bobcatou,项目名称:enhanceworldwide,代码行数:62,代码来源:wsm-featured-page.php

示例12: 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;
}
开发者ID:aroldoa,项目名称:alicepediatric,代码行数:12,代码来源:functions.php

示例13: signature_add_demo_nav

function signature_add_demo_nav()
{
    /** If menu is assigned to theme location, output */
    $menu_obj = wp_get_nav_menu_object('Demo');
    if (!empty($menu_obj)) {
        $args = array('menu' => 'Demo', 'container' => '', 'menu_class' => 'menu demo-menu', 'echo' => 0);
        $nav = wp_nav_menu($args);
        $pattern = genesis_markup('<nav class="demo">%2$s%1$s%3$s</nav>', '<div id="nav-demo">%2$s%1$s%3$s</div>', 0);
        $nav_output = sprintf($pattern, $nav, genesis_structural_wrap('nav', 'open', 0), genesis_structural_wrap('nav', 'close', 0));
        echo apply_filters('genesis_do_nav', $nav_output, $nav, $args);
    }
}
开发者ID:kabrewer07,项目名称:mrw,代码行数:12,代码来源:functions.php

示例14: genesis_hm_get_sidebar

/**
 * Display the sidebar for the given post type
 *
 * Normally we just append -widget-area but for some post types we override it 
 *
 * Post type  | Sidebar used
 * ---------- | -------------
 * oik_premiumversion | oik_pluginversion-widget-area
 * oik_sc_param | sidebar-alt
 * 
 * 
 */
function genesis_hm_get_sidebar()
{
    //* Output primary sidebar structure
    genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div id="sidebar" class="sidebar widget-area">', 'context' => 'sidebar-primary'));
    do_action('genesis_before_sidebar_widget_area');
    $post_type = get_post_type();
    $cpts = array("oik_premiumversion" => "oik_pluginversion-widget-area", "oik_sc_param" => "sidebar-alt", "attachment" => "sidebar-alt");
    $dynamic_sidebar = bw_array_get($cpts, $post_type, "{$post_type}-widget-area");
    dynamic_sidebar($dynamic_sidebar);
    do_action('genesis_after_sidebar_widget_area');
    genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>'));
}
开发者ID:bobbingwide,项目名称:genesis-hm,代码行数:24,代码来源:functions.php

示例15: 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);
}
开发者ID:WayneStratton,项目名称:Bootstrap-for-Genesis,代码行数:52,代码来源:footer-widgets.php


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