Edmond FAQ and Tips and Tricks

From IThemes Codex
Revision as of 05:50, September 9, 2010 by Ronald (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Child themes for the Edmond theme

In order to preserve your original theme, you can use Child Themes to apply modifications to your Edmond theme, without having to modify any of the original theme files.

Download one of the Child themes for Edmond listed below. Unzip and upload the Child Theme to your themes folder, and activate it, just as you would activate any other theme. It is assumed that your base Edmond theme is located in a folder named "Edmond-Blue", "Edmond-Brown", "Edmond-Grey" or "Edmond-Steelblue" (case sensitive, depending on the version you're using).

How to enable WordPress 3 navigation using a Child Theme

The child themes listed above contain all the required modifications to enable WordPress 3 navigation in Edmond.

How to enable WordPress 3 navigation manually

Alternatively, you can apply the changes manually to each file, and follow the steps listed below. Make a backup copy of the theme files that you will be changing, in case the result is not as expected.

modify functions.php

Add the following code to your functions.php

// register navigation menus if WordPress version supports it
add_action( 'init', 'ithemes_register_menu' );
function ithemes_register_menu() {
    if ( function_exists( 'register_nav_menu' ) ) {
        // Add 3.0+ menu support
        add_theme_support( 'menus' );
        // This theme uses wp_nav_menu() in one location.
    register_nav_menu( 'primary', __( 'Primary Menu' ) );
    }
}

add_action( 'wp_print_scripts', 'ithemes_add_scripts' );
function ithemes_add_scripts() {  ?>

<script type='text/javascript'>
    jQuery(document).ready(function() {
        $(" #menu ul").css({display: "none"}); // Opera Fix
        $(" #menu li").hover(function(){
        jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(440);
        },function(){
        jQuery(this).find('ul:first').css({visibility: "hidden"});
        });
    });
</script>
<?php }

if ( ! function_exists( 'wp_nav_menu' ) ) {
    function wp_nav_menu( $args ) {
            call_user_func( $args['fallback_cb'] );
    }
}

function ithemes_navigation() {
    wp_nav_menu( array('theme_location' => 'primary', 'container' => 'div', 'container_id' => 'menu', 'fallback_cb' => 'ithemes_render_menu'));
 }

function ithemes_render_menu() {
    wp_page_menu(); //takes default arguments from functions.php
}

modify header.php

Replace, towards the end of the header.php file:


<?php wp_page_menu(); ?>

with


<?php ithemes_navigation(); ?>

Back to the main Edmond page

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox