• Resolved 29twelve

    (@29twelve)


    https://www.29twelve.com/blog/

    I have a photoblog (above) which displays a photo (surprise, surprise!), the EXIF (tech photo info) data and sometimes a comment about the photo or a general comment. OK so far?!

    Currently I put the image, exif data and comment in the WP Post itself so don’t have that much control over alignment etc. so I hand code each entry so the with the text in is left aligned but the image is centrally aligned.

    I’m getting quite bored of this and want a way to have more control over the text and images, ie. if I want to have different styling for the img (which is also a link to the previous image) and the links in the text.

    My first though was to use CSS to style the img and the links but that doesn’t work as they’re in the same DIV!

    My second thought was to use the custom fields?

    I have no idea which way to go but I will obviously have to amend each of my posts but that’s not the end of the world!

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you created a custom field, say post_photo, to hold the link to the photo you could then have a conditional test in the template file to display the image if the meta field post_photo was populated.

    The css to format the image could then be in a separate div to the post content.

    There is a good plug called custom_field_gui ( at https://rhymedcode.net/projects/custom-field-gui ) which would allow you to have an input box on the write post page into which you could enter the address of the image direct.

    Thread Starter 29twelve

    (@29twelve)

    Thanks very much for the reply!

    I have kind of gone down your suggested route and used the plugin you suggest but created a custom field called exif, one called comments and one called comments2 which will hold my comments about the post, and it works a treat!

    I’m so happy to be using WP though. With such a great community and so many superb plugin’s available, it’s fantastic!

    you should also note that you can add a class=”something” tag to most any html element (i.e., img, div, span…) at any time. So if you want to custom-style images specially, just add a class to the tag, and do the rest in CSS.

    I custom-built a plugin so that I embed images using a special formatting, and it outputs the img tag, and wraps it in a div, and puts the proper class, so that when all is said and done I can style things really easily (and insert them really easily!).

    The EXIF information, if embedded in the image file itself, could also be retrieve programmatically rather than embedded in a hand-made custom field…

    -d

    Thread Starter 29twelve

    (@29twelve)

    Thanks for the comment david. I am aware that you can add CSS to an image but I was trying not to add too many div’s or span’s to my code as it’s cluttered enough as it is!

    The way I’ve found suits me for the time being but I may go down the ‘displaying the actual EXIF data’ route at some point. The problem being my earlier images I used the save for web function in CS so lost the EXIF data.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra fields in WP?’ is closed to new replies.