Just started using wordpress and am using the Hemingway theme (
http://warpspire.com/hemingway/).
The theme is great - but I having trouble how to add Next Previous post links at the bottom of the page - since they are there by default.
Any help would be appreciated.
are you saying you want them and they are not there? Or they are there and you don't want them?
If they are not there and you want them, the easiest thing to do is go copy the php from a theme that has them and paste them in yours where you want them. If you want rid of them just delete the php snippets..
drewactual
They are not there and want to add them in. Just tried the code from the classic theme:
<?php posts_nav_link(' — ', __('« Older Posts'), __('Newer Posts »')); ?>
But - it did not take me anywhere. Suggestions?
send a link and let me peek....
but while I wait on that, how about putting that snippet in a defined field- like:
<h1><?php posts_nav_link(' — ', __('« Older Posts'), __('Newer Posts »')); ?></h1>
« Older Posts Newer Posts »
that is there, that is what you wanted, right?
Yes - the link shows up - and no - it does not navigate througth all the posts correctly. It keeps linking to the same page?
oh.. let me play... I was thinking that was all of your posts and that was the reason.
try:
<?php next_posts_link('« Previous Entries') ?>
<?php previous_posts_link('Next Entries »') ?>
Same result:
I am editiing code with "Main Index Template" index.php
<?php get_header(); ?>
<div id="primary" class="onecol-stories">
<div class="inside">
<?php
// Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
query_posts('showposts=5');
?>
<?php if (have_posts()) : ?>
<?php $first = true; ?>
<?php while (have_posts()) : the_post(); ?>
<div class="story<?php if($first == true) echo " first" ?>">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php $hemingway->excerpt() ?>
<div class="details">
<?= _('Posted at') ?> <?php the_time('ga \o\n ' . $hemingway->date_format(true) . '/y') ?> | <?php comments_popup_link('no comments', '1 comment', '% comments'); ?> | Filed Under: <?php the_category(', ') ?> <span class="read-on"><a href="<?php the_permalink() ?>">read on</a></span>
</div>
</div>
<?php $first = false; ?>
<?php endwhile; ?>
<h1><?php next_posts_link('« Previous Entries') ?>
<?php previous_posts_link('Next Entries »') ?></h1>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
<div class="clear"></div>
</div>
<!-- [END] #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Maybe my placement of the code is incorrect?
huh...
change your permalinks structure under your admin panel and see if the problem follows it...
Changed it to month and name and problem still is still there.
change it to standard or default or whatever the term is, if that isn't it- I'm lost too. Out of curiosity, how many posts do you have?
btw- I am trying to determine if it is a permalinks issue, which some servers don't like for some reason...
There are 26 posts.
Thanks for the help.
I'm trying to do the exact same thing. I adding in the line of code, they show up fine, but when you click on them the same page shows up. It doesn't bring up older posts. Anyone have any ideas?
I don't know the Hemingway theme, but if it has a query to pull in content (like in the index.php file, and it has something like "query_posts" or "$something = new WP_query(yadda stuff here)" before the loop, then the Next previous posts will not work. That's a downfall of using queries to pull in other content.
ShishaLover
Member
Posted 4 years ago #
Doodlebee, that's it!
In Hemingway's index.php, remove the following code:
<?php
// Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
query_posts('showposts=1');
?>
Then set the number of posts per page in your regular blog settings and add the following code to your index.php file:
<?php posts_nav_link(' — ', __('« Older Posts'), __('Newer Posts »')); ?>
That worked for me.
pixyldes
Member
Posted 4 years ago #
OP,
I suspected as soon as I read your problem that it had something to do with query_posts. I just discovered this problem yesterday on a version of the Cutline theme for a site I'm designing.
No idea why this happens, but it was solved by setting the number of posts through wp-admin in Dashboard > Settings.