本文整理匯總了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();