• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP genesis_attr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了genesis_attr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 
    }
}
开发者ID:Wordpress-Development,项目名称:genesis-bootstrap,代码行数:29,代码来源:jumbotron.php


示例2: genesis_markup

/**
 * Output markup conditionally.
 *
 * Supported keys for `$args` are:
 *
 *  - `html5` (`sprintf()` pattern markup),
 *  - `xhtml` (XHTML markup),
 *  - `context` (name of context),
 *  - `echo` (default is true).
 *
 * If the child theme supports HTML5, then this function will output the `html5` value, with a call to `genesis_attr()`
 * with the same context added in. Otherwise, it will output the `xhtml` value.
 *
 * Applies a `genesis_markup_{context}` filter early to allow shortcutting the function.
 *
 * Applies a `genesis_markup_{context}_output` filter at the end.
 *
 * @since 1.9.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 * @uses genesis_attr()  Contextual attributes.
 *
 * @param array $args Array of arguments.
 *
 * @return string Markup.
 */
function genesis_markup($args = array())
{
    $defaults = array('html5' => '', 'xhtml' => '', 'context' => '', 'echo' => true);
    $args = wp_parse_args($args, $defaults);
    //* Short circuit filter
    $pre = apply_filters('genesis_markup_' . $args['context'], false, $args);
    if (false !== $pre) {
        return $pre;
    }
    if (!$args['html5'] || !$args['xhtml']) {
        return '';
    }
    //* If HTML5, return HTML5 tag. Maybe add attributes. Else XHTML.
    if (genesis_html5()) {
        $tag = $args['context'] ? sprintf($args['html5'], genesis_attr($args['context'])) : $args['html5'];
    } else {
        $tag = $args['xhtml'];
    }
    //* Contextual filter
    $tag = $args['context'] ? apply_filters('genesis_markup_' . $args['context'] . '_output', $tag, $args) : $tag;
    if ($args['echo']) {
        echo $tag;
    } else {
        return $tag;
    }
}
开发者ID:treydonovan,项目名称:innergame-anna,代码行数:52,代码来源:markup.php


示例3: bsg_util_structural_wrap_container_fluid

/**
 * Add structural-wrap replacement utility function to use 
 * Bootstrap responsive .container class
 *
 * Useage: add_filter( 'genesis_structural_wrap-{$context}', 'bsg_util_structural_wrap_container_fluid');
 */
function bsg_util_structural_wrap_container_fluid($output, $original_output)
{
    if ($original_output == 'open') {
        $output = sprintf('<div %s>', genesis_attr('container-fluid'));
    }
    return $output;
}
开发者ID:Wordpress-Development,项目名称:genesis-bootstrap,代码行数:13,代码来源:utils.php


示例4: zp_custom_blog_page

function zp_custom_blog_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    if (get_query_var('paged')) {
        $paged = get_query_var('paged');
    } elseif (get_query_var('page')) {
        $paged = get_query_var('page');
    } else {
        $paged = 1;
    }
    //* Arguments
    $args = array('cat' => $include, 'category__not_in' => $exclude, 'posts_per_page' => genesis_get_option('blog_cat_num'), 'paged' => $paged);
    query_posts($args);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:34,代码来源:home.php


示例5: zp_custom_archive_page

function zp_custom_archive_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:25,代码来源:archive.php


示例6: bfg_breadcrumb_args

function bfg_breadcrumb_args($args)
{
    $args['sep'] = '     ';
    $args['prefix'] = sprintf('<ol %s>', genesis_attr('breadcrumb'));
    $args['suffix'] = '</ol>';
    return $args;
}
开发者ID:WayneStratton,项目名称:Bootstrap-for-Genesis,代码行数:7,代码来源:breadcrumbs.php


示例7: genesis_search_form

/**
 * Replace the default search form with a Genesis-specific form.
 *
 * The exact output depends on whether the child theme supports HTML5 or not.
 *
 * Applies the `genesis_search_text`, `genesis_search_button_text`, `genesis_search_form_label` and
 * `genesis_search_form` filters.
 *
 * @since 0.2.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 *
 * @return string HTML markup.
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if (genesis_a11y('search-form')) {
            if ('' == $label) {
                $label = apply_filters('genesis_search_text', __('Search this website', 'genesis'));
            }
            $form_id = uniqid('searchform-');
            $form .= sprintf('<meta itemprop="target" content="%s"/><label class="search-form-label screen-reader-text" for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>', home_url('/?s={s}'), esc_attr($form_id), esc_html($label), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        } else {
            $form .= sprintf('%s<meta itemprop="target" content="%s"/><input itemprop="query-input" type="search" name="s" %s="%s" /><input type="submit" value="%s"  /></form>', esc_html($label), home_url('/?s={s}'), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        }
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" >%s<input type="text" value="%s" name="s" class="s search-input" onfocus="%s" onblur="%s" /><input type="submit" class="searchsubmit search-submit" value="%s" /></form>', home_url('/'), esc_html($label), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur), esc_attr($button_text));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
开发者ID:Oak86,项目名称:matthewbuttler.work,代码行数:39,代码来源:search.php


示例8: genesis_standard_loop

/**
 * Standard loop, meant to be executed without modification in most circumstances where content needs to be displayed.
 *
 * It outputs basic wrapping HTML, but uses hooks to do most of its content output like title, content, post information
 * and comments.
 *
 * The action hooks called are:
 *
 *  - `genesis_before_entry`
 *  - `genesis_entry_header`
 *  - `genesis_before_entry_content`
 *  - `genesis_entry_content`
 *  - `genesis_after_entry_content`
 *  - `genesis_entry_footer`
 *  - `genesis_after_endwhile`
 *  - `genesis_loop_else` (only if no posts were found)
 *
 * @since 1.1.0
 *
 * @uses genesis_html5()       Check for HTML5 support.
 * @uses genesis_legacy_loop() XHTML loop.
 * @uses genesis_attr()        Contextual attributes.
 *
 * @return null Return early after legacy loop if not supporting HTML5.
 */
function genesis_standard_loop()
{
    //* Use old loop hook structure if not supporting HTML5
    if (!genesis_html5()) {
        genesis_legacy_loop();
        return;
    }
    if (have_posts()) {
        do_action('genesis_before_while');
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            do_action('genesis_entry_header');
            do_action('genesis_before_entry_content');
            printf('<div %s>', genesis_attr('entry-content'));
            do_action('genesis_entry_content');
            echo '</div>';
            do_action('genesis_after_entry_content');
            do_action('genesis_entry_footer');
            echo '</article>';
            do_action('genesis_after_entry');
        }
        //* end of one post
        do_action('genesis_after_endwhile');
    } else {
        //* if no posts exist
        do_action('genesis_loop_else');
    }
    //* end loop
}
开发者ID:treydonovan,项目名称:innergame-anna,代码行数:56,代码来源:loops.php


示例9: zp_404_page

function zp_404_page()
{
    ?>

<article class="page type-page status-publish entry">

	<div class="post entry">

		<?php 
    printf('<div %s>', genesis_attr('entry-content'));
    ?>
        	<h1 class="entrytitle"><?php 
    _e('404 - Page Not Found!', 'amelie');
    ?>
</h1>
			<p><?php 
    printf(__('You\'re looking for a page that does not exist! Please try the navigations above..', 'amelie'));
    ?>
</p>

<?php 
    echo '</div>';
    //* end .entry-content
    echo '</div>';
    ?>
    
</article>

<?php 
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:30,代码来源:404.php


示例10: sk_show_posts

function sk_show_posts()
{
    if (is_front_page()) {
        printf('<div %s>', genesis_attr('home-below-content'));
        genesis_widget_area('home-below-content');
        echo '</div>';
    }
}
开发者ID:CarmenGrantham,项目名称:genesis-cg-theme,代码行数:8,代码来源:functions.php


示例11: 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>';
}
开发者ID:Bobcatou,项目名称:bryancadynew,代码行数:16,代码来源:front-page.php


示例12: custom_header_inline_logo

function custom_header_inline_logo($title, $inside, $wrap)
{
    $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '" width="359" height="72" />';
    $inside = sprintf('<a href="%s" title="%s">%s</a>', trailingslashit(home_url()), esc_attr(get_bloginfo('name')), $logo);
    // Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    // A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside);
}
开发者ID:Bobcatou,项目名称:plancurtail,代码行数:12,代码来源:functions.php


示例13: 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
}
开发者ID:e-baker,项目名称:1sentence,代码行数:12,代码来源:front-page.php


示例14: uci_genesis_site_description

function uci_genesis_site_description()
{
    //* Set what goes inside the wrapping tags
    $inside = esc_html(get_bloginfo('description'));
    //* Determine which wrapping tags to use
    $wrap = 'p';
    //* Build the description
    $description = genesis_html5() ? sprintf("<{$wrap} %s>", genesis_attr('site-description')) : sprintf('<%s id="description">%s</%s>', $wrap, $inside, $wrap);
    $description .= genesis_html5() ? "{$inside}</{$wrap}>" : '';
    //* Output (filtered)
    $output = $inside ? apply_filters('uci_genesis_site_description', $description, $inside, $wrap) : '';
    echo $output;
}
开发者ID:quantegy,项目名称:wp-genesis-child-theme,代码行数:13,代码来源:functions_site_description.php


示例15: 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>';
}
开发者ID:e-baker,项目名称:1sentence,代码行数:13,代码来源:functions.php


示例16: 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.
 *
 * @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 genesis_get_nav_menu($args = array())
{
    $args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'link_before' => genesis_html5() ? sprintf('<span %s>', genesis_attr('nav-link-wrap')) : '', 'link_after' => genesis_html5() ? '</span>' : '', '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_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);
}
开发者ID:Friends-School-Atlanta,项目名称:Deployable-WordPress,代码行数:65,代码来源:menu.php


示例17: genesis_markup

/**
 * Output markup conditionally.
 *
 * Supported keys for `$args` are:
 *
 *  - `html5` (`sprintf()` pattern markup),
 *  - `xhtml` (XHTML markup),
 *  - `context` (name of context),
 *  - `echo` (default is true).
 *
 * If the child theme supports HTML5, then this function will output the `html5` value, with a call to `genesis_attr()`
 * with the same context added in. Otherwise, it will output the `xhtml` value.
 *
 * Applies a `genesis_markup_{context}` filter early to allow shortcutting the function.
 *
 * Applies a `genesis_markup_{context}_output` filter at the end.
 *
 * @since 1.9.0
 *
 * @param array $args Array of arguments.
 * @return string Markup.
 */
function genesis_markup($args = array())
{
    $defaults = array('html5' => '', 'xhtml' => '', 'context' => '', 'open' => '', 'close' => '', 'content' => '', 'echo' => true);
    $args = wp_parse_args($args, $defaults);
    // Short circuit filter.
    $pre = apply_filters("genesis_markup_{$args['context']}", false, $args);
    if (false !== $pre) {
        if (!$args['echo']) {
            return $pre;
        }
        echo $pre;
        return;
    }
    if ($args['html5'] || $args['xhtml']) {
        // If HTML5, return HTML5 tag. Maybe add attributes. Else XHTML.
        if (genesis_html5()) {
            $tag = $args['context'] ? sprintf($args['html5'], genesis_attr($args['context'])) : $args['html5'];
        } else {
            $tag = $args['xhtml'];
        }
        // Contextual filter.
        $tag = $args['context'] ? apply_filters("genesis_markup_{$args['context']}_output", $tag, $args) : $tag;
        if (!$args['echo']) {
            return $tag;
        }
        echo $tag;
        return;
    }
    // Add attributes to open tag.
    if ($args['context']) {
        $open = sprintf($args['open'], genesis_attr($args['context']));
        $open = apply_filters("genesis_markup_{$args['context']}_open", $open, $args);
        $close = apply_filters("genesis_markup_{$args['context']}_close", $args['close'], $args);
    } else {
        $open = $args['open'];
        $close = $args['close'];
    }
    if ($args['content'] || $open) {
        $open = apply_filters('genesis_markup_open', $open, $args);
    }
    if ($args['content'] || $close) {
        $close = apply_filters('genesis_markup_close', $close, $args);
    }
    if ($args['echo']) {
        echo $open . $args['content'] . $close;
    } else {
        return $open . $args['content'] . $close;
    }
}
开发者ID:netmagik,项目名称:netmagik,代码行数:71,代码来源:markup.php


示例18: 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
 * applies the `genesis_do_nav` and `genesis_do_subnav` filters instead for backwards compatibility.
 *
 * @since 2.1.0
 *
 * @param string|array $args Menu arguments.
 * @return string|null Navigation menu markup, or `null` if menu is not assigned to theme location, there is
 *                     no menu, or there are no menu items in the menu.
 */
function genesis_get_nav_menu($args = array())
{
    $args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'link_before' => genesis_html5() ? sprintf('<span %s>', genesis_attr('nav-link-wrap')) : '', 'link_after' => genesis_html5() ? '</span>' : '', 'echo' => 0));
    // If a menu is not assigned to theme location, abort.
    if (!has_nav_menu($args['theme_location'])) {
        return;
    }
    // If genesis-accessibility for 'drop-down-menu' is enabled and the menu doesn't already have the superfish class, add it.
    if (genesis_superfish_enabled() && false === strpos($args['menu_class'], 'js-superfish')) {
        $args['menu_class'] .= ' js-superfish';
    }
    $sanitized_location = sanitize_key($args['theme_location']);
    $nav = wp_nav_menu($args);
    // Do nothing if there is nothing to show.
    if (!$nav) {
        return;
    }
    $nav_markup_open = genesis_structural_wrap('menu-' . $sanitized_location, 'open', 0);
    $nav_markup_close = genesis_structural_wrap('menu-' . $sanitized_location, 'close', 0);
    $params = array('theme_location' => $args['theme_location']);
    $nav_output = genesis_markup(array('open' => '<nav %s>', 'close' => '</nav>', 'context' => 'nav-' . $sanitized_location, 'content' => $nav_markup_open . $nav . $nav_markup_close, 'echo' => false, 'params' => $params));
    $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);
}
开发者ID:netmagik,项目名称:netmagik,代码行数:58,代码来源:menu.php


示例19: zp_custom_single_template

function zp_custom_single_template()
{
    global $post, $paged;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            do_action('genesis_entry_footer');
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:18,代码来源:single.php


示例20: ygf_seo_site_title

/**
 * Echo the site title into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_title` filter before echoing.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_seo_option() Get SEO setting value.
 * @uses genesis_html5()          Check or HTML5 support.
 */
function ygf_seo_site_title()
{
    // Set what goes inside the wrapping tags
    $inside = sprintf('<a href="%s" class="menu-text">%s</a>', trailingslashit(home_url()), get_bloginfo('name'));
    // Determine which wrapping tags to use
    $wrap = is_home() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'h1';
    // A little fallback, in case an SEO plugin is active
    $wrap = is_home() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    // Build the title
    $title = genesis_html5() ? sprintf("<li class='name'><{$wrap} %s>", genesis_attr('site-title')) : sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
    $title .= genesis_html5() ? "{$inside}</{$wrap}></li>" : '';
    if (!has_nav_menu('mobile-off-canvas')) {
        $title .= '<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>';
    }
    // Echo (filtered)
    echo apply_filters('genesis_seo_title', $title, $inside, $wrap);
}
开发者ID:g-kanoufi,项目名称:genesis-foundation6-child-theme,代码行数:31,代码来源:header.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP genesis_code函数代码示例发布时间:2022-05-15
下一篇:
PHP genesis_admin_redirect函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap