Title: edit navigation system
Last modified: August 22, 2016

---

# edit navigation system

 *  [vl4d](https://wordpress.org/support/users/vl4d/)
 * (@vl4d)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-navigation-system/)
 * hi…
    i have this code in my theme for navigation and is ok but i want to add ‘
   orderby’ => ‘title’, and is not working why??
 *     ```
       <?php $auto_load_same_cat= ot_get_option('auto_load_same_cat');
   
       				if($auto_load_same_cat=='1'){?>
                           <div class="player-button">
                               <div class="prev-post same-cat"><?php next_post_link('%link','<i class="fa fa-chevron-left"></i>',TRUE,'') ; ?></div>
                               <div class="next-post same-cat"><?php previous_post_link('%link ','<i class="fa fa-chevron-right"></i>',TRUE,''); ?></div>
                          </div>
                           <?php
       				}else
       				 if($auto_load_same_cat=='0' || $auto_load_same_cat=='' ){?>
                            <div class="player-button">
                            <?php
                               $test = "";
                               $posttags = get_the_tags();
                               if ($posttags) {
                               foreach($posttags as $tag) {
                                   $test .= ',' . $tag->slug;
                               }
                               }
                               $test = substr($test, 1);
                            $args = array(
                               'post_type' => 'post',
                               'post_status' => 'publish',
                               'tag' => $test,
                            );
                            $current_key = $next = $previous= '';
                            $tm_query = get_posts($args);
                            foreach ( $tm_query as $key => $post ) : setup_postdata( $post );
                               if($post->ID == get_the_ID()){$current_key = $key;}
                            endforeach;
       					 $id_pre = ($tm_query[$current_key+1]->ID);
       					 $id_nex = ($tm_query[$current_key-1]->ID);
                            if($id_pre!= ''){$next = get_permalink($tm_query[$current_key+1]->ID); }
                            if($id_nex!= ''){$previous = get_permalink($tm_query[$current_key-1]->ID);}
                            ?>
       ```
   

The topic ‘edit navigation system’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [vl4d](https://wordpress.org/support/users/vl4d/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/edit-navigation-system/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
