WordPress.org

Support

Support » How-To and Troubleshooting » Masonry in WP for Safari

Masonry in WP for Safari

  • Hello all,

    I have Masonry working for a custom loop. It seems to work everywhere excerpt for Safari.

    This is the exact script I’m using:

    <script language="javascript" type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.masonry.min.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function($){
      $('#linky').masonry({ singleMode: true });
    });
    </script>

    Any help would be greatly appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    Can you provide a link to your site please?

    Hi Christine, sure!

    http://lakernation.com/

    Any help would be awesome! 🙂

    Christine Rondeau

    @crondeau

    Volunteer Forum Moderator

    Masonry isn’t working on Chrome either.
    Do you have jQuery enqueued properly?
    That should be done in your functions.php file.
    I don’t see a call to jQuery anywhere in your source code.

    Hi Christine,

    Thanks for the quick reply! Here’s what I have in my header. I’m guessing this isn’t doing the trick?

    <!-- Include jQuery -->
    <?php wp_enqueue_script('jquery'); ?>

    I tried to call this up in the Functions using this below, but that didn’t seem to help the issue:

    function my_init() {
    	if (!is_admin()) {
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 'my_init');

    Any idea what I’m doing wrong here? Once again, thanks for all your help!

    Okay, so, this keeps getting more confusing, haha. I used this code to test out my jQuery:

    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
    <script type="text/javascript">
    $(document).ready(function(){ 
    
    	$("div").css("border", "3px solid red");
    
    });
    </script>

    It worked in Firefox and Mac Chrome, but didn’t in Safari or PC Chrome. So, clearly there’s a major conflict of some sort.

    I went through and deactivated all my plugins, but that didn’t do the trick. I stripped out my enqueue reference for jQuery in the functions and header. All of this didn’t seem to fix my issue.

    Any ideas? Anyone?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Masonry in WP for Safari’ is closed to new replies.