Really Simple Gallery Widget

Yes, it’s yet another plugin born out of a specific work request that seems usable by the general public. We’ve got some pages that function as photo galleries and we like to show said photos in the sidebar in a random order with a link to an anchor on the gallery page or showing the full-size image in a Shadowbox overlay. Turns out that the built-in gallery shortcode doesn’t actually do random (as far as I could tell) and shows captions by default and all kinds of things that just weren’t working for me (or the people I report to). I looked through and tried out a pretty ridiculous number of plugins, many of which required the use of separate galleries or new posts of a custom post type, and none of which did what I needed them to do – just use the built-in attachment functionality.

So, I wrote a widget and then made it into a plugin that does more than what I originally needed. A couple examples:

Available shortly now in the WordPress plugin repository: http://wordpress.org/extend/plugins/really-simple-gallery-widget/. Here’s all the stuff from the readme file:

Really Simple Gallery Widget

Donate link: http://www.helenhousandi.com/wordpress/donate/
Tags: gallery, widget
Requires at least: 2.8
Tested up to: 3.1

Simple widget for displaying images attached to a specific post or page.

Description

Really Simple Gallery Widget adds a widget to display images that are attached to a post or page, no extra uploading or creating custom post types required. Especially helpful if you create photo gallery pages using the built-in WordPress gallery and just want to be able to display those images in a widget area.

Features

  • Add as many widgets as you want, wherever you want
  • Select a number of images
  • Select any registered size in WordPress
  • Display the images in ascending, descending, or random order
  • Show or hide captions
  • Link the images to the original file, post, anchor in the post, attachment page, or nothing
  • Add a prefix to the link and image title (appears as a tooltip)
  • Use a rel attribute for the link – great for lightboxes

Installation

Really Simple Gallery Widget is most easily installed automatically via the Plugins tab in your blog administration panel. Go to Appearance -> Widgets to set one or more widgets up.

Manual Installation

  1. Upload the really-simple-gallery-widget folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Head over to Appearance -> Widgets to set up one or more Really Simple Gallery Widgets

Frequently Asked Questions

How do I get the ID for the post or page?
The easiest way is to mouseover or click an edit link for the post or page in question. The ID number will appear in the URL; e.g. http://yoursite.com/wp-admin/post.php?post=41&action=edit indicates that the ID of the post or page you want to reference is 41.

Why is the anchor link not working?
The anchor link relies on the ID that WordPress automatically generates when you insert an image with a caption. If you inserted the image manually or without a caption, the anchor won’t jump you to the spot in the page. The ability to specify an anchor may be added at a later time, or you can just add the ID (attachment_##) to the img tag.

I selected a registered size but the images are showing up huge or in the wrong size.
The images may be missing the thumbnails of that size and by default will pull the full size image instead. Try using Viper007Bond’s fantastic Regenerate Thumbnails plugin to create new versions for any new or changed image sizes.

Screenshots

Really Simple Gallery Widget options

Widget options

Sample display with prefixed title showing

Sample display with prefixed title showing

Changelog

1.0

  • First version

Hide Admin Bar Search is now in the WordPress Plugin Directory

Woohoo, 1.0! Basically the same as my earlier post, with a little cleanup and some readme.txt action: http://wordpress.org/extend/plugins/hide-admin-bar-search/

Fresh from the readme:

Hide Admin Bar Search

Contributors: helenyhou
Tags: admin bar
Requires at least: 3.1
Tested up to: 3.1

Small plugin to hide the search box in the admin bar in both dashboard and site views.

Description

Hide Admin Bar Search is a small plugin that hides the search box in the 3.1 admin bar in both the dashboard and front-end site views. Useful for those who are not using the built-in WordPress search in the usual way or anybody who wants a more minimal admin bar.

Installation

Hide Admin Bar Search is most easily installed automatically via the Plugins tab in your blog administration panel. Activate to hide the search box – no settings required.

Manual Installation
  1. Upload the `hide-admin-bar-search` folder to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Enjoy your cleaner admin bar

Frequently Asked Questions

Why would I want to do this?

The admin bar search uses the default WordPress search. If you are not using that search, or if you just want the admin bar to be more minimal, this is for you.

Can I choose to show the search box in the dashboard or site view?

Not at this time – this plugin is meant to be as simple as possible.

Changelog

1.0
  • First version

Hiding the search form in the 3.1 Admin Bar

I love the new admin bar in WordPress 3.1, but the search box just isn’t needed for Eastman thanks to a combination of things. For the Eastman site, we are not using the built-in WordPress search in the usual way. We are also not directing all searches through Google, so having search.php just completely redirect doesn’t. We also already have a site search box in the header, anyway, so it’s kind of redundant (even if it’s just web editors who are seeing the admin bar search).

I looked into the rendering code for the admin bar and didn’t see a hook to manipulate the search box like there are for other menu items. This seems rather unfortunate to me and I may ask the question on wp-hackers later on tonight to see if I’m missing something, but I figured I could probably use CSS to hide it for now. I mean, it’s not like ESM web editors are going to use Firebug and resurrect the form (and I’d have to admit that I’d be really impressed if any of them could do it), and it’s not like the search itself is nonfunctional, it just doesn’t quite behave the way you think it might when searching the entire site. Now, because I want to create a consistent experience, I want to be sure that the search box doesn’t show even if the rare network site uses a different theme, so I figured I’d make a simple plugin and network activate it. So, here goes the plugin:

<?php
/*
Plugin Name: Hide Admin Bar Search
Plugin URI: http://www.helenhousandi.com/wordpress
Description: Uses CSS to hide the search box in the admin bar. Helpful if you don't use the built-in WordPress search like usual.
Version: 1.0
Author: Helen Hou-Sandi
Author URI: http://www.helenhousandi.com
*/

if ( !function_exists('hide_admin_bar_search') ) {
	function hide_admin_bar_search () { ?>
		<style type="text/css">
		#wpadminbar #adminbarsearch {
		display: none;
		}
		</style>
		<?php
	}
	add_action('admin_head', 'hide_admin_bar_search');
	add_action('wp_head', 'hide_admin_bar_search');
}

What we are using the built-in search for: the News Room (a category) and Faculty (a custom post type). The one for Faculty does something pretty cool – to be written about more at another time.