• Resolved vl4d

    (@vl4d)


    Hi.. plzz can help me anyone?? i try to fix this problem in my site, i want the navigation to be order by title and not by date..

    the code

                    <div class="toolbar-right">
                    	<?php 
    					$auto_load = osp_get('ct_video_settings','auto_load_next_video');
                        
                        // find previous and next post
    					$p = videopro_get_adjacent_post_video(null, 'prev', get_post($post_id));
                        $n = videopro_get_adjacent_post_video(null, 'next', get_post($post_id));
    
    					if((empty($p) || empty($n)) && $auto_load == '2'){
                            /* if $auto_load = 2, then prev link will go to last post. Thus, we look for last post */
                            $next_previous_same = osp_get('ct_video_settings','next_prev_same');
                            $next_video_only = osp_get('ct_video_settings','next_video_only');
                            if($next_previous_same == ''){
                                $next_previous_same = 'cat';
                            }
                            
                            if(isset($_GET['series']) && $_GET['series'] != ''){
                                $next_previous_same = 'current-series';
                            }
                            
                            if(isset($_GET['channel']) && $_GET['channel'] != ''){
                                $next_previous_same = 'current-channel';
                            }
                            
    						$f_query = videopro_query_morevideo($id_curr, $next_previous_same, $next_video_only, 1, empty($p) ? 'last' : 'first');
    						if(!empty($f_query)){
    							foreach ( $f_query as $key => $post ) : 
                                    setup_postdata( $post );
                                    
                                    empty($p) ? $p = $post : $n = $post;
    							endforeach;
    							wp_reset_postdata();
    						}
    					}
    
    					if(!empty($p)){
                            $pv_link = get_permalink($p->ID);
                            
                            $pv_link = videopro_add_query_vars($pv_link);
                            
    						?>
    						<a href="<?php  echo esc_url($pv_link);?>" class="btn btn-default video-tb font-size-1 cactus-new prev-video"><i class="fa fa-chevron-left"></i><span><?php echo esc_html__( 'Prev', 'video' )?></span></a>
    					<?php 
    					}
    					if(!empty($n)){
    						$nv_link = get_permalink($n->ID); 
                            $nv_link = videopro_add_query_vars($nv_link);
    						?>
                        	<a href="<?php echo esc_url($nv_link); ?>" class="btn btn-default video-tb font-size-1 cactus-old next-video"><span><?php echo esc_html__( 'Next', 'video' )?></span><i class="fa fa-chevron-right"></i></a>
    					<?php 
                        }
    
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘change navigation code help!!’ is closed to new replies.