Support » Fixing WordPress » alphabetical next/previous

  • Resolved deadlycomputer


    Here’s my situation:
    I have a category – Work.
    In that category are 20 or so posts currently.
    I have them displayed alphabetically on that category page all fine.
    My problem is this:
    When I click on the post, and view it’s page, the next/previous links are in chronological order.
    How can I get those in alphabetical order?

Viewing 2 replies - 1 through 2 (of 2 total)
  • well, I was able to make a custom function to do what i wanted:

    function nextLinks($tp)
    	$wp2 = array();
    	$pOrder = array(
    			'category_name'         =>	'work',
    			'orderby'		=>	'title',
    			'order'			=>	'ASC',
    			'nopaging'		=>	true,
    			'posts_count'	=>	5
    	$workPosts = get_posts($pOrder);
    	foreach($workPosts as $wpost)
    		$pid = $wpost->ID;
    		$wp2[$i] = $pid;
    	$pnum = array_search($tp,$wp2);
    	if($pnum-1 >= 0)
    		$pre = '<a href="'.get_permalink($wp2[$pnum-1]).'" title="'.get_the_title($wp2[$pnum-1]).'" class="floatLeft"><'.get_the_title($wp2[$pnum-1]).'</a>';
    	if($pnum+1 < count($wp2))
    		$nxt = '<a href="'.get_permalink($wp2[$pnum+1]).'" title="'.get_the_title($wp2[$pnum+1]).'" class="rightArrow">'.get_the_title($wp2[$pnum+1]).'></a>';
    	echo $pre . $nxt;

    if there’s a simpler, or built in way to do what i want i’d love to know

    Just found a plugin which does this and also provides more customisation features for Next/Previous links. It’s called ‘Next/Previous Post Links Plus’ and it’s by Ambrosite.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘alphabetical next/previous’ is closed to new replies.