我在为wordpress写我的自定义博客页面
我替换了我的内容。使用此代码的php
<?php
/**
* Template part for displaying posts.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Trevelle
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf( \'<h3class="entry-title"><a href="%s" rel="bookmark">\', esc_url( get_permalink() ) ), \'</a></h3>\' ); ?>
<?php if ( \'post\' === get_post_type() ) : ?>
<div class="post-details">
<i class="fa fa-clock-o"></i><time><?php the_date(); ?></time>
<i class="fa fa-folder-open"></i> <a href=""><?php the_category(\', \'); ?></a>
<?php edit_post_link(\'Edit\', \'<div><i class="fa fa-penicil"></i>\', \'</div>\'); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if (has_post_thumbnail() ) : { ?>
<div class="post-image">
<?php the_post_thumbnail(); ?>
</div>
<?php } ?>
<div class="post-excerpt">
<?php the_excerpt(); ?>
</div>
</article><!-- #post-## -->
除了头球之外的一切都消失了。我看不到任何帖子和边栏。
我把它换回来了
<?php
/**
* @package GovPress
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php if ( \'post\' == get_post_type() ) : ?>
<div class="entry-meta">
<?php govpress_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( \'Continue reading <span class="meta-nav">→</span>\', \'govpress\' ) ); ?>
<?php
wp_link_pages( array(
\'before\' => \'<div class="page-links">\' . __( \'Pages:\', \'govpress\' ),
\'after\' => \'</div>\',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<ul class="entry-meta-taxonomy">
<?php if ( \'post\' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php echo get_the_category_list(\'<li>\',\'</li><li>\',\'</li>\'); ?>
<?php echo get_the_tag_list(\'<li>\',\'</li><li>\',\'</li>\'); ?>
<?php endif; // End if \'post\' == get_post_type() ?>
<?php if ( ! post_password_required() && ( comments_open() || \'0\' != get_comments_number() ) ) : ?>
<li class="comments-link"><?php comments_popup_link( __( \'Leave a comment\', \'govpress\' ), __( \'1 Comment\', \'govpress\' ), __( \'% Comments\', \'govpress\' ) ); ?></li>
<?php endif; ?>
<?php edit_post_link( __( \'Edit\', \'govpress\' ), \'<li class="edit-link">\', \'</li>\' ); ?>
</ul>
</footer><!-- .entry-meta -->
</article><!-- #post-## -->
现在我只看到一篇标题为
Hello World什么都看不见。我已经刷新了几次页面。应用Ctrl +F5
清理缓存和历史记录并更改浏览器,但没有帮助。