exclude pages in custom menu

You probably want to explode your list of page ID’s using the explode function. Something like; <?php $exmenuitems = explode(“,”,get_option(‘exmenuitems’)); $recentPosts = new WP_Query(); $recentPosts->query (array ( ‘post__not_in’ => $exmenuitems, ‘post_type’ => ‘page’, ‘showposts’ => $menuitems )); I’d recommend using the WordPress Menu building functions and admin interface. Its much more intuitive for end users … Read more

Recent Posts widget missing current_menu_item class

The core Recent Posts Widget does not output any classes for the current post – probably because the Widget semantically is a list of posts, rather than a navigation menu, and therefore has no intended purpose to reflect current location. That said, with a bit of CSS/jQuery trickery, you could target the current post by … Read more

Edit the (automatic) HTML layout of nav menus

Update: The question was actually how to wrap the submenus, not the whole menu. Here are 2 options: using jQuery: <script type=”text/javascript”> // run this before the script that sets up the dropdowns: jQuery(document.ready(function($){ $(‘.sub-menu’).wrap(‘<div class=”dropdown”></div>’); }) </script> using PHP 5.3+ (slightly more complex option, but thought i’d post it): <?php $dom = DOMDocument::loadHTML(wp_nav_menu(array( ‘menu’ … Read more

add_filter for where statment issue

So first of all you’ll want to make sure that you want to and your WHERE clause in. posts_where will fire for (almost) every query so you want to be sure that you’re adding it to the right one. This can be done with the use of conditional tags. Note: The WHERE 1=1 is added … Read more

Automatically Display Sub Menu

If your developing this theme with your own html mark up and css then should be fairly easy… <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘topNav’, ‘after’ => ‘<span> </span>’ ) ); ?> You will notice this menu PHP generates a unordered list with your sub menu as a nested unordered list. See your … Read more

Submenu in sidebar custom page template

If you are trying to code this yourself, all the info you need is in the WordPress Codex – http://codex.wordpress.org/Template_Tags/wp_list_pages#List_Sub-Pages Alternatively you could use a widget like the BE Subpages Widget

changing theme folder name breaks menus – twentyeleven

Try going to Dashboard -> Appearance -> Menus and re-applying your custom menus to the appropriate Theme locations. By changing the directory name, you’ve impacted the theme_mods, including custom menus. To WordPress, /wp-content/themes/twentyeleven/style.css and /wp-content/themes/X/style.css are two different Themes, even if all the files are the same.