Advertisement
arnabkumar

navigation wp + wp-page nevi

Oct 25th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. //create a file navigation.php
  2.  
  3. ni navigation.pho add this code
  4.  
  5. <?php previous_posts_link( '<span class="meta-nav">&larr;</span> Previous', 0 ); ?>
  6.    
  7.     <?php next_posts_link( 'Next <span class="meta-nav">&rarr;</span>', 0 ); ?>
  8.  
  9. //then for add css class to a
  10.  
  11. //add this code in functions.php
  12.  
  13. //add nav a css class
  14.  
  15. add_filter('next_posts_link_attributes', 'posts_link_attributes_1');
  16. add_filter('previous_posts_link_attributes', 'posts_link_attributes_2');
  17.  
  18. function posts_link_attributes_1() {
  19.     return 'class="next_navigation"';
  20. }
  21. function posts_link_attributes_2() {
  22.     return 'class="previous_navigation"';
  23. }
  24.  
  25. //change just class name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement