I was writing my custom blog page for wordpress
I replaced my content.php with this code
<?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-## -->
and everything except header and was gone. I was unable to see any post and sidebars.
I replaced it back with the original which is
<?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-## -->
Now I am seeing only one post heading this Hello World
Can't see anything. I have refresh the page several times. Applied Ctrl +F5
cleaned cache and history and infact change the browser but no help.
if () :
, then you need to end withendif
, not with a curly bracket. You also cannot use both at the same time likeif () : {
and then} endif
– Pieter Goosen Dec 4 '15 at 11:29