WPIntell

Source evidence

Prev Next post link not ordered

Anything Order · support · 2015-06-26T07:42:00+00:00

complaintsentiment
mediumseverity
0.8relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 31 rows with source links

16.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
marco87x unresolved
Prev and Next post links do not follow the order set with this plugin, an improvement would be amazing. https://wordpress.org/plugins/anything-order/ Hi @marco87x , same problem here, did you find any workaround??? I solved finally this way, I put here if anyone needs it (the code may be not perfect) <? //Variables $currentID = get_the_ID(); $prevID; $nextID; $allID = array(); //Create a query $theQuery = new WP_Query( 'post_type=post' ); //Create the array with all the ID's while ( $theQuery->have_posts() ) { $theQuery->the_post(); array_push($allID, get_the_ID()); } //Check lenght of the array $allIDlenght = count($allID) - 1; //Check our actual ID position on the array $position = array_search($currentID, $allID); //If it's in the first position if($position === 0){ $prevID = $allID[$allIDlenght]; $nextID = $allID[1]; //If it's in the last one }else if($position === $allIDlenght){ $prevID = $allID[$allIDlenght-1]; $nextID = $allID[0]; }else{ $prevID = $allID[$position-1]; $nextID = $allID[$position+1]; } ?> Hi, I’m having the same issue – my previous/next buttons to skip from one post to another don’t reflect the Anything Order plugin order of posts. I tried putting the above code in my functions.php but this didn’t do anyhting – should it go somewhere else? Here’s what me previous next links looks like: `<div class=”next_prev_cont”> <div class=”left”> <?php previous_post_link(‘%link’, ‘Previous<br />%title’, TRUE); ?> </div> <div class=”right”> <?php next_post_link(‘%link’, ‘Next<br />%title’, TRUE); ?> </div> <div class=”clear”></div>` @adrianperez have been struggling with this problem all day and this is a fantastic solution – thank you! Slight amends I made is WP_Query should have posts_per_page defined also needs a wp_reset_postdata(); to close.

Comments

4 shown
adrianperez 2015-07-22T14:53:00+00:00

Hi @marco87x , same problem here, did you find any workaround???

adrianperez 2015-08-17T06:46:00+00:00

I solved finally this way, I put here if anyone needs it (the code may be not perfect) <? //Variables $currentID = get_the_ID(); $prevID; $nextID; $allID = array(); //Create a query $theQuery = new WP_Query( 'post_type=post' ); //Create the array with all the ID's while ( $theQuery->have_posts() ) { $theQuery->the_post(); array_push($allID, get_the_ID()); } //Check lenght of the array $allIDlenght = count($allID) - 1; //Check our actual ID position on the array $position = array_search($currentID, $allID); //If it's in the first position if($position === 0){ $prevID = $allID[$allIDlenght]; $nextID = $allID[1]; //If it's in the last one }else if($position === $allIDlenght){ $prevID = $allID[$allIDlenght-1]; $nextID = $allID[0]; }else{ $prevID = $allID[$position-1]; $nextID = $allID[$position+1]; } ?>

salpilk 2015-09-22T14:41:00+00:00

Hi, I’m having the same issue – my previous/next buttons to skip from one post to another don’t reflect the Anything Order plugin order of posts. I tried putting the above code in my functions.php but this didn’t do anyhting – should it go somewhere else? Here’s what me previous next links looks like: `<div class=”next_prev_cont”> <div class=”left”> <?php previous_post_link(‘%link’, ‘Previous<br />%title’, TRUE); ?> </div> <div class=”right”> <?php next_post_link(‘%link’, ‘Next<br />%title’, TRUE); ?> </div> <div class=”clear”></div>`

arroni 2015-10-13T23:50:00+00:00

@adrianperez have been struggling with this problem all day and this is a fantastic solution – thank you! Slight amends I made is WP_Query should have posts_per_page defined also needs a wp_reset_postdata(); to close.