Title: logan_x's Replies | WordPress.org

---

# logan_x

  [  ](https://wordpress.org/support/users/logan_x/)

 *   [Profile](https://wordpress.org/support/users/logan_x/)
 *   [Topics Started](https://wordpress.org/support/users/logan_x/topics/)
 *   [Replies Created](https://wordpress.org/support/users/logan_x/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/logan_x/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/logan_x/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/logan_x/engagements/)
 *   [Favorites](https://wordpress.org/support/users/logan_x/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Next/Previous Post URL only](https://wordpress.org/support/topic/nextpreviews-post-url-only/)
 *  Thread Starter [logan_x](https://wordpress.org/support/users/logan_x/)
 * (@logan_x)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/nextpreviews-post-url-only/#post-1413198)
 * Those are for pages.
 * I tried to make the function code for posts, but it still doesn’t work.
 * Here goes the code I made:
 *     ```
       $postlist = get_posts();
       $posts = array();
       foreach ($postlist as $post) {
       	$posts[] += $post->ID;
       }
   
       $current = array_search($post->ID, $posts);
       $prevID = $posts[$current-1];
       $nextID = $posts[$current+1];
   
       // Link for previous post
       if (!empty($prevID)) {
       	echo '<div><a href="'. get_permalink($prevID) .'?variable=true">Msg. Anterior</a></div>';
       }
   
       // Link for next post
       if (!empty($nextID)) {
       	echo '<div><a href="'. get_permalink($nextID) .'?variable=true">Pr&oacute;xima Msg.</a></div>';
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Next/Previous Post URL only](https://wordpress.org/support/topic/nextpreviews-post-url-only/)
 *  Thread Starter [logan_x](https://wordpress.org/support/users/logan_x/)
 * (@logan_x)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/nextpreviews-post-url-only/#post-1413141)
 * Anyone, please?

Viewing 2 replies - 1 through 2 (of 2 total)