Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author phoenixMagoo

    (@phoenixmagoo)

    The plugin works fine with 4.0.

    It looks like on this page you are including the javascript to initialize masonry, but you are not including the masonry library.

    You should never have to use the do_action function in the header to include a javascript library, that’s what wp_head or wp_footer are used for.

    So let’s try this:

    1. Turn off the plugin. You do not need it.
    2. Paste this snippet into your functions.php file in your child theme.

    The masonry files should be included in your footer. It will include two files. First the Masonry library, and then your custom Masonry js located here: http://cristinaporresinteriors.com/wp-content/themes/customizr-child/inc/assets/js/Masonrymine.js

    If the javascript is not added at all, and it’s not throwing an error, then it might be worth looking to make sure your theme/child theme is using wp_footer() correctly.

    Please let me know how it goes, and please don’t hesitate to write back. I’m curious to see it working! Great looking site!

    Thread Starter pabloplazalastras

    (@pabloplazalastras)

    Thanks for your extense and quick reply.
    I think I haven’t got the concept of this.

    I thought that the plugin would allow me to add the gallery into the page with the pictures I select. If I don’t use the plugin I won’t have a gallery?

    Secondly, how shall I include the js files on the footer? shall I just echo a <script src> tag with the files?

    Thirdly, I thought that the plugin is inserting the masonry library on the page, I’m not doing it myself as far as I know…

    Which one is the masonry library? masonry-init-v3.js or masonry.min.js?These are stored in wp-includes, I thought they would be inside the plugin folder?

    Thank you very much! The page looks horrible now! it will look great though in the end!

    Plugin Author phoenixMagoo

    (@phoenixmagoo)

    The plugin works with the standard WordPress gallery shortcode.

    If you have the plugin installed and are using the Gallery Shortcode, it will give the standard WordPress gallery a masonry layout. If you don’t have the plugin installed and you use the gallery shortcode, the standard WordPress gallery will show up.

    The Masonry js will show up in the footer because it’s defined as true in wp_register_script.

    The masonry library is masonry.min.js. The code to activate masonry is masonry-init-v3.js. You need both to work and masonry.min.js needs to be called in the code before masonry-init-v3.js.

    Also, please make sure you are a testing on a page that using the [gallery] shortcode. That will help out a lot with debugging.

    Now, with all the being said, you only need to use the plugin OR follow the tutorial on my site.

    Thread Starter pabloplazalastras

    (@pabloplazalastras)

    Got it now! (I think)
    You have been so helpful, thank you very much.

    However, I think that in your tutorial you need to get some clarifications/modifications?

    First of all, at least myself, I thought that I had to install both the plugin and then to be able to modify parameters/options on the custom masonry file.

    Secondly, on your tutorial you don’t mention at all the masonry-init-v3.js file which you need it to get it working if you don’t install the plugin.

    I might be wrong, but I got it working modifying the code to be on the funcitons.php to register both the custom masonry file and the init file as:

    add_action( ‘wp_enqueue_scripts’, ‘masonryPablo’);

    function masonryPablo() {

    global $post;
    if( has_shortcode( $post->post_content, ‘gallery’) ) {

    wp_register_script(‘masonryMine’,
    http://cristinaporresinteriors.com/wp-content/themes/customizr-child/inc/assets/js/masonry-init-v3.js&#8217;,
    array(‘masonry’),
    ‘2.1.6’,
    true);
    wp_register_script(‘masonryInit’,
    http://cristinaporresinteriors.com/wp-content/themes/customizr-child/inc/assets/js/Masonrymine.js&#8217;,
    array(‘masonry’),
    ‘2.1.6’,
    true);
    wp_enqueue_script(‘masonryInit’);
    wp_enqueue_script(‘masonryMine’);
    }

    }

    Besides, it is a bit difficult to get from the plugin to your tutorial. I found it by chance as you have to go from the plugin page-demo-and then click on tutorials….

    Anyway, I will play this evening with the masonry options and methods to have the pretiest of the galleries.
    Thank you very much, you have been so helpful, if you were local I would get you a beer! 🙂

    Plugin Author phoenixMagoo

    (@phoenixmagoo)

    Awesome. Glad to hear you got it working! I’m going to mark this thread as resolved. Please don’t hesitate to reopen it if you need anymore help.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not compatible with WordPress 4.0??’ is closed to new replies.