我有两个页面按类别显示帖子。网页底部是每个帖子内容的重复列表。该数据显示在html结束标记</html>
之后。
我的页面: http://thecollegeroar.com/blog/category/admissions/ http://thecollegeroar.com/blog/category/financial-aid/
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
//get_header(); ?>
<html>
<head>
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/loadLinks.php";
include_once($path);
?>
</head>
<body>
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/header.php";
include_once($path);
?>
<div id="main">
<div id="links">
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/collegeLinks.php";
include_once($path);
?>
</div>
<div id="article_blog">
<div class="wrap">
<?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 endif; ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
if ( have_posts() ) : ?>
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/*
* 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( 'template-parts/post/content', get_post_format() );
endwhile;
the_posts_pagination( array(
'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
) );
else :
//get_template_part( 'template-parts/post/content', 'none' );
endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
</div><!-- article -->
<div id="news">
<div class="panel-heading">
<h3 class="panel-title">
<ul>
<li><img src="/Images/Social/Twitter_570625.png"
width="50px"
height="auto"></li>
<li>The College Roar Live</li>
</ul>
</h3>
</div>
<div class="panel-body">
<div class="twitter">
<a class="twitter-timeline"
href="https://twitter.com/thecollegeroar?ref_src=twsrc%5Etfw
"data-tweet-limit='5'">
Tweets by thecollegeroar
</a>
</div>
</div>
</div>
</div>
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/footer.php";
include_once($path);
?>
</body>
</html>
答案 0 :(得分:0)
在这一行上您遇到语法错误,请尝试像这样修复它:
<a class="twitter-timeline" href="https://twitter.com/thecollegeroar?ref_src=twsrc%5Etfw" data-tweet-limit='5'>
答案 1 :(得分:0)
我用原始代码恢复了二十七个主题,并删除了结束标记后的多余细节。