Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. .current-menu-item > a{
  2. background-color:#123456;
  3. }
  4. .menu-item:hover > a{
  5. background-color:#123456;
  6. color: white;
  7. }
  8.  
  9. .current-menu-item > a{
  10. background-color:#123456;
  11. }
  12.  
  13. .current-menu-item:hover{
  14. background-color:#123456;
  15. color: white;
  16. }
  17.  
  18. /* This targets the current page's menu item */
  19. .current-menu-item > a{
  20. background-color:#123456;
  21. color: white;
  22. }
  23.  
  24. /* This targets other menu items when you hover over them */
  25. .menu-item:hover > a{
  26. background-color:#123456;
  27. color: white;
  28. }
  29.  
  30. .menu-item.current-menu-item > a{
  31. background-color:#123456;
  32. color: white;
  33. }
  34.  
  35. function enqueue_custom_style() {
  36. <--- enqueue custom stylesheet --->
  37. }
  38.  
  39. add_action( 'wp_enqueue_scripts', 'enqueue_custom_style', 999 );
  40.  
  41. <?php
  42.  
  43. $args = array(
  44. 'order' => 'ASC',
  45. 'orderby' => 'menu_order',
  46. 'post_type' => 'nav_menu_item',
  47. 'post_status' => 'publish',
  48. 'output' => ARRAY_A,
  49. 'output_key' => 'menu_order',
  50. 'nopaging' => true,
  51. 'update_post_term_cache' => false );
  52.  
  53. $items = wp_get_nav_menu_items( 'my manu', $args );
  54. $page_url = get_permalink();
  55. foreach($items as $item ) :
  56. ?>
  57. <li <?php if($item->url == $page_url){?>class="active"<?php }?>><a href="<?php echo $item->url;?>"><?php echo $item->title;?></a></li>
  58. <?php endforeach;?>
  59. <!-----------------------------Dynamic manu end---------------------------------------------------->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement