I am currently building my own WordPress Theme, with the view of 'learning on the job' as I am fairly new to writing my own PHP Coding.
I want to place a 'Previous' and 'Next' set of links to appear at the bottom of my Blog Page. I have referred to the WordPress Codex, which states to place the following code after The Loop:
<div class="navigation">
<div class="alignleft"><?php previous_posts_link('« Read Previous Blogs') ?></div>
<div class="alignright"><?php next_posts_link('Read More Blogs »','') ?></div>
</div>
By 'after The Loop', does this mean after the 'endwhile' statement but before the 'endif;' or after them both all together? I have placed the above code in both scenarios but it does not seem to make a difference. Just wondering if there is a best practice etc. I have included The Loop coding I am using, for reference, in case my coding affects any answers. Please ignore the numbers such as [1], [2] and [3] etc. I have placed these as comments for my own use, where I have created my own list of notes on a separate file. As a side question, commenting my coding like this won't affect performance etc?:
<?php
/*
=========================================
Generating the Posts. The Loop. (Start)
=========================================
*/
if ( have_posts() ): //[1]
while( have_posts() ): the_post(); //[2] and [3]
?>
<h3><a href="<?php the_permalink(); //[4]?>"><?php the_title(); //[5]?></a></h3>
<p><?php the_content(); // [6]?></p>
<small>This entry was posted on: <?php the_date('l, jS F Y'); //[7]?> at <?php the_time('g:i a'); //[7]?> and is filed under <?php the_category(); //[7]?></small>
<small>This Article was written by: <?php the_author_link(); //[7]?></small>
<div class="post"><?php edit_post_link('Edit','','<strong>|</strong>'); //[8]?>
<?php comments_popup_link('Be the first to comment »', 'Just the one comment so far »', '% Comments »', '', 'Comments are Closed for this article.'); //[8]?></div>
<?php
endwhile; //[9]
endif; //[10]
/*
=======================================
Generating the Posts. The Loop. (End)
=======================================
*/
?>
<div class="navigation">
<div class="alignleft"><?php previous_posts_link('« Read Previous Blogs') ?></div>
<div class="alignright"><?php next_posts_link('Read More Blogs »','') ?></div>
</div>