Hi!
The reason why there are no images it’s because the image galleries are shortcodes themselves, and a raw shortcode does not contain information about images, thus the search cannot see them.
The solution would be to filter this content before parsing the images, but this might slow down the search too much. I’m not even sure that the built in shortcodes are possible to “run” on a delayed filter call.
Anyways, here is what you should do:
Open up the plugins/ajax-search-lite/includes/search_content.class.php file and go to line 372, where you should see this:
$im = wpdreams_get_image_from_content($post->content, 1);
change that line to:
$im = wpdreams_get_image_from_content(apply_filters('the_content', $post->content), 1);
I’m not sure if this will work, but there is no other solution. It’s not the search’s falut tough, it’s just not possible.
If you start to see images on posts with galleries, then it works ??
As for the css issue. The shortcodes are not removed by default, so I guess the css comes from the gallery shortcode itself.
The search treats everything as text. I mean there is no difference for a program between CSS code and actual meaningful content. The problem is, that the filtered gallery shortcode contains the styles and the scripts first, then the tags and other stuff.
There are two options here:
1. Stripping the shortcode from the search content
2. Stripping the style and script tags from the search content
(1.) How to:
Open up the wp-content/plugins/ajax-search-lite/includes/search_content.class.php file and go to line 326, you should see this:
if ($_content != "") $_content = apply_filters('the_content', $_content);
Now, change that line to:
if ($_content != "") $_content = strip_shortcodes($_content);
(2.) How to:
Open up the wp-content/plugins/ajax-search-lite/includes/search_content.class.php file and go to line 326, you should see this:
if ($_content != "") $_content = apply_filters('the_content', $_content);
Add these lines after that line:
if ($_content != "") $_content = preg_replace('/<style[^>]*>([\s\S]*?)<\/style[^>]*>/', '', $_content);
if ($_content != "") $_content = preg_replace('/<script[^>]*>([\s\S]*?)<\/script[^>]*>/', '', $_content);
I hope this helps.