How to remove class attributes from custom menu markup?

You can use the nav_menu_css_class filter to remove the classes that you want from your menu-item. See the example below, to remove ALL the CSS classes that are appended to you menu items: add_filter(‘nav_menu_css_class’,’remove_nav_menu_classes’); function remove_nav_menu_classes($classes) { return array(); } Do a print_r($classes) if you want to know which classes are active in your menu.

Second menu not showing

You need to pass an array of menus to the register_nav_menu function like so: register_nav_menus( array( ‘menu-1’ => ‘Menu Top’, ‘menu-2’ => ‘Menu Bottom’ ) ); You then call them in your theme: <?php wp_nav_menu( array( ‘theme_location’ => ‘menu-2’ ) ); ?>

Theme change only in CSS and a few images

I would create a Theme Option for Color Scheme, then split out the color-scheme-specific CSS declarations into separate CSS files (e.g. blue.css, green.css, red.css, etc.). Then, you simply enqueue the appropriate color-schme stylesheet, based on the Theme Option. e.g.: function mytheme_enqueue_color_scheme_stylesheet() { $theme_options = get_option( ‘theme_mytheme_options’ ); $colorscheme = $theme_options[‘color_scheme’]; $stylesheet = $colorscheme . ‘.css’; … Read more

How to display recent posts on home page with custom HTML

<div id=”posts”> <?php // define query arguments $args = array( ‘posts_per_page’ => 8, // your ‘x’ goes here ‘nopaging’ = true // possibly more arguments here ); // set up new query $tyler_query = new WP_Query( $args ); // loop through found posts while ( $tyler_query->have_posts() ) : $tyler_query->the_post(); echo ‘<section class=”post”>’. ‘<h2><a href=”‘. get_permalink(). … Read more

How to determine which custom header image is being shown

For the TwentyEleven theme, you can place this above your BODY tag in header.php. The theme will recognize that $header_image is already set, so no other mods would be necessary. $header_image = get_header_image(); $image = basename($header_image); $image = explode(‘.’,$image); $class=”header-image-“.$image[0]; Add the $class parameter to the body_class function to insert your header image class. body_class($class);

How do I get the next page of posts link?

Why build the link yourself, when you can just add the class to the result of get_next_posts_link()? add_filter(‘next_posts_link_attributes’,’example_add_next_link_class’); function example_add_next_link_class($attr) { return $attr . ‘ class=”example-class”‘; } Now the link sent back by get_next_posts_link() will have your class in it.