Hello -
I've been trying out the zpskleton theme, and would like to display the exif information on image.php without the user having to click the "Image Info" link to toggle the display on and off. I see this is true for other themes as well.
The only place I can see to change this behaviour and to have the exif display initally without a toggle is in the z--core/template-functions.php file.
I can't imagine anything good coming from editing core files, and am hoping someone can tell me another way to accomplish this, perhaps in the theme itself.
Any suggestions?
Comments
On official themes this is an option actually, can't say for zpSkeleton naturally.
I went to github and copied image.php code from the demo theme.
Found out if I removed this code from skeleton:
<?php if (getImageMetaData()) { ?>
<?php printImageMetadata(null,true,'imagemetadata'); ?>
<?php } ?>
and added this this from the demo page:
<?php
if (getImageMetaData()) {
printImageMetadata('', false); ;
}
?>
It displays the exif info without the toggle.
Thanks for pointing me in the right direction!
No, I didn't get the button. However, I can't figure out how to get rid of the gray background that surrounds the word "Artist" That kind of looks like a button. Is that what you're talking about?
mine is www.wildart.in
if you go here
http://www.wildart.in/bustards/lesser-florican/lesser_florican_img_7272.jpg.php
on right side it says "Image Info" if I replace the code you shared above in image.php exif appear without toggle but button witout text remains and shows there as tiny spot.
Yeah, I see the spot you're talking about now. Guess I was looking through an optimistic lens. If I figure it out, I'll let you know what I did, or hopefully the author of skeleton will let us both know.
***Make backup files of your backup files if you try this. I am not a programmer. Just a patient trial-and-error guy.***
I bailed out of the skeleton theme, and went with one of the officially supported ones just to keep it simple. In my case, I used a duplicate of "default".
I modified one of the core files, which bothers me a bit, but here are the changes I made:
=====================================================
zp-core/template-functions.php
line 2282
commented out
if (is_null($title)) {
$title = gettext('Image Info');
}
line 2410
commented out
<div<?php echo $id . $class; ?>>
line 2415
changed this
echo "<tr><td class=\"label\">$label:</td><td class=\"value\">";
to this
echo "<tr><td>$label:</td><td class=\"value\">";
============================================================
themes/defaultcopy/image.php
line 93:
changed this
printImageMetadata(NULL, 'colorbox');
to this:
printImageMetadata(NULL, '');
====================================================
I think I got all the changes here. If it doesn't work, let me know, and I'll recheck to see if I missed a step.
If anyone smarter than me sees a mistake, don't hesitate to correct this.
The reason I finally edited the template-functions.php file is that I couldn't find any css controlling this. I even went so far as to rename the theme's "styles" folder to break all ties to css, and and yet the gray background around the label stayed, as did the words "Image Info"
Are there css calls elsewhere that I'm missing?
put this in your style.css in theme at end
#exif_link {
visibility:hidden;
}
#metadata_title {
visibility:hidden;
}
and this will hide your button that you dont have to touch your core files.
Thanks atomicmak and acrylian I can sleep better at night now, knowing that core file isn't waiting to trip me up at the next upgrade.
Since I switched to the default theme, the fix for me was different, but it was your directing me to the correct file that let me figure it out. In case you switch later, here's what I did:
===============
theme css file:
================
#imagemetadata table
commented everything out
#imagemetadata table td
commmented out- background-color: #f8f8f8;
added - background: none;
#exif_link
commented out - float: right;
added - visibility:hidden;
}
==================
image.php
=================
changed this - printImageMetadata(NULL, 'colorbox');
to this - printImageMetadata(NULL, '');