define css class in functions.php

First off, the origin of the data (WordPress theme options) aside, this question is pretty much about generic PHP and CSS. That being said, here’s how: PHP Stylesheet Add a new file to your theme, call it “dynamic_styles.php” or the like. Note that while it will contain mostly CSS, you give it a .php file … Read more

How to get or know the slug of home.php

Use is_home() for the home page (the list of newest blog posts), and is_front_page() for the front page (can be a static page too). if( is_home() ) { wp_nav_menu( array( ‘menu’ => ‘Main Nav Menu’, ‘container’ => ” ) ); }

Automatically Generated Menu pages

There are two major things you need check for to resolve this. If your site is using the WordPress menus, then under Appearance | Menus is a checkbox that if ticked will automatically add all new top-level pages to the menu. Unticking that box will stop the behavior. If you check that area and no … Read more

How Can I add a menu to the theme from withen the function.php file

I think your current call to wp_nav_menu() may be echoing the menu when the code is seen and not returning it in the function. Try this call: wp_nav_menu( array( ‘theme_location’ => ‘legal_footer_navigation’, ‘echo’ => false, ) ); If that works, you can also probably remove the echo parameter from the register_nav_menus() call.

Admin Menu Hack (Left side in Dashboard)

Menu items are added to the left hand dashboard menu with a few different functions, depending on where you want it to display. You will probably want to use add_menu_page. The last parameter of this function will determine how far up/down it displays. These are the defaults that you can position your item around: Positions … Read more

Adding Pipes to Menu Output

You could build a custom Walker that would either not insert that on the last field or insert classes you could use, but if this is the only change you want that would be overkill. Hide it with CSS. Something like… .menu li:last-child .navSep { display:none; } I guessed at the CSS but that is … Read more