Ah I see! You would need to manually add in the code if you aren’t not using the gallery shortcode. You could follow my tutorial here. It’s not very hard to do.
I think you just need to follow Steps 1 and 2.
Let me know how it works out!
Hi phoenixMagoo thanks for your answer but when you say “follow my tutorial here” where does “here” exactly mean?I looked in Support, FAQ and so on but nothing that resembles a tutorial 🙂
Hmm should I pick the first code and create a .js file? If so, which name and where to put it?
Then for the second thing to add to functions.php any place is ok? I put it in the end but crashed my site 😛
Are you using a child theme?
Alright. Copy all the code in step 1 and paste it into a new .js file. Name that .js file jmig.js and save it in the theme’s directory. Then put this in the theme’s functions.php file:
function jmig_js() {
wp_register_script('masonryInit',
get_template_directory_uri() . 'jmig.js',
array('masonry'),
'2.1.6',
true);
wp_enqueue_script('masonryInit');
}
add_action( 'wp_enqueue_scripts', 'jmig_js');
Give that a shot and let me know what happens!
When I alter the functions it seem to crash :S:
Fatal error: Cannot redeclare jmig_js() (previously declared in D:\wwwroot\dodococo\wwwroot\wp-content\plugins\jquery-masonry-image-gallery\functions\three-dot-nine.php:84) in D:\wwwroot\dodococo\wwwroot\wp-content\themes\barber-shop\functions.php on line 76
Is the jQuery Masonry Image Gallery plugin still turned on?
It is yeah, columns have same behaviour as before.
I’m creating the jmig.js file here: wp-content/themes/barber-shop/_/_js
which is where the other .js of the files were uploaded.
But whenever I alter the functions is when it crash. I have this code on it which may be causing a conflict?:
// LOAD JQUERY SCRIPTS
function tinktank_add_scripts() {
wp_enqueue_script('jquery');
wp_register_script( 'add-custom-js', get_template_directory_uri() . '/_/_js/custom-ck.js', array('jquery'),'',true ); // TO FOOTER
wp_enqueue_script( 'add-custom-js' );
}
add_action( 'wp_enqueue_scripts', 'tinktank_add_scripts' );
Try turning the plugin off.
Turning the plugin off breaks the arranging on the page that uses [gallery]: http://dodo-coco.com/index.php/collections/fallwinter-2013-14/?lang=en
But the page I had problem resizing (the one with hard code) remains the same (http://dodo-coco.com/index.php/collections/springsummer-2014/?lang=en). The order, display and the way masonry works is ok. So now I’m doubting if the plugin has influence over this one or not :S
It looks like you are probably going to run into conflicts with both the plugin turned on and the hardcoded page. Try this real fast:
Change:
function jmig_js() {
wp_register_script('masonryInit',
get_template_directory_uri() . 'jmig.js',
array('masonry'),
'2.1.6',
true);
wp_enqueue_script('masonryInit');
}
add_action( 'wp_enqueue_scripts', 'jmig_js');
to:
function jmig_js() {
wp_register_script('masonrytwo',
get_template_directory_uri() . 'jmig.js',
array('masonry'),
'2.1.6',
true);
wp_enqueue_script('masonrytwo');
}
add_action( 'wp_enqueue_scripts', 'jmig_js');
Also, please make sure the plugin is turned back on.
Nothing, keeps crashing, probably theme related :(. Need to sleep is 02:30 but will be back in a few hours, thank you very much for your help, I hope we can solve it tomorrow.
Will try tomorrow in a different theme to see if it works ok.
Try this one when you wake up:
Change:
function jmig_js() {
wp_register_script('masonryInit',
get_template_directory_uri() . 'jmig.js',
array('masonry'),
'2.1.6',
true);
wp_enqueue_script('masonryInit');
}
add_action( 'wp_enqueue_scripts', 'jmig_js');
to:
function jmig_js2() {
wp_register_script('masonrytwo',
get_template_directory_uri() . 'jmig.js',
array('masonry'),
'2.1.6',
true);
wp_enqueue_script('masonrytwo');
}
add_action( 'wp_enqueue_scripts', 'jmig_js2');