Title: add .masonry class   github ?
Last modified: August 22, 2016

---

# add .masonry class github ?

 *  Resolved [grosbouff](https://wordpress.org/support/users/grosbouff/)
 * (@grosbouff)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/add-masonry-class-github/)
 * Hi Anders Noren and thanks for this great theme !!!
 * Could you please change
 * `<div class="posts">`
 * to
 * `<div class="posts masonry">`
 * and
 *     ```
       $blocks.masonry({
       			itemSelector: '.post-container'
       		});
       ```
   
 * to
 *     ```
       if ($blocks.hasClass( "masonry" )){
                           $blocks.masonry({
                                   itemSelector: '.post-container'
                           });
                       }
       ```
   
 * ?
    It would be easier to build templates (and child themes) who don’t need to
   have masonry enabled.
 * BTW, you should put your theme on Github, so people could collaborate !

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

 *  Thread Starter [grosbouff](https://wordpress.org/support/users/grosbouff/)
 * (@grosbouff)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/add-masonry-class-github/#post-5190254)
 * I guess it would rather be
 *     ```
       $blocks.each(function() {
           if ($(this).hasClass('masonry')){
               $(this).masonry({
                   itemSelector: '.post-container'
               });
           }
       });
       ```
   
 * or the .posts block should have an ID instead of a class. (maybe it would even
   be more logical)
 *  Theme Author [Anders Norén](https://wordpress.org/support/users/anlino/)
 * (@anlino)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/add-masonry-class-github/#post-5190319)
 * Hi grosbouff,
 * Thanks for your input! I’ll make a note of it for the next time I use Masonry
   in a theme (since people have already created child themes/custom CSS for Baskerville,
   I can’t edit the attribute classes in updates). No current plans to add Baskerville
   on Github, unfortunately.
 * — Anders
 *  Thread Starter [grosbouff](https://wordpress.org/support/users/grosbouff/)
 * (@grosbouff)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/add-masonry-class-github/#post-5190330)
 * > since people have already created child themes/custom CSS for Baskerville, 
   > I can’t edit the attribute classes in updates
 * That’s maybe true…
    Another option could be to disable masonery with a class,
   eg. “masonery-disabled” > so it does not interfer with your current theme and
   child themes made by people, but allows us to disable it when needed.

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

The topic ‘add .masonry class github ?’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/baskerville/2.3.1/screenshot.jpg)
 * Baskerville
 * [Support Threads](https://wordpress.org/support/theme/baskerville/)
 * [Active Topics](https://wordpress.org/support/theme/baskerville/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/baskerville/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/baskerville/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [grosbouff](https://wordpress.org/support/users/grosbouff/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/add-masonry-class-github/#post-5190330)
 * Status: resolved