WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] change %link (2 posts)

  1. rubyfall
    Member
    Posted 2 years ago #

    At my site (http://herfstmedia.nl/), I've got previous_post_link and next_post_link for all posts. I've got a list of all posts from 1 catagory (http://herfstmedia.nl/?cat=1) that brings the reader to a singele post (http://herfstmedia.nl/?p=1078&cat=1) and previous_post_link and next_post_link in the same catagory. So far so good, but the link will go to a singelpost that has no previous_post_link and next_post_link in the same catagory, because the %link is missing "&cat=1" at the end. Is it possible to change the outcome of %link so that both GET parameters are in there (http://herfstmedia.nl/?p=1063&cat=1 and http://herfstmedia.nl/?p=1114&cat=1)

  2. rubyfall
    Member
    Posted 2 years ago #

    [ Moderator note: it's the backtick and not the double quote for code snippets. ]

    After this question, I have made it with php itself (I know it is to program it nicer, but it works for now, as to see under this:

    <div id="Laatste"  style="top:80px;">
                <div id="faceknop">
    		<?php query_posts('showposts=1000&cat=' . $cat); ?>
            <?php $num = 0;
    		$Pnumtje = 0;
    		?>
    
            <?php 	while (have_posts()): the_post(); ?>
            <?php $num = 1 + $num; ?>
    		<?php
    				if ($id != $pxa) {
    				  $Pnumtje = $Pnumtje;
    				  } else {
    				  $Pnumtje = $num;
    				}
    		?>
    		<?php endwhile; ?>
    
    		<?php query_posts('showposts=1000&cat=' . $cat); ?>
            <?php $numb = 0;
    		$Pnumtjeb = $Pnumtje - 1;
    		$Pnumtjec = $Pnumtje + 1;
    				  $IDplus = 0;
    				  $IDmin = 0;
    		?>
    
            <?php 	while (have_posts()): the_post(); ?>
            <?php $numb = 1 + $numb; ?>
    
    		<?php
    				if ($Pnumtjec != $numb ) {
    				  $IDmin = $IDmin;
    				  $IDplus = $IDplus;
    
    				} else {
    				  $IDmin = $id;
    				  $IDplus = $IDplus;
    				  }
    
    				if ($Pnumtjeb != $numb ) {
    				  $IDmin = $IDmin;
    				  $IDplus = $IDplus;
    
    				} else {
    				  $IDmin = $IDmin;
    				  $IDplus =  $id;
    				  }
    		?>
    
            <?php endwhile; ?>
    
            <?php if ($IDmin > 0 ) { ?>
    
    <a>&cat=<?php echo $cat; ?>" target="_top">◄ouder:</a></B> 
    
            <?php } else { ?>
    			 
            <?php }?>
    
                 </div>
            <div id="publdatum">
            <?php if ($IDplus > 0 ) { ?>
    
                <a>&cat=<?php echo $cat; ?>" target="_top">nieuwer►</a></B>
    
            <?php } else { ?>
    			 
            <?php }?>
            </div>
    
            </div>

Topic Closed

This topic has been closed to new replies.

About this Topic