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


PHP twentyfourteen_get_featured_posts函数代码示例

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


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

示例1: do_action

 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since bt2n 1.0
 */
?>

<div id="featured-content" class="featured-content">
	<div class="featured-content-inner">
	<?php 
/**
 * Fires before the bt2n featured content.
 *
 * @since bt2n 1.0
 */
do_action('twentyfourteen_featured_posts_before');
$featured_posts = twentyfourteen_get_featured_posts();
foreach ((array) $featured_posts as $order => $post) {
    setup_postdata($post);
    // Include the featured content template.
    get_template_part('content', 'featured-post');
}
/**
 * Fires after the bt2n featured content.
 *
 * @since bt2n 1.0
 */
do_action('twentyfourteen_featured_posts_after');
wp_reset_postdata();
?>
	</div><!-- .featured-content-inner -->
</div><!-- #featured-content .featured-content -->
开发者ID:bichttn,项目名称:bichttn,代码行数:31,代码来源:featured-content.php

示例2: twentyfourteen_has_featured_posts

/**
 * A helper conditional function that returns a boolean value.
 *
 * @since Twenty Fourteen 1.0
 *
 * @return bool Whether there are featured posts.
 */
function twentyfourteen_has_featured_posts()
{
    return !is_paged() && (bool) twentyfourteen_get_featured_posts();
}
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:11,代码来源:functions_bck_1_12_2014.php

示例3: twentyfourteen_get_recent

/**
 * Gets recent formatted posts that are not featured in FC plugin.
 *
 */
function twentyfourteen_get_recent($post_format)
{
    $args = array('order' => 'DESC', 'ignore_sticky_posts' => 1, 'posts_per_page' => 2, 'tax_query' => array(array('taxonomy' => 'post_format', 'terms' => array($post_format), 'field' => 'slug', 'operator' => 'IN')), 'no_found_rows' => true);
    $featured_posts = twentyfourteen_get_featured_posts();
    if (is_array($featured_posts) && !empty($featured_posts)) {
        $args['post__not_in'] = wp_list_pluck($featured_posts, 'ID');
    }
    return new WP_Query($args);
}
开发者ID:openify,项目名称:wordpress-composer,代码行数:13,代码来源:functions.php


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