How to get current menu item “CSS Classes” value?

Do not know if it’s exactly what you’re looking for but this short snippet adds custom classes to nav menu item : add_filter(‘nav_menu_css_class’ , ‘wpse_143574_nav_class’ , 10 , 2); function wpse_143574_nav_class($classes, $item){ $classes[] = “my-class”; } return $classes; } This could be modified with some conditional tags too. EDIT: $item is often useful for example … Read more

Next/previous a-like single navigation

After some additional research it looks like it will require to use two separate methods to get next/previous page/post to work. More here,here and here Solution for pages: <?php $pagelist = get_pages(‘sort_column=menu_order&sort_order=asc’); $pages = array(); foreach ($pagelist as $page) { $pages[] += $page->ID; } $current = array_search(get_the_ID(), $pages); $prevID = $pages[$current-1]; $nextID = $pages[$current+1]; ?> … Read more

Theme: Twenty Thirteen Mobile Sliding Menu Doesn’t Bump Content Down

You’ve got a static height set on a block-level element: style.css:806 /** * 4.1 Site Header * —————————————————————————- */ .site-header { position: relative; background: url(http://barkleyphoto.com/_wedding/wp-content/uploads/2014/05/cropped-header-background.jpg) no-repeat scroll top); height: 100px; } remove the height: 100px; and it should work like you expect.

Making a Custom Menu Sidebar Icon show as Current in css [closed]

This isn’t really WordPress specific, but here goes. Really, all you’re missing is applying the blue background image on .current-menu-item a. /* Default state base */ .widget_nav_menu .menu li a{ padding-left: 35px !important; background-position: 5% 50%; background-repeat: no-repeat; } /* Active state base */ .widget_nav_menu .menu .current-menu-item a, .widget_nav_menu .menu .current-menu-item a, .widget_nav_menu .menu .current-menu-parent … Read more

Display a tag before the menu list content

Put this function into your theme’s function.php file. function is_tree($pid) { // $pid = The ID of the page we’re looking for pages underneath global $post; $anc = get_post_ancestors( $post->ID ); foreach($anc as $ancestor) { if(is_page() && $ancestor == $pid) { return true; } } if(is_page()&&(is_page($pid))) { return true; /*we’re at the page or at … Read more