wp_update_nav_menu_item() to insert categories

After using the Chrome inspector on the “Appearance > Menus” categories panel I was able to sniff out the hidden form values that are passed when one manually adds a category to a custom menu via the wizard: <li> <label class=”menu-item-title”> <input type=”checkbox” class=”menu-item-checkbox” name=”menu-item[-11][menu-item-object-id]” value=”181″> Category One</label> <input type=”hidden” class=”menu-item-db-id” name=”menu-item[-11][menu-item-db-id]” value=”0″> <input type=”hidden” … Read more

Changing the visible url path to css & js files

Offhand I think you’d need two things: First, a rewrite rule in your .htaccess file like so: RewriteEngine On RewriteBase / RewriteRule ^css/(.*) /wp-content/themes/theme-name/css/$1 [L] RewriteRule ^js/(.*) /wp-content/themes/theme-name/js/$1 [L] Second, add a filter to your theme’s functions.php like so: function change_css_js_url($content) { $current_path=”/wp-content/themes/theme-name/”; $new_path=”https://wordpress.stackexchange.com/”; // No need to add /css or /js here since you’re … Read more

Twenty Eleven home page show only excerpt

The template you’re actually after is “content.php” You’ll want to change this line: <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class=”entry-summary”> <?php the_excerpt(); ?> </div><!– .entry-summary –> <?php else : ?> <div class=”entry-content”> <?php the_content( __( ‘Continue reading <span class=”meta-nav”>&rarr;</span>’, ‘twentyeleven’ ) ); ?> <?php wp_link_pages( array( ‘before’ … Read more