本文整理汇总了PHP中genesis_attr函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_attr函数的具体用法?PHP genesis_attr怎么用?PHP genesis_attr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了genesis_attr函数的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: 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;
}
}
示例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;
}
示例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();
}
示例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();
}
示例6: bfg_breadcrumb_args
function bfg_breadcrumb_args($args)
{
$args['sep'] = ' ';
$args['prefix'] = sprintf('<ol %s>', genesis_attr('breadcrumb'));
$args['suffix'] = '</ol>';
return $args;
}
示例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') . ' …');
$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);
}
示例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
}
示例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
}
示例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>';
}
}
示例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>';
}
示例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);
}
示例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
}
示例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;
}
示例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>';
}