I just installed this plugin, I have debug at ON in wp-config.php and I saw this message :
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.
I was able to fix it by editing slimbox.php by adding this at the end:
function thematic_enqueue_scripts() {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery.slimbox', WP_PLUGIN_URL."/slimbox/javascript/jquery.slimbox.js", array('jquery'), '2.03');
wp_enqueue_style('jquery.slimbox', WP_PLUGIN_URL."/slimbox/stylesheets/jquery.slimbox.css", false, '2.03');
}
add_action('wp_enqueue_scripts', 'thematic_enqueue_scripts');
I also removed the other lines at the end that we’re doing this problem.
]]>does anyone know how to make this plugin work, so that if there is no next arrows one can click on the image itself to close.
]]>The bug causes SlimBox to add rel attributes to all image tags that appear inside an anchor. By doing so it also breaks the standard/validation of the XHTML document by removing the trailing slash from the image and leaving it open.
The problem: regex in the slimbox_create function is incorrect since it also returns a match for those anchors that don’t link to the image file, but have an image wrapped in it, e.g.
<a href="..html"><img ... /></a>
The fix is to match the closure of the anchor:
function slimbox_create($content){
return preg_replace('/<a(.*?)href=(.*?).(jpg|jpeg|png|gif|bmp|ico)"([.^>]*?)>/i', '<a$1href=$2.$3" rel="lightbox[roadtrip]" $4>', $content);
}
]]>