Cut this section from the gallery.php file:
- Code: Select all
<style type="text/css">
.jdGallery .slideInfoZone
{
height: <?php echo get_option('gallery-info'); ?>px;
}
</style>
Then paste it into the gallery_styles() function in the content-gallery.php file:
- Code: Select all
$galleryscript .= sprintf(
"<style type=\"text/css\">\n.jdGallery .slideInfoZone {\n height: %s;\n}\n</style>\n",
get_option('gallery-info')
);
Actually, we could add a default height while we are at it. Without a default we get invalid CSS if the 'gallery-info' is not set.
- Code: Select all
$height = get_option('gallery-info');
if ( ! $height ) {
$height = 80;
}
$galleryscript .= sprintf( "<style type=\"text/css\">\n.jdGallery .slideInfoZone {\n height: %spx;\n}\n</style>\n", $height );
So, the whole function looks like this:
- Code: Select all
function gallery_styles() {
/* The next lines figures out where the javascripts and images and CSS are installed,
relative to your wordpress server's root: */
$gallery_path = get_bloginfo('wpurl')."/wp-content/plugins/featured-content-gallery/";
/* The xhtml header code needed for gallery to work: */
$galleryscript = "
<!-- begin gallery scripts -->
<link rel=\"stylesheet\" href=\"".$gallery_path."css/jd.gallery.css.php\" type=\"text/css\" media=\"screen\" charset=\"utf-8\"/>
<link rel=\"stylesheet\" href=\"".$gallery_path."css/jd.gallery.css\" type=\"text/css\" media=\"screen\" charset=\"utf-8\"/>
<script type=\"text/javascript\" src=\"".$gallery_path."scripts/mootools.v1.11.js\"></script>
<script type=\"text/javascript\" src=\"".$gallery_path."scripts/jd.gallery.js.php\"></script>
<script type=\"text/javascript\" src=\"".$gallery_path."scripts/jd.gallery.transitions.js\"></script>
<!-- end gallery scripts -->\n";
$height = get_option('gallery-info');
if ( !$height && 0 != $height ) {
$height = 80;
}
$galleryscript .= sprintf( "<style type=\"text/css\">\n.jdGallery .slideInfoZone {\n height: %spx;\n}\n</style>\n", $height );
/* Output $galleryscript as text for our web pages: */
echo($galleryscript);
}









