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

PHP hybrid_get_attr函数代码示例

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

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



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

示例1: flagship_get_entry_published

/**
 * Helper function for getting a post's published date and formatting it to be
 * displayed in a template.
 *
 * @since  1.1.0
 * @access public
 * @param  $args array
 * @return string
 */
function flagship_get_entry_published($args = array())
{
    $output = '';
    $defaults = apply_filters('flagship_entry_published_defaults', array('before' => '', 'after' => '', 'attr' => 'entry-published', 'date' => get_the_date(), 'wrap' => '<time %s>%s</time>'));
    $args = wp_parse_args($args, $defaults);
    $output .= $args['before'];
    $output .= sprintf($args['wrap'], hybrid_get_attr($args['attr']), $args['date']);
    $output .= $args['after'];
    return apply_filters('flagship_entry_published', $output, $args);
}
开发者ID:flagshipwp,项目名称:flagship-library,代码行数:19,代码来源:template-entry.php


示例2: munsa_lite_get_post_terms

/**
 * This template tag is meant to replace template tags like `the_category()`, `the_terms()`, etc.  These core 
 * WordPress template tags don't offer proper translation and RTL support without having to write a lot of 
 * messy code within the theme's templates.  This is why theme developers often have to resort to custom 
 * functions to handle this (even the default WordPress themes do this). Particularly, the core functions 
 * don't allow for theme developers to add the terms as placeholders in the accompanying text (ex: "Posted in %s"). 
 * This funcion is a wrapper for the WordPress `get_the_terms_list()` function.  It uses that to build a 
 * better post terms list.
 *
 * @author  Justin Tadlock
 * @link    https://github.com/justintadlock/hybrid-core/blob/2.0/functions/template-post.php
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * @since   1.0.0
 * @param   array   $args
 * @return  string
 */
function munsa_lite_get_post_terms($args = array())
{
    $html = '';
    $defaults = array('post_id' => get_the_ID(), 'taxonomy' => 'category', 'text' => '%s', 'before' => '', 'after' => '', 'items_wrap' => '<span %s>%s</span>', 'sep' => _x(' #', 'taxonomy terms separator', 'munsa-lite'));
    $args = wp_parse_args($args, $defaults);
    $terms = get_the_term_list($args['post_id'], $args['taxonomy'], '', $args['sep'], '');
    if (!empty($terms)) {
        $html .= $args['before'];
        $html .= sprintf($args['items_wrap'], 'class="entry-terms ' . $args['taxonomy'] . '" ' . hybrid_get_attr('entry-terms', $args['taxonomy']) . '', sprintf($args['text'], $terms));
        $html .= $args['after'];
    }
    return $html;
}
开发者ID:samikeijonen,项目名称:munsa-lite,代码行数:30,代码来源:template-tags.php


示例3: flagship_get_posts_navigation

/**
 * Helper function to build a newer/older or paginated navigation element within
 * a loop of multiple entries. This takes care of all the annoying formatting
 * which usually would need to be done within a template.
 *
 * This defaults to a pagination format unless the site is using a version of
 * WordPress older than 4.1. For older sites, we fall back to the next and
 * previous post links by default.
 *
 * @since  1.3.0
 * @access public
 * @param  $args array
 * @return string
 */
function flagship_get_posts_navigation($args = array())
{
    global $wp_query;
    // Return early if we're on a singular post or we only have one page.
    if (is_singular() || 1 === $wp_query->max_num_pages) {
        return;
    }
    $defaults = apply_filters('flagship_loop_nav_defaults', array('format' => 'pagination', 'prev_text' => sprintf('<span class="screen-reader-text">%s</span>', __('Previous Page', 'flagship-library')), 'next_text' => sprintf('<span class="screen-reader-text">%s</span>', __('Next Page', 'flagship-library')), 'prev_link_text' => __('Newer Posts', 'flagship-library'), 'next_link_text' => __('Older Posts', 'flagship-library')));
    $args = wp_parse_args($args, $defaults);
    $output = '';
    $output .= '<nav ' . hybrid_get_attr('nav', 'archive') . '>';
    $output .= sprintf('<span class="nav-previous">%s</span>', get_previous_posts_link($args['prev_link_text']));
    $output .= sprintf('<span class="nav-next">%s</span>', get_next_posts_link($args['next_link_text']));
    $output .= '</nav><!-- .nav-archive -->';
    if (function_exists('the_posts_pagination') && 'pagination' === $args['format']) {
        $output = get_the_posts_pagination(array('prev_text' => $args['prev_text'], 'next_text' => $args['next_text']));
    }
    return apply_filters('flagship_loop_nav', $output, $args);
}
开发者ID:flagshipwp,项目名称:flagship-library,代码行数:33,代码来源:template-general.php


示例4: hybrid_get_attr

			<?php 
if (is_single()) {
    // If viewing a single post.
    $heading = 'h1';
} else {
    // If not viewing a single post.
    $heading = 'h2';
}
// End single post check.
?>
		
			<<?php 
echo $heading;
?>
 class="entry-title" <?php 
echo hybrid_get_attr('entry-title');
?>
>
				<a href="<?php 
echo esc_url(toivo_lite_get_link_url());
?>
"><?php 
the_title();
?>
 <span class="meta-nav"><?php 
echo esc_attr($toivo_left_or_right);
?>
</span></a>
			</<?php 
echo $heading;
?>
开发者ID:jpbender,项目名称:wp_virtual,代码行数:31,代码来源:content-link.php


示例5: get_template_part

?>

	<div class="entry-inner">

		<header class="entry-header">
	
			<?php 
get_template_part('entry', 'meta');
// Loads the entry-meta.php template.
?>
		
			<?php 
if (is_single()) {
    the_title('<h1 class="entry-title" ' . hybrid_get_attr('entry-title') . '>', '</h1>');
} else {
    the_title(sprintf('<h2 class="entry-title" ' . hybrid_get_attr('entry-title') . '><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
}
?>
		
		</header><!-- .entry-header -->
		
		<?php 
if (!is_single() || is_page_template('pages/front-page.php')) {
    ?>
		
			<div class="entry-summary" <?php 
    hybrid_attr('entry-summary');
    ?>
>
				<?php 
    the_excerpt();
开发者ID:samikeijonen,项目名称:chuchadon,代码行数:31,代码来源:content-video.php


示例6: flagship_attr_widget_menu

/**
 * Widget nav menu attributes.
 *
 * @deprecated 1.4.0
 * @since  1.0.0
 * @access public
 * @param  array $attr
 * @param  string $context
 * @return array
 */
function flagship_attr_widget_menu($attr, $context)
{
    _deprecated_function(__FUNCTION__, '1.4.0');
    return hybrid_get_attr('menu', $context);
}
开发者ID:flagshipwp,项目名称:flagship-library,代码行数:15,代码来源:deprecated.php


示例7: the_post_thumbnail

        if (has_post_thumbnail()) {
            ?>
							<div class="post-thumbnail">
								<?php 
            the_post_thumbnail();
            ?>
							</div><!-- .post-thumbnail -->
					<?php 
        }
        ?>
						
					<div class="entry-inner">
						
						<header class="entry-header">
							<?php 
        the_title('<h1 class="entry-title" ' . hybrid_get_attr('entry-title') . '>', '</h1>');
        ?>
						</header><!-- .entry-header -->
						
						<div class="entry-content" <?php 
        hybrid_attr('entry-content');
        ?>
>
							<?php 
        the_content();
        ?>
						</div><!-- .entry-content -->
						
					</div><!-- .entry-inner -->
						
				</article><!-- #post-## -->
开发者ID:jpbender,项目名称:wp_virtual,代码行数:31,代码来源:front-page.php


示例8: hybrid_attr

/**
 * Outputs an HTML element's attributes.
 *
 * @since  2.0.0
 * @access public
 * @param  string  $slug     The slug/ID of the element (e.g., 'sidebar').
 * @param  string  $context  A specific context (e.g., 'primary').
 * @param  array   $attr     Array of attributes to pass in (overwrites filters).
 * @return void
 */
function hybrid_attr($slug, $context = '', $attr = array())
{
    echo hybrid_get_attr($slug, $context, $attr);
}
开发者ID:ifte510,项目名称:hybrid-core,代码行数:14,代码来源:functions-attr.php


示例9: printf

<?php

printf('<div class="%s">', 'search-meta');
printf('<div %s>', hybrid_get_attr('loop-meta'));
printf('<h1 %s>', hybrid_get_attr('loop-title'));
echo __('New Search', 'classic');
echo '</h1>';
printf('<div %s>', hybrid_get_attr('loop-description'));
printf('<p>');
echo __('If you are not happy with the results below please do another search', 'classic');
echo '</p>';
get_search_form();
// Loads the searchform.php template.
echo '</div><!-- .loop-description -->';
echo '</div><!-- .loop-meta -->';
echo '</div><!-- .search-meta -->';
global $wp_query;
printf('<div class="%s">', 'alert alert-info');
$page_title = strip_tags(hybrid_get_loop_title());
$page_title = $wp_query->found_posts . " " . $page_title;
echo $page_title;
echo '</div><!-- .alert .alert-info -->';
开发者ID:hybopressthemes,项目名称:basic-classic,代码行数:22,代码来源:search-box.php


示例10: hybrid_get_post_terms

/**
 * This template tag is meant to replace template tags like `the_category()`, `the_terms()`, etc.  These core
 * WordPress template tags don't offer proper translation and RTL support without having to write a lot of
 * messy code within the theme's templates.  This is why theme developers often have to resort to custom
 * functions to handle this (even the default WordPress themes do this).  Particularly, the core functions
 * don't allow for theme developers to add the terms as placeholders in the accompanying text (ex: "Posted in %s").
 * This funcion is a wrapper for the WordPress `get_the_terms_list()` function.  It uses that to build a
 * better post terms list.
 *
 * @since  2.0.0
 * @access public
 * @param  array   $args
 * @return string
 */
function hybrid_get_post_terms($args = array())
{
    $html = '';
    $defaults = array('post_id' => get_the_ID(), 'taxonomy' => 'category', 'text' => '%s', 'before' => '', 'after' => '', 'wrap' => '<span %s>%s</span>', 'sep' => _x(', ', 'taxonomy terms separator', 'hybrid-core'));
    $args = wp_parse_args($args, $defaults);
    $terms = get_the_term_list($args['post_id'], $args['taxonomy'], '', $args['sep'], '');
    if ($terms) {
        $html .= $args['before'];
        $html .= sprintf($args['wrap'], hybrid_get_attr('entry-terms', $args['taxonomy']), sprintf($args['text'], $terms));
        $html .= $args['after'];
    }
    return $html;
}
开发者ID:emkal,项目名称:Infusion,代码行数:27,代码来源:template-post.php


示例11: printf

<?php

printf('<li %s>', hybrid_get_attr('comment'));
printf('<article>');
printf('<header class="%s">', 'comment-meta clearfix');
echo get_avatar($comment, apply_filters('hybopress_comment_gravatar_size', 48));
printf('<cite %s>', hybrid_get_attr('comment-author'));
echo get_comment_author_link();
echo '</cite>';
printf('<span class="%s">', 'says sr-only');
echo __('says:', 'getnoticed');
echo '</span><br />';
printf('<a %s>', hybrid_get_attr('comment-permalink'));
printf('<time %s>', hybrid_get_attr('comment-published'));
printf(__('%1$s at %2$s', 'getnoticed'), get_comment_date(), get_comment_time());
echo '</time>';
echo '</a>';
edit_comment_link();
echo '</header><!-- .comment-meta -->';
printf('<div class="%s">', 'comment-content');
if ('0' == $comment->comment_approved) {
    printf('<p class="%s">', 'text-info text-uppercase');
    printf('<em class="%s">', 'comment-awaiting-moderation');
    _e('Your comment is awaiting moderation.', 'getnoticed');
    echo '</em>';
    echo '</p>';
}
comment_text();
echo '<!-- .comment-content -->';
hybrid_comment_reply_link();
echo '</article>';
开发者ID:hybopressthemes,项目名称:basic-getnoticed,代码行数:31,代码来源:comment.php


示例12: printf

<?php

printf('<li %s>', hybrid_get_attr('comment'));
printf('<article>');
printf('<header class="%s">', 'comment-meta clearfix');
echo get_avatar($comment, apply_filters('hybopress_comment_gravatar_size', 60));
hybrid_comment_reply_link();
printf('<cite %s>', hybrid_get_attr('comment-author'));
echo get_comment_author_link();
echo '</cite><br />';
printf('<time %s>', hybrid_get_attr('comment-published'));
printf(__('%s ago', 'elegant'), human_time_diff(get_comment_time('U'), current_time('timestamp')));
echo '</time>';
printf('<a %s>', hybrid_get_attr('comment-permalink'));
_e('Permalink', 'elegant');
echo '</a>';
edit_comment_link();
echo '</header><!-- .comment-meta -->';
printf('<div class="%s">', 'comment-content');
if ('0' == $comment->comment_approved) {
    printf('<p class="%s">', 'text-info text-uppercase');
    printf('<em class="%s">', 'comment-awaiting-moderation');
    _e('Your comment is awaiting moderation.', 'elegant');
    echo '</em>';
    echo '</p>';
}
comment_text();
echo '<!-- .comment-content -->';
echo '</article>';
/* No closing </li> is needed.  WordPress will know where to add it. */
开发者ID:hybopressthemes,项目名称:basic-elegant,代码行数:30,代码来源:comment.php


示例13: hybrid_attr

hybrid_attr('header');
?>
>
			<div class="header-image"></div>

			<div class="wrap">

				<div <?php 
hybrid_attr('branding');
?>
>
					<?php 
$logo = '<img itemprop="logo" alt="' . get_bloginfo('name') . '" src="' . THEME_IMG_URI . 'logo.png">';
?>
					<?php 
printf('<h1 %s><a href="%s" rel="home">%s</a></h1>', hybrid_get_attr('site-title'), esc_url(home_url()), $logo);
?>
					<span class="screen-reader-text" itemprop="name"><?php 
bloginfo('name');
?>
</span>
				</div><!-- #branding -->

				<?php 
hybrid_get_menu('primary');
// Loads the menu/primary.php template.
?>
				<?php 
//hybrid_get_menu( 'primary-mobile' ); // Loads the menu/primary-mobile.php template.
?>
				
开发者ID:EJOweb,项目名称:ejoweb,代码行数:30,代码来源:header.php


示例14: WP_Query

			
				<?php 
    // Testimonials area
    $testimonials = new WP_Query(apply_filters('toivo_lite_testimonials_arguments', array('post_type' => 'jetpack-testimonial', 'orderby' => 'rand', 'posts_per_page' => 4, 'no_found_rows' => true)));
    ?>

				<?php 
    if ($testimonials->have_posts()) {
        ?>

					<div id="testimonial-area" class="testimonial-area front-page-area">
				
						<?php 
        $jetpack_options = get_theme_mod('jetpack_testimonials');
        $toivo_lite_testimonial_heading = $jetpack_options['page-title'] ? esc_html($jetpack_options['page-title']) : esc_html__('Testimonials', 'toivo-lite');
        echo '<h2 class="entry-title" ' . hybrid_get_attr('entry-title') . '>' . $toivo_lite_testimonial_heading . '</h2>';
        ?>
					
						<div class="testimonial-wrapper">

							<?php 
        while ($testimonials->have_posts()) {
            $testimonials->the_post();
            ?>

								<?php 
            get_template_part('content', 'jetpack-testimonial');
            ?>

							<?php 
        }
开发者ID:jpbender,项目名称:wp_virtual,代码行数:30,代码来源:area-testimonial.php


示例15: hybrid_attr

<article <?php 
hybrid_attr('post');
?>
>

	<?php 
$time = sprintf("<time %s>%s</time>", hybrid_get_attr('entry-published'), get_the_date('j F Y'));
?>

	<?php 
if (is_singular()) {
    // If a single post.
    ?>

		<header class="entry-header">
			<h1 <?php 
    hybrid_attr('entry-title');
    ?>
><?php 
    the_title();
    ?>
</h1>
		</header>

		<div <?php 
    hybrid_attr('entry-content');
    ?>
>

			<?php 
    the_content();
开发者ID:EJOweb,项目名称:ejoweb,代码行数:31,代码来源:content.php


示例16: hybrid_get_site_description

/**
 * Returns the site description wrapped in an `<h2>` tag.
 *
 * @since  2.0.0
 * @access public
 * @return string
 */
function hybrid_get_site_description()
{
    if ($desc = get_bloginfo('description')) {
        $desc = sprintf('<h2 %s>%s</h2>', hybrid_get_attr('site-description'), $desc);
    }
    return apply_filters('hybrid_site_description', $desc);
}
开发者ID:LSYanJun,项目名称:wordpress,代码行数:14,代码来源:template-general.php


示例17: hybrid_attr

 * The secondary nav menu template.
 *
 * @package     Compass
 * @subpackage  HybridCore
 * @copyright   Copyright (c) 2015, Flagship Software, LLC
 * @license     GPL-2.0+
 * @since       1.0.0
 */
if (has_nav_menu('secondary')) {
    ?>

	<nav <?php 
    hybrid_attr('menu', 'secondary');
    ?>
>

		<span id="menu-secondary-title" class="screen-reader-text">
			<?php 
    // Translators: %s is the nav menu name. This is the nav menu title shown to screen readers.
    printf(_x('%s', 'nav menu title', 'compass'), hybrid_get_menu_location_name('secondary'));
    ?>
		</span>

		<?php 
    wp_nav_menu(array('theme_location' => 'secondary', 'container' => '', 'menu_id' => 'secondary', 'menu_class' => 'nav-menu secondary', 'fallback_cb' => '', 'items_wrap' => '<div ' . hybrid_get_attr('wrap', 'secondary-menu') . '><ul id="%s" class="%s">%s</ul></div>'));
    ?>

	</nav><!-- #menu-secondary -->

	<?php 
}
开发者ID:flagshipwp,项目名称:compass,代码行数:31,代码来源:secondary.php


示例18: hybrid_post_terms

			<?php 
    hybrid_post_terms(array('taxonomy' => 'category', 'text' => __('Posted in %s', 'infusion')));
    ?>
			<?php 
    hybrid_post_terms(array('taxonomy' => 'post_tag', 'text' => __('Tagged %s', 'infusion'), 'before' => '<br />'));
    ?>
		</footer>

	<?php 
} else {
    // If not viewing a single post.
    ?>

		<header class="entry-header">
			<?php 
    the_title('<h2 ' . hybrid_get_attr('entry-title') . '><a href="' . hybrid_get_the_post_format_url() . '">', is_rtl() ? ' <span class="meta-nav">&larr;</span>' : ' <span class="meta-nav">&rarr;</span>' . '</a></h2>');
    ?>
		</header>

		<footer class="entry-footer">
			<?php 
    hybrid_post_format_link();
    ?>
			<time <?php 
    hybrid_attr('entry-published');
    ?>
><?php 
    echo get_the_date();
    ?>
</time>
			<a class="entry-permalink" href="<?php 
开发者ID:emkal,项目名称:Infusion,代码行数:31,代码来源:link.php


示例19: flagship_header_menu_wrap

/**
 * Wrap the header navigation menu in its own nav tags with markup API.
 *
 * @since  1.0.0
 * @param  $menu Menu output.
 * @return string $menu Modified menu output.
 */
function flagship_header_menu_wrap($menu)
{
    return sprintf('<nav %s>', hybrid_get_attr('widget-menu', 'header')) . $menu . '</nav>';
}
开发者ID:stedy67,项目名称:Compass,代码行数:11,代码来源:general.php


示例20: hybrid_attr

/**
 * Outputs an HTML element's attributes.
 *
 * @since  2.0.0
 * @access public
 * @param  string  $slug     The slug/ID of the element (e.g., 'sidebar').
 * @param  string  $context  A specific context (e.g., 'primary').
 * @return void
 */
function hybrid_attr($slug, $context = '')
{
    echo hybrid_get_attr($slug, $context);
}
开发者ID:highergroundstudio,项目名称:hybrid-core,代码行数:13,代码来源:attr.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP hybrid_get_child_textdomain函数代码示例发布时间:2022-05-15
下一篇:
PHP hybrid_entry_class函数代码示例发布时间: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