logo

$30
next project link

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).

karenmessing | 02/17/10 at 12:30pm | Edit


(3) Possible Answers Submitted...

  • avatar
    Last edited:
    02/17/10
    12:34pm
    Utkarsh Kukreti says:

    Could you post the current code used to generate that part of the page?

    • 02/17/10 12:40pm

      karenmessing says:

      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"> &#124;</div>
      -->

      <div class="nav-next"><?php next_post_link('%link', ' <span class="meta-nav">&nbsp;&nbsp;</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() ?>

  • avatar
    Last edited:
    02/17/10
    1:18pm
    Dan Fraticiu says:

    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">&nbsp;&nbsp;</span>', true) ?></div>

    Previous versions of this answer: 02/17/10 at 1:12pm | 02/17/10 at 1:18pm

    • 02/17/10 1:44pm

      Dan Fraticiu says:


      <div class="nav-previous"><?php previous_post_link('%link', ' <span class="meta-nav">&nbsp;&nbsp;</span>', true) ?></div>

      <div class="nav-next"><?php next_post_link('%link', ' <span class="meta-nav">&nbsp;&nbsp;</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.

  • avatar
    Last edited:
    02/17/10
    3:59pm
    Erez S says:

    Already fixed this for him,i had to add the thirst argument of this function and to set it to true

    • 02/17/10 1:32pm

      karenmessing says:


      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.

    • 02/17/10 2:16pm

      Erez S says:

      i edited the single.php and i'll be able to do this for in 5 minutes from now

    • 02/17/10 2:52pm

      Erez S says:

      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

    • 02/17/10 3:40pm

      karenmessing says:

      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

    • 02/17/10 3:51pm

      Erez S says:

      ok,i added the links,now you need to style them with css

    • 02/17/10 3:54pm

      Erez S says:

      ok,i did the style for you,now everything works great :)

This question has expired.





Current status of this question: Completed