on my site, karenmessing.com there are 3 pages that contain multiple posts. i am building a child theme using thematic.
i need help fixing the next project link that appears on each individual post page, ex: http://karenmessing.com/?p=55.
i want the next project to link to the next post within that category, for example from http://karenmessing.com/?p=55 i want the next project to link to this post
http://karenmessing.com/?p=27
at the last post in the category i would like the "next project" link to be "print projects" (to link to the next page posts).
Erez S answers:
Already fixed this for him,i had to add the thirst argument of this function and to set it to true
karenmessing comments:
which file did you edit?
the last post on the page doesnt link to the next page.
ex:
http://karenmessing.com/?p=578
should say "WEB PROJECTS" where "NEXT PROJECT" appears on the other posts.
Erez S comments:
i edited the single.php and i'll be able to do this for in 5 minutes from now
Erez S comments:
okay,i fixed this,now you need to edit three classes to your css :
web-projects , print-projects , identity-projects
each one is for the links to the categories on the last page in the category
karenmessing comments:
i see the changes but the print projects identity projects and web projects do not link to their respective pages.
print projects should link to this page http://karenmessing.com/?page_id=68 etc
Erez S comments:
ok,i added the links,now you need to style them with css
Erez S comments:
ok,i did the style for you,now everything works great :)
Utkarsh Kukreti answers:
Could you post the current code used to generate that part of the page?
karenmessing comments:
this is my single.php code
<?php
global $options;
foreach ($options as $value) {
if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
else { $$value['id'] = get_option( $value['id'] ); }
}
?>
<?php get_header() ?>
<div id="container">
<div id="project">
<div id="title"> <?php get_custom_field('title', TRUE); ?> </div>
<div id="description"> <?php get_custom_field('details', TRUE); ?> </div>
<div id="singlepostnav">
<div id="count"> <?php get_custom_field('count', TRUE); ?> </div>
<div id="slidenav"> <?php get_custom_field('slidenav', TRUE); ?> </div>
</div>
<div id="nav-below" class="navigation">
<!--
<div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav"></span> previous project') ?></div>
<div class ="thumbnails"> |</div>
-->
<div class="nav-next"><?php next_post_link('%link', ' <span class="meta-nav"> </span>') ?></div>
</div>
</div>
<div id="post">
<?php the_post(); ?>
<?php thematic_navigation_above();?>
<?php get_sidebar('single-top') ?>
<div id="single">
<?php thematic_singlepost() ?>
</div>
</div>
<?php get_sidebar('single-insert') ?>
<?php thematic_comments_template(); ?>
<?php get_sidebar('single-bottom') ?>
</div><!-- #content -->
</div><!-- #container -->
<?php thematic_sidebar() ?>
<?php get_footer() ?>
Dan Fraticiu answers:
This should work:
<?php next_post_link('%link', 'Next Project', true); ?>
Later Edit: more precise
<div class="nav-next"><?php next_post_link('%link', ' <span class="meta-nav"> </span>', true) ?></div>
Dan Fraticiu comments:
<div class="nav-previous"><?php previous_post_link('%link', ' <span class="meta-nav"> </span>', true) ?></div>
<div class="nav-next"><?php next_post_link('%link', ' <span class="meta-nav"> </span>', true) ?></div>
Note that if the post is the last in it's category, the link will not show. Also if it's the first previous will not show. Hope that helps.