Home -> Law Blog Directory -> Legal Marketing & PR Blogs -> PaperStreet Web Design: SpeakOut
(866) 635-2689 for Personal Injury or (866) 635-9402 for Criminal Defense
Find a Local Lawyer
Divorce (866) 635-6190
Personal Injury (866) 635-2689
Criminal Defense (866) 635-9402
Legal Marketing & PR
: PaperStreet Web Design: SpeakOutWordpress Photo Selection / Rotation Using Option Field
By Peter Boyd
Question
Can Wordpress have a nice photo selection tool for the main header area for any post or pages of the web site? Can it default to a standard photo, if I don’t want to choose one?
Answer
Hell, yes!
How To
Just plugin this code where the usual photo in the header is placed.
<img src=”/wp-content/themes/paperstreet/images/photos/<?php $key=”photo”; if(get_post_meta($post->ID, $key, true) != “”) echo get_post_meta($post->ID, $key, true); if(get_post_meta($post->ID, $key, true) == “”) echo “girl.jpg”; ?>” />
Next, using the handy administrative area of Wordpress create a OPTION field in the actual Wordpress Page/Post that you are using. Call the option field KEY “photo”. Then put the image name in the value field (i.e. girl.jpg) that you want to use. Of course, that photo needs to be uploaded to the correct directory, in this case /images/photos/ of the current paperstreet theme.
The above will pull from the photo option field that you added to the page/post. It will default to “girl.jpg” if you do not put in an option field. Of course change “girl.jpg” above if you want to use a different image.
Full post as published by PaperStreet Web Design: SpeakOut on July 09, 2008 (boomark / email).
Options Backdating
Former Broadcom executive settles $1.3 million stock option backdating lawsuit.
Tainted Spinach
Family awarded settlement after two children became very ill after eating Natural Selection Foods spinach.

Obscenity ScholarshipThe Legal Satyricon
Times Online on DomainingThe Legal Satyricon
U.S. Attorney's Office Rotation Deadline
LearnHub Integrates CC Licensing
Who doesnt love Yale slutsThe Legal Satyricon








