Removing strip_tags not working on nav_menu_description

in a new wordpress version, the remove_filter isn’t enough, cause the desc is stripped hardcoded from post_content … this will do the trick: remove_filter(‘nav_menu_description’, ‘strip_tags’); add_filter( ‘wp_setup_nav_menu_item’, ‘cus_wp_setup_nav_menu_item’ ); function cus_wp_setup_nav_menu_item($menu_item) { $menu_item->description = apply_filters( ‘nav_menu_description’, $menu_item->post_content ); return $menu_item; }

Menus like a CMS

3 ideas: Create the empty parent pages and use a redirect plugin to redirect all requests from these pages to the children. Inside the menu options page insert a custom link and link to the desired child page. At the top of your template – lets say page.php – test if children for this page … Read more

Multiple menu items highlighted

This question was also asked on stackoverflow. Here’s a copy of the answer i gave there: Perhaps you could style it using the nth-of-type CSS3 selector. .current-menu-item:nth-of-type(1) { background:#ffff00; /* Highlight styles */ } These styles would target only the first occurrence of the .current-menu-item. Likewise, you could choose to target the second with nth-of-type(2), … Read more

Recreating the hierarchy of taxonomies for a dropdown form menu?

You can use the standard WordPress function, get the dropdown already formatted and solve both problems at once. Like so: define( ‘WP_USE_THEMES’, false ); require( ‘./wp-load.php’ ); wp_dropdown_categories( array( ‘child_of’ => 0, ‘class’ => ‘postform’, ‘depth’ => 0, ‘echo’ => 1, ‘exclude’ => ”, ‘hide_empty’ => false, ‘hide_if_empty’ => false, ‘hierarchical’ => true, ‘id’ => … Read more

How use %like% in sql statement wordpress

$wpdb->prepare() doesn’t actually fully support sprintf() placeholders. From the Codex: The query parameter for prepare accepts sprintf()-like placeholders. The %s (string), %d (integer) and %f (float) formats are supported. It’s not entirely obvious from that but the argument swapping formats (e.g. %1$d) are not supported (in any case you have the incorrect syntax: it should … Read more

How to quickly create a dummy menu?

Why not make it just once, then use that database for all your development sites? http://codex.wordpress.org/Theme_Unit_Test This has a link to a test database you can import (XML I believe), which has a few menus if I’m not mistaken.

items_wrap not working

your problem is in your use ‘menu_class’ and ‘items_wrap’ not synchronized. You can edit : wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘container’ => ”, ‘echo’ => ‘0’, ‘menu_class’ => ‘nav-menu horiz-menu container sixteen columns’, ‘items_wrap’ => ‘<ul class=”%2$s”>%3$s</ul>’ ) ) or: wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘container’ => ”, ‘echo’ => ‘0’, ‘items_wrap’ => ‘<ul class=”nav-menu … Read more

Highlight current category, when using get_categories

I have solved my problem. I added this definition before my old code: <?php // get the category object for the current category $thisTrueCat = get_category( get_query_var( ‘cat’ ) ); print $thisTrueCat->term_id; ?> The above $thisTrueCat, different from $thisCat in the already existing code, retrieves the ID of the current category regardless of it’s parent. … Read more