【发布时间】:2016-12-29 08:45:48
【问题描述】:
我正在为 wordpress 博客使用 canard 主题,它在特色内容区域显示热门帖子。
我的博客上有一些类别,这里是blog 的链接
在类别列表 (archive.php) 页面上使用精选内容区域,该类别的所有热门帖子都应出现在 featured content area 中。
我试图编辑我的存档页面,但我猜有些 css 无法正常工作,我无法找出我哪里出错了
<?php
/**
* The template for displaying archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Canard
*/
get_header(); ?>
<div class="site-content-inner">
<div id="primary" class="content-area">
<?php
if ( is_archive() ) {
get_template_part( 'featured-content','archive' );
}?>
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .site-content-inner -->
<?php get_footer(); ?>
【问题讨论】:
-
我们无法查看 CSS 遗漏的地方。您能否提供一些相同的屏幕截图?