• 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.