Forum Replies Created

Viewing 7 replies - 16 through 22 (of 22 total)
  • Thread Starter chrisvwlc

    (@chrisvwlc)

    For anyone checking into this post, I think I must have inadvertently done something to the functions.php file in the twentyeleven folder. Replacing it with a fresh twentyeleven functions.php from a copy I downloaded fixed the problem.

    Thread Starter chrisvwlc

    (@chrisvwlc)

    Thanks esmi for your response.
    It turns out the problem was that IE doesn’t recognize the HMTL5 tags that I assumed twentyeleven had included the js fix for. Conditional comments/ie stylesheets didn’t help because the divs are nested within those unrecognized tags.
    My fix, for what it’s worth, was to add the following to functions.php in my child theme folder:

    add_action('wp_head', 'forie');
    function forie() {
    ?>
    <script>
    document.createElement('header');
    document.createElement('footer');
    document.createElement('aside');
    </script>
    <?php
    }

    chrisvwlc

    (@chrisvwlc)

    I’m having issues with IE 7 & 8, IE 9 seems to be OK – Did you ever get your issues resolved? Would you mind sharing how – this is driving me nuts!

    chrisvwlc

    (@chrisvwlc)

    and <?php _e( 'Skip to primary content', 'twentyeleven' ); ?> is ‘twentyeleven’ for anyone else thick enough to wonder. Seems obvious to me now that wp is referencing functions defined in twentyeleven’s functions.php and when I substituted my theme name I got undefined function errors.

    chrisvwlc

    (@chrisvwlc)

    GOT IT!
    (although it seems to conflict with meteor slides plugin)
    For starters:
    This is an important step that gets overlooked because it’s basic and where I was going wrong…In your wp admin panel under Appearance > Menus, create a menu called ‘Main menu’ and on the left-hand side of that page, notice the Theme Locations box – under ‘Primary Navigation’ type in ‘Main menu’ if it’s not there.
    Then: in functions.php, add the following:`$styledir = get_bloginfo(‘stylesheet_directory’);
    if (!is_admin()) {
    wp_deregister_script(‘jquery’);

    // Lets use the one from Google AJAX API instead.
    wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&#8217;, false, ‘1.4.2’);
    wp_register_script( ‘superfish’, $styledir.’/js/superfish.js’, array(‘jquery’), ‘1.4.8’);
    wp_register_script( ‘hoverIntent’, $styledir.’/js/hoverIntent.js’, array(‘jquery’,’superfish’), ‘1.4.8’);
    wp_register_script(‘jqsf’, $styledir.’/js/jqsf.js’, array(‘jquery’,’superfish’,’hoverIntent’));

    wp_enqueue_script(‘jquery’);
    wp_enqueue_script(‘superfish’);
    wp_enqueue_script(‘hoverIntent’);
    wp_enqueue_script(‘jqsf’);

    }
    }`
    NOTE: I am using a child theme of Twentyeleven so my path needs to read “stylesheet_directory” instead of “template_url”. I chose an earlier version of jquery, bc I read that was the one superfish liked. I chose to include them using wp_enqueue_script/style because I’ve read it’s the preferred method and will reduce conflicts (even though I have a conflict already…)
    ALSO NOTE: I used a js directory and a styles directory. Change your paths to wherever you are storing the .js and .css files.

    jqsf.js is a file I created that initializes superfish. Here are the contents:

    $(document).ready(function(){
    		$("ul.sf-menu").superfish({
    			pathClass: 'current',
    			delay:???????1000,???//?one?second?delay?on?mouseout?
    ????????????animation:???{opacity:'show',height:'show'},??//?fade-in?and?slide-down?animation?
    ????????????speed:???????'fast',??//?faster?animation?speed?
    		});
    	});

    So, just create jqsf.js, copu and paste and save to your js folder along with the other scripts.

    In header.php, my menu looks like yours:

    <nav id="access" role="navigation">
    <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
    <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
    <div class="skip-link">"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></div>
    <div class="skip-link">"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></div>
    <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'sf-menu sf-navbar' ) ); ?>
    </nav><!-- #access -->
    	</header><!-- #branding -->

    Thanks for the posts here!

    chrisvwlc

    (@chrisvwlc)

    Should the javascript and style sheet(s) be included using wp_enqueue_scripts/wp_enqueue_styles? Can I just import the style sheet to my child theme’s stylesheet? (i.e. @import url("/scripts/sf/superfish.css");
    Thanks again.

    chrisvwlc

    (@chrisvwlc)

    @manic Hedgepig: I am SO grateful for your post.
    I’m still not getting anywhere with this after following https://kav.in/wordpress-superfish-dropdown-menu which specifies different paths. Also different is a minified version that is said to initialize sf. I’m going to scratch all of that and try your solution.

    My question for you since I’m using a child theme of twentyeleven as well is:
    did you change the ‘twentyeleven’ in the following to your theme name? <?php _e( 'Skip to primary content', 'twentyeleven' ); ?>

    Were there any other changes you made (other than the hyphen to underscore)?

    Thanks!

Viewing 7 replies - 16 through 22 (of 22 total)