Two-tone menu items

Hi @cannyboy: Unless I misunderstand, I think what you need is to use ‘the_title’ filter. If you simplly enter “Title 1 * Title2” into your title field, this code I’ve written for this hook should wrap your Title2 in a <span class=”title2″> which will allow you to style it with CSS. You can put the … Read more

Using wp_list_pages() after calling query_posts()

This is for future askers, Whenever you use query_posts or custom wp_query you should add wp_reset_query(); after your loop or when you are done processing your posts. This little line of code will help in solving pagination issues or in your case rest the global $post the original as before your query.

wp_list_pages sort order by custom nav menu order

Using wp_list_pages you can sort order only by: ‘post_title’ ‘menu_order’ ‘post_date’ ‘post_modified’ ‘ID’ ‘post_author’ ‘post_name’ anything else (like order by custom menu order) you would have to write your own function. But a better way to get it done would be to create a custom walker for it so you could control the output.

Count within foreach loop

Insert a new $counter variable before the foreach loop starts, and at the very end of the loop, call $counter++ to increment the number. In the middle, just echo out the $counter variable. <?php $pages = get_children(array(‘orderby’ => ‘menu_order’, ‘order’ => ‘asc’)); // Add a counter before foreach starts $counter = 1; foreach($pages as $post) … Read more

How to get rid of the home link in nav menu?

it shows the home link cause you don’t have anything set yet… go to your functions.php and add this code add_theme_support( ‘menus’ ); if ( function_exists( ‘register_nav_menus’ ) ) { register_nav_menus( array( ‘header_menu’ => ‘Header Menu’ ) ); } endif; Go to Apparence and then get into Menu option… Create a menu set the pages/links/categories … Read more

a better menu, menu options assistance for WP

This appears to be a CSS related issue. You need to clear:both your <li> elements which contain your <a href=links…> Make sure you apply that clear property to your sub-menu <li> elements only and not your top level parent items. Without knowing or seeing the exact theme you are working with, be it custom or … Read more

How to style a specific nav menu item?

To address a specific menu item in your stylesheet you can either use its id attribute (here: li#menu-item-230) or add a CSS class. I like the second option, that is more flexible. Sample code for your theme’s functions.php: add_filter( ‘nav_menu_css_class’, ‘wpse_65375_class_by_title’, 10, 2 ); /** * Make the title a CSS class. * * @wp-hook … Read more