=== Random Image widget === Tags: WordPress, WordPress Plugin, widget, images, photos, sidebar Contributors: mproulx Requires at least: 2.5 Tested up to: 2.7 Stable tag: 1.5 == Description == The Random Image widget displays a user-selectable number of random photos from a directory on the web server in the sidebar, post, or any other location in a WordPress blog. == Installation == 1. Download and unzip `random-image.zip`. 2. Place `random-image.php` in your blog's plugin subdirectory (e.g., `/wp-content/plugins/`). 3. Create a new subdirectory to hold your images (`random-image` is the recommended name for this directory). 4. Activate the plugin from the Plugins tab of your blog's administrative panel. 5. Go to the Widgets page from the Presentation tab. 6. Click the 'Add' link on the widget to add the widget to the appropriate sidebar. 7. Click the 'Edit' link on the widget's placeholder to open the settings form. 8. Use the form to adjust any of the visual settings to fit your theme and preferences and save the sidebar settings. Be sure the directory points to the folder you are using to store your images. If you don't want the plugin to display in the sidebar, uncheck the "Show widget in sidebar" option (you can still use the widget to display images in posts or elsewhere in your page.) 9. Click the 'Done' button on the settings form. 10. Click the 'Save Changes' at the bottom of the Current Widgets section. You should be able to see the sidebar on your front page. 11. If you would like to have multiple copies of the widget on your blog, simply click the 'Add' button again. At this time, you can only use one copy of the widget active if you use it outside of the sidebar. == Feature Setup == = To display embedded javascript content = Create a file with an .embed extension in the same folder as the random images. Paste javascript code (for example, from a site such as YouTube) into the file. = To display photos from a YAPB photoblog = Simply select the "Enable YAPB support" checkbox on the options page. The plugin will automatically search all posts with YAPB content and use the photos in the display. = To display caption and link information from a CSV database = Start with a database file in CSV format. You can export from a spreadsheet program or create one from scratch. The first column should contain the filenames of the images (you don't need to include the entire path.) The second column should contain the caption and the third column should contain a link; both columns are optional. In the CSV format, the file should look like this: `imagename.jpg,The Photo's Caption,http://a.link.here.htm` . . . Save the CSV file (preferably in the same folder as your random-image root folder.) Check the "Use caption and link information from this CSV file" checkbox and enter the filename in the box below it. If the file is in the random-image root directory, no path information is necessary. = To display in a post or page = Add a line in your post that says `(randomimage)`. (Note-this is disabled in version 1.6beta) = To display elsewhere in a page = You can call the display function in the appropriate php file of your theme using the function echo_random_image(). == Frequently Asked Questions == = I installed the plugin but can't see it. What's wrong? = If the widget doesn't show up on the Widgets page: * Check to make sure the plugin was uploaded to the widgets subdirectory. * Check to make sure both the widgets plugin and the photos plugin are activated. * Version 1.3 of the widget won't work with versions of WordPress older than 2.5. You can download version 1.2 or earlier, which will work with 2.0-2.3. If the widget doesn't appear on the sidebar once the plugin has been added: * Make sure the plugin has been added to the correct sidebar. * Be sure to save changes on the settings form and in the Current Widgets section. * Make sure the directory name is entered correctly on the settings page If the widget title appears but no photos appear below it: * Make sure the directory name is entered correctly on the settings page = The widget doesn't work with my theme. How can I fix this? = This widget has been tested on a number of themes and is compatible with all truly widget-ready themes. However, certain formatting settings are "locked" in the code. The code isn't locked in stone, however. You may be able to edit the PHP file to adjust things to your particular code. You may also contact the plugin author for suggestions; these may result in a better plugin in the future. = The widget won't scale my images. How can I get them to scale? = Beginning in version 1.6, images in the sidebar may be scaled. Be careful to change the correct settings--one set of numbers is for scaling images to be used outside of the sidebar while the other set just applies to the sidebar. = My images are scaled oddly/part of the images are cropped/the images are distorted. How can I fix this? = Be sure you are using the most appropriate scaling method. Look at the three options and choose the one you like. The "Classic" method will show all of the image, but images will appear to be different sizes if the aspect ratio of the original images is different. The "Scale and Fit" option will crop every image to the same size rectangle after scaling each image to be as large as possible. The "Stretch" option will scale both sides, showing the entire image in the given rectangle but distorting images that have a different aspect ratio. == Homepage == [http://www.district30.net/random-image-widget](http://www.district30.net/random-image-widget)