Change sub-menu css class

if you don’t want to use a custom menu walker, you can use the classes wp already puts out. If you add a class to the menu item you know will have a extra ul, you’ll have something like this <ul> <li class=”menu-item menu-item-1″>Item 1</li> <li class=”menu-item menu-item-2″>Item 2</li> <li class=”sub-1 menu-item menu-item-3″>Item 3 <ul … Read more

Change the class of wordpress menu

This will add class sub-menu-0, sub-menu-1 and so on depending upon their depth. //This will go in functions.php file class wpse61220_submenu_class extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(“\t”, $depth); $output .= “\n$indent<ul class=\”sub-menu-“.$depth.”\”>\n”; } } // Usage – // wp_nav_menu( array(‘walker’ => new wpse61220_submenu_class() ) ); Reference – function wp_nav_menu()

Loop issues when creating custom query for media uploader

I’m not entirely sure why the get_posts() function works instead of creating a new instance of WP_QUERY. From what I understand about how WordPress queries work, get_posts() is actually creating it’s own instance of WP_QUERY anyhow. Either way, here is the solution that I’m using currently. <?php //GET THE PHOTOGRAPHERS $args = array( ‘post_type’ => … Read more

Need rewrite for URL with specific string

You should solve this at the plugin level. While this rewrite rule … RewriteRule (.*)/?mysite.com/(.*) /$1/$2 [L,R=301] RewriteRule ^(.*)THUMB /$1 [L,R=301] … does what you are asking for, it is just cosmetic. Find the code that creates the wrong URL and fix that. Give the plugin author feedback; I’m sure s/he wants to know about … Read more

Return Custom Post Type Categories

When you add a custom taxonomy to a WordPress theme, you can display its content using one of WordPress’ taxonomy theme templates taxonomy-{taxonomy}-{slug}.php We could use this to create a theme template for a particular location, such as taxonomy-taxonomyname-termslug.php for the term “boston.” taxonomy-{taxonomy}.php If the taxonomy were location, WordPress would look for taxonomy-location.php. taxonomy.php … Read more

multiple taxonomies in wp_list_categories’ $args

Have you noticed in the list all of valid Parameters for wp_list_categories() function that taxonomy doesn’t accept input as array, thats why you are not supposed to pass an array to it. If you still want to be able to show terms of two different taxonomies, use get_terms() WordPress function instead. The only bad is … Read more