Why isn’t wp_enqueue_script(‘jquery-masonry’) working?

jQuery’s Masonry is bundled with WordPress. All you should need is wp_enqueue_script(‘jquery-masonry’); but note that the “slug” is jquery-masonry, not jquery_masonry. And be sure your are enqueueing on the wp_enqueue_scripts hook or later. function enqueue_masonry() { wp_enqueue_script(‘jquery-masonry’); } add_action(‘wp_enqueue_scripts’,’enqueue_masonry’); I’d guess that your problem has something to do with when you register/enqueue because loading core … Read more

Display recent posts with thumbnail within Masonry

Add the meta_key parameter to fetch the latest posts which have featured image set. $args = array( ‘numberposts’ => ’10’, ‘meta_key’ => ‘_thumbnail_id’ ); <?php /* Template Name: Recent Profiles */ get_header(); ?> <h1 class=”page-title”><?php the_title(); ?></h1> <div id=”content”> <div id=”masonry”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div … Read more

Masonry and Jetpack Infinite Scroll – overlap issue

I have now solved point (2), the overlapping posts problem; maybe this will help someone else. I changed wrapper to true in the mytheme_jetpack_setup function in my PHP (so that the new posts are wrapped in their own div) And I changed the jQuery to: $(‘#content’).masonry({ columnWidth: ‘.grid-sizer’, itemSelector: ‘article’, gutter: ‘.gutter-sizer’ }); var infiniteCount … Read more

Masonry imagesLoaded javascript error

Followed the same article and ran into the same issue; the author (Josh Pollock) posted a followup on his blog. Essentially from WP 3.9, Masonry is there for you to use so all you need in functions.php is: add_action( ‘wp_enqueue_scripts’, ‘slug_masonry’ ); function slug_masonry( ) { wp_enqueue_script(‘masonry’); // note this is not jQuery } and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)