本文整理汇总了PHP中hybrid_post_format_link函数的典型用法代码示例。如果您正苦于以下问题:PHP hybrid_post_format_link函数的具体用法?PHP hybrid_post_format_link怎么用?PHP hybrid_post_format_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hybrid_post_format_link函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_the_image
// If not viewing a single post.
?>
<?php
get_the_image(array('size' => 'stargazer-full'));
?>
<header class="entry-header">
<?php
the_title('<h2 ' . hybrid_get_attr('entry-title') . '><a href="' . get_permalink() . '" rel="bookmark" itemprop="url">', '</a></h2>');
?>
<div class="entry-byline">
<?php
hybrid_post_format_link();
?>
<span <?php
hybrid_attr('entry-author');
?>
><?php
the_author_posts_link();
?>
</span>
<time <?php
hybrid_attr('entry-published');
?>
><?php
echo get_the_date();
?>
</time>
示例2: widget
/**
* Outputs the widget based on the arguments input through the widget controls.
*
* @since 1.0.0
* @access public
* @param array $sidebar
* @param array $instance
* @return void
*/
function widget($sidebar, $instance)
{
$args = wp_parse_args($instance, $this->defaults);
/* Set up tabs. */
$tabs = array();
if (0 < $args['recent_posts_number']) {
$tabs['recent'] = __('Recent Posts', 'ravel');
}
if (0 < $args['popular_posts_number']) {
$tabs['popular'] = __('Popular Posts', 'ravel');
}
if (0 < $args['recent_comments_number']) {
$tabs['comments'] = __('Recent Comments', 'ravel');
}
if (0 < $args['tag_cloud_number']) {
$tabs['tags'] = __('Tags', 'ravel');
}
if (empty($tabs)) {
return;
}
/* Output the sidebar's $before_widget wrapper. */
echo $sidebar['before_widget'];
/* If a title was input by the user, display it. */
if (!empty($args['title'])) {
echo $sidebar['before_title'] . apply_filters('widget_title', $args['title'], $instance, $this->id_base) . $sidebar['after_title'];
}
?>
<ul class="tabs-nav">
<?php
foreach ($tabs as $tab => $label) {
?>
<?php
printf('<li class="tab-%s tab-title"><a href="#%s" title="%3$s"><span>%3$s</span></a></li>', esc_attr($tab), esc_attr("{$this->id_base}-{$tab}"), esc_attr($label));
?>
<?php
}
?>
</ul><!-- .tabs-nav -->
<div class="tabs-container">
<?php
if (0 < $args['recent_posts_number']) {
?>
<?php
$loop = new WP_Query(array('posts_per_page' => $args['recent_posts_number'], 'ignore_sticky_posts' => true));
?>
<ul id="<?php
echo esc_attr($this->id_base);
?>
-recent" class="tabs-panel">
<?php
while ($loop->have_posts()) {
?>
<?php
$loop->the_post();
?>
<li>
<?php
get_the_image(array('size' => 'post-thumbnail', 'before' => '<div class="tab-thumbnail">', 'after' => '</div>'));
?>
<div class="tab-content">
<div class="tab-post-format">
<?php
hybrid_post_format_link();
?>
</div><!-- .tab-post-format -->
<?php
the_title('<div class="tab-title"><a href="' . get_permalink() . '">', '</a></div>');
?>
<div class="tab-date"><?php
echo get_the_date();
?>
</div>
</div><!-- .tab-content -->
</li>
<?php
}
?>
//.........这里部分代码省略.........