本文整理汇总了PHP中twentyfourteen_has_featured_posts函数的典型用法代码示例。如果您正苦于以下问题:PHP twentyfourteen_has_featured_posts函数的具体用法?PHP twentyfourteen_has_featured_posts怎么用?PHP twentyfourteen_has_featured_posts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了twentyfourteen_has_featured_posts函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_header
<?php
/**
* Template Name: Contributor Page
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header();
?>
<div id="main-content" class="main-content">
<?php
if (is_front_page() && twentyfourteen_has_featured_posts()) {
// Include the featured content template.
get_template_part('featured-content');
}
?>
<!-- test-->
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
// Start the Loop.
while (have_posts()) {
the_post();
?>
<article id="post-<?php
the_ID();
示例2: get_header
<?php
/**
* The template for displaying the home page.
*
* @package WordPress
* @subpackage Twenty_Fourteen
*/
get_header();
?>
<div class="front-page-content-wrapper">
<?php
if (twentyfourteen_has_featured_posts()) {
get_template_part('featured-content');
}
?>
<div id="primary" class="content-area no-sidebar">
<div id="content" class="site-content" role="main">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
if ($post->post_type != 'post') {
get_template_part('content', 'cpt-' . $post->post_type);
} else {
get_template_part('content', get_post_format());
}
comments_template();