vendredi 27 mars 2015

how do i make this loop work


Apologies I am a PHp beginner and I have no idea why this loop is not working on my tag.php page any help would be welcome.



<?php get_header(); ?>
<div class="posts"><!-- BLOG -->

<!-- Shapes on sides -->
<div class="shapes_left"> </div>
<div class="shapes_right"> </div>

<?php if (is_tag()) { ?>
<div id="archive_title">
<h1><?php single_tag_title(); ?></h1>
<?php }?>
</div>


<div id="featured_home">

<?php $counter = 0;
while ( have_posts() ) {
$counter += 1;
if ( $counter > 5 ) {
break;
}
the_post();

?>
<article class="sticky">
<div class="desc">
<div class="desc_over"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2></div>
<?php the_post_thumbnail(large); ?>


</div>
</article>
<?php }?>
</div>





<?php while( have_posts() ) {
the_post();
// it's a post! Display the post!
} ?>


<div class="post_main">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<ul class="postinfo">
<li>Posted by <?php the_author_link(); ?></li>
<li><?php the_time( 'jS F Y'); ?></li>
</ul>

<?php the_content( ''); ?>

<div class="read_more_blog"><a href="<?php the_permalink(); ?>">Read More</a></div>
</div>

<?php endwhile; ?>
<nav id="pagination"> <!-- PAGINATION FOR BLOG -->
<ul>
<li class="older"><?php next_posts_link( 'Older posts'); ?></li>
<li class="newer"><?php previous_posts_link( 'Newer posts'); ?></li>
</ul>
</nav>

</div>
<!-- END OF BLOG PAGINATION -->
<?php else : ?>
<div id="post">
<!-- 404 Messege -->
<h3>404 ERROR!!</h3>

<p>Sorry we can't seem able to find what you are looking for</p>
<p><a href="<?php echo home_url(); ?>">Click here to get back to the homepage</a>
</p>
</div>
<?php endif; ?>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>




Aucun commentaire:

Enregistrer un commentaire