Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .current-menu-item > a{
- background-color:#123456;
- }
- .menu-item:hover > a{
- background-color:#123456;
- color: white;
- }
- .current-menu-item > a{
- background-color:#123456;
- }
- .current-menu-item:hover{
- background-color:#123456;
- color: white;
- }
- /* This targets the current page's menu item */
- .current-menu-item > a{
- background-color:#123456;
- color: white;
- }
- /* This targets other menu items when you hover over them */
- .menu-item:hover > a{
- background-color:#123456;
- color: white;
- }
- .menu-item.current-menu-item > a{
- background-color:#123456;
- color: white;
- }
- function enqueue_custom_style() {
- <--- enqueue custom stylesheet --->
- }
- add_action( 'wp_enqueue_scripts', 'enqueue_custom_style', 999 );
- <?php
- $args = array(
- 'order' => 'ASC',
- 'orderby' => 'menu_order',
- 'post_type' => 'nav_menu_item',
- 'post_status' => 'publish',
- 'output' => ARRAY_A,
- 'output_key' => 'menu_order',
- 'nopaging' => true,
- 'update_post_term_cache' => false );
- $items = wp_get_nav_menu_items( 'my manu', $args );
- $page_url = get_permalink();
- foreach($items as $item ) :
- ?>
- <li <?php if($item->url == $page_url){?>class="active"<?php }?>><a href="<?php echo $item->url;?>"><?php echo $item->title;?></a></li>
- <?php endforeach;?>
- <!-----------------------------Dynamic manu end---------------------------------------------------->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement