phpface

Video Navigation

Jun 21st, 2020
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. if( ! function_exists( 'videotube_add_video_navigation' ) ){
  2.     /**
  3.      *
  4.      * Add previous and next post links
  5.      *
  6.      */
  7.     function videotube_add_video_navigation(){
  8.        
  9.         $previous = get_previous_post_link( '« %link', '%title', true, '', 'categories' );
  10.  
  11.         $next = get_next_post_link( '%link »', '%title', true, '',  'categories');
  12.  
  13.         if( $previous || $next ){
  14.             ?>
  15.             <ul class="pager pb-4">
  16.  
  17.                 <?php if( $previous ):?>
  18.                     <li class="previous">
  19.                         <?php echo $previous;?>
  20.                     </li>
  21.                 <?php endif;?>
  22.  
  23.                 <?php if( $next ):?>
  24.                     <li class="next">
  25.                         <?php echo $next;?>
  26.                     </li>
  27.                 <?php endif;?>
  28.  
  29.             </ul>
  30.             <div class="clearfix"></div>
  31.             <?php
  32.         }
  33.     }
  34.  
  35.     add_action( 'videotube_after_video', 'videotube_add_video_navigation', 10 );
  36. }
Add Comment
Please, Sign In to add comment