Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Magic Gallery plugin not working correctly WordPress

  • SOLVED

Hi guys,

Need you guys to save my life again, need a solution to this in the next 48 hours please.

Client is a real estate agent who wants a sold property gallery, basically for the images they want to have a primary photo of a property and thumbnails underneath it. Clickong on either of the images will open it up in a lightbox and show the thumbnails as well.

I have installed a plugin called 'Magic Gallery' ([[LINK href="http://wordpress.org/extend/plugins/magic-gallery/"]]Click here for the plugin page[[/LINK]]) that is meant to do this with a setting called 'Pikachoose' but its not working correcty.

The images are being displayed wrong ([[LINK href="http://www.cdlabs.com.au/uat/riverbank/test"]]see test page on UAT here[[/LINK]]), please have a look and save my life again :)

Thanks again!

Answers (2)

2011-07-08

Christianto answers:

Hi,

Try to fix the js error first on line 66 where you put your lightbox initialize code, set the autoplay to true/false or delete the option..

Your plugin seems to have a problem with wordpress auto paragraph formatter, so the js code display incorrectly, try this code to prevent wordpress apply the formatter to your page where you put the gallery shortcode..
Put this code on your functions.php

/* Remove the 2 main auto-formatters */
remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
function shortcode_formatter($content) {
$new_content = '';
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);

foreach ($pieces as $piece) {
if (preg_match($pattern_contents, $piece, $matches)) {
$new_content .= $matches[1];
} else {
if(strpos($piece,'class="pikachoose"')){
$new_content .= $piece;
} else {
$new_content .= wptexturize(wpautop($piece));
}
}
}

return $new_content;
}
add_filter('the_content', 'shortcode_formatter', 99);


Basically, above code will remove the filter, and apply the filter only if there is no [raw][/raw] shortcode or no plugin gallery shortcode on the content.


Farooq Khan comments:

Sorry mate, did not work. I added the code to the php file and placed the [raw] tags on the test page but it still doesn't work.


Christianto comments:

Would you mind to share your functions.php and what other plugin that you use?
in case other plugin/code re-add the filter that already being remove with the code..

and did you put the raw tag like this..
[raw][gallery][/raw]


Farooq Khan comments:

Just sent you a message with the details.


Christianto comments:

Ok, The paragraph formatter seems to be remove now..

Now we fix the jQuery conflict issue, on magic gallery plugin folder replace gallery.php file with file attach..

For prettyPhoto js error, since the initialize option generate by the plugin, replace wp-prettyphoto.php file with file attach..