Convert WP Menu to a Drop Down for Mobile browser

Here’s what I’ve put together from different articles/themes: files to modify: functions.php header.php style.css js (create folder “js” in theme root directory) The Javascript: jQuery(function() { jQuery(“<select />”).appendTo(“nav”); jQuery(“<option />”, { “selected”: “selected”, “value” : “”, “text” : “Go to…” }).appendTo(“nav select”); jQuery(“nav a”).each(function() { var el = jQuery(this); jQuery(“<option />”, { “value” : el.attr(“href”), … Read more

Creating a custom menu/widget area

I’m going to assume you’re using Twenty Eleven theme, or another theme that supports child themes. If you’re using a custom theme, then you can just edit the existing Functions.php and add your additional functionality there, and then edit the existing Style.css. However, if your situation is different, please post back, and I’ll update to … Read more

Date range filter for manage posts list on edit.php

WordPress support advised me you can use the same parameters on the URL as WP_Query() accepts. http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters You can’t pass a date range. The best you can do is pass specific dates. For example, edit.php?s&post_status=all&post_type=post&action=-1&m=201301&cat=0&post_format=0&paged=1&mode=list&day=1 will show all posts from the 1st day of the current month. When I told this to our content manager … Read more

Find the Children of a Page then Echo it as a Bulleted List of Links (menu)

Well you just need to run a foreach loop over your $children but WordPress has a build in function for this already called wp list pages. For example: $children = wp_list_pages(‘title_li=&child_of=”.$post->ID.”&echo=1’); if ($children) echo ‘<ul>’ . $children . ‘</ul>’; There is a full reference and examples here: http://codex.wordpress.org/Function_Reference/wp_list_pages

Where would I find Custom menu attributes in the database?

Nav menu items are posts of the type nav_menu_item. They are combined to a nav menu by an assigned term from the taxonomy nav_menu. Each nav menu is a collection of posts under a term. The function wp_get_nav_menu_items() is probably the best start to explore this. The tables {$prefix}_terms and {$prefix}_term_taxonomy are queried for the … Read more

Admin only menu/page

Yes, it is possible. You could use wp_nav_menu_objects or wp_nav_menu_items hooks to add your filter function. function my_hide_menu_items($objects) { if ( is_admin() ) return $objects; foreach ( $objects as $k=>$object ) { if ( YOUR CONDITION ) { // if $object shouldn’t be displayed unset($objects[$k]); } } return $objects; } add_filter(‘wp_nav_menu_objects’, ‘my_hide_menu_items’, 10, 2); You … Read more

Show Different Custom Menu on Different Category Pages

Add a new menu called category-menu: if( function_exists( “wp_nav_menu’ ) ) { add_theme_support( ‘nav-menus’ ); register_nav_menus( array( ‘primary-menu’ => __( ‘Primary Menu’, ‘woothemes’ ) )); register_nav_menus( array( ‘top-menu’ => __( ‘Top Menu’, ‘woothemes’ ) )); register_nav_menus( array( ‘category-menu’ => __( ‘Category Menu’, ‘woothemes’ ) )); } And output it with the conditional is_category(): if( function_exists( … Read more