Enqueue Masonry
-
WordPress Codex on wp_enqueue_scripts
I am trying to get Masonry to work in the footer/widget area of my local development site. I am using _S to create a new parent theme. I seem to be having trouble enqueuing the Masonry JQuery correctly into the functions.php. From what I read online, the masonry script is included into the WordPress core, and should be rather easy to enqueue…and I believe I would not need to register it, right? I am currently trying this in functions php:
function spharler_scripts() { wp_enqueue_style( 'spharler-style', get_stylesheet_uri() ); wp_enqueue_script( 'spharler-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'spharler-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Adds Masonry to handle vertical alignment of footer widgets. wp_enqueue_script( 'masonry'); wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) ); } add_action( 'wp_enqueue_scripts', 'spharler_scripts' );
I will try to get a GitHub fork of my project up if necessary.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Enqueue Masonry’ is closed to new replies.