Support » Fixing WordPress » JQuery Equal Height in Rows Doesn't Wotk With

  • Resolved Kharis Sulistiyono

    (@kharisblank)


    Currently I am developing a WordPress Theme. I want the posts floated left with DIVs height are equal in rows. I use tutorial from CSS-Tricks http://css-tricks.com/equal-height-blocks-in-rows/. I follow the tutorial correctly. But it only works when I ommit <?php wp_footer(); ?>. As we know that it is not suggested for us to ommit it.

    Could somebody help me to solve this problem?

    Thank you for your very useful help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)


    Forum Moderator


    How are you enqueuing the javascript/jQuery script?

    I am enqueuing JQuery and equalheight.js in functions.php as follows :

    // Load jQuery
    if ( !is_admin() ) {
    wp_deregister_script(‘jquery’);
    wp_register_script(‘jquery’, (“http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js”), false);
    wp_enqueue_script(‘jquery’);
    }

    // Load Equal Height .js
    function my_equal_height() {
    wp_register_script(‘custom_script’,
    get_template_directory_uri() . ‘/scripts/equalheight.js’,
    array(‘jquery’),
    ‘1.0’ );
    wp_enqueue_script(‘custom_script’);
    }
    add_action(‘wp_enqueue_scripts’, ‘my_equal_height’);

    Thank you for your respond and answer 🙂

    My problem has been resolved. Somebody helped me by this code

    // Load 'Working' jQuery
    add_action( 'init', 'jquery_register' );
    // register from google and for footer
    function jquery_register() {
    
        if ( is_admin() )
            return;
    
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', false, null, true );
        wp_enqueue_script( 'jquery' );
    }
    
    // Try this Equal height:
    function my_equal_height() {
        wp_enqueue_script( 'equal_height', get_template_directory_uri().'/scripts/equalheight.js', 'jquery', null, true );
    }
    add_action( 'wp_head', 'my_equal_height' );

    Thank you David

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JQuery Equal Height in Rows Doesn't Wotk With’ is closed to new replies.