go41

add the previous / next post link to single post template

von Joern am 28. Dez. 2011 | Keine Kommentare

there are themes like Arthemia which do not link from a single post to the previous or next post.

To make navigation easier and improve your SEO by internal linking you can add these two links very easy!
Find in (Arthemia theme) single.php the last six lines, they should look like this:

<?php endif; ?>

</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
Now add the following just below <?php endif; ?> and above the following </div>
<div class="navigation">
<div class="right"><?php next_post_link(‚%link &raquo;‘) ?></div>
<div class="left"><?php previous_post_link(‚&laquo; %link‘) ?></div>
</div>
The result should be:

<?php endif; ?>
<div class="navigation">
<div class="right"><?php next_post_link(‚%link &raquo;‘) ?></div>
<div class="left"><?php previous_post_link(‚&laquo; %link‘) ?></div>
</div>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
to get the correct styling should be in your style.css already, normally you do not need to change something.

the styles (somewhere in your .css) are:
.navigation {

padding:5px 0px;

text-align:Center;

}
and somewhere else:
.left, .alignleft {

float:left;

}
.right, .alignright {

float:right;

}
____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Sorry, no posts matched your criteria.

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: