Using dividers in menu navigation – where to add code?

This is one of the code i have used in the past. The below code goes in your functions.php class MP_Footer_Menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { STATIC $counter = 0; if ($counter++) $output .= ‘<li class=”divider”>/</li>’; parent::start_el($output, $item, $depth, $args, $id); } } This … Read more

Previous & Next on Index Page broken

I had the exact same problem a while ago on one of my themes. My problem was that the theme used query_post to filter out some posts. This caused the pagination to fail. I think this was the code that solved it: <?php if ( is_home() ) { $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; … Read more

Trouble with wp_nav_menu, conditional tags and fallback_cb

Ideally, you should be passing the “theme_location” argument to wp_nav_menu(). Register your three menus in functions.php: register_nav_menus( array( ‘front_page’ => ‘Front Page Menu’, ‘single’ => ‘Single Post Menu’, ‘default’ => ‘Default Menu’ ) ); Then, replace your code above with: if ( is_front_page() ) { wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘front_page’ )); } … Read more

Break apart wp_list_pages in order to customise it

This is one of those question where solid answer is not an easy one to follow. This function is powered by Walker_Page class and you can replace it with your own walker (extended from Walker_Page or just Walker) by passing its name in walker argument to wp_list_pages(). In a nutshell it is very highly flexible … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)