Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter eriktdesign

    (@eriktdesign)

    Unfortunately, that winds up being a major pain for my client. They are planning on using WP galleries as a photo directory for members of their organizations — with the image titles being in the form of “Last Name, First Name” — so they can then sort the galleries by title and get the images in the correct order.

    Thread Starter eriktdesign

    (@eriktdesign)

    That would be the correct way to do it–so if it’s not working, then the slug is probably wrong.

    Thread Starter eriktdesign

    (@eriktdesign)

    Hmm… That’s a good question. If you can figure out the admin “slug” for that page, you can add another action calling the same function:

    `add_action(‘downloads_page_dlm_edit’, ‘remove_add_download_cruft’);

    Thread Starter eriktdesign

    (@eriktdesign)

    Hi Konstantin,

    Just updated the plugin–that’s great! Thumbs now show up properly in the media gallery, and remove from the headers list as expected.

    I’m using your plugin to allow for user uploads to the site for a rotating header image (ie, each page load, new random image). Here’s the code I’m using in my functions.php:

    if (!function_exists('get_random_header_image')) :
    /**
     * Returns a random header image from the defaults list.
     * Use in conjunction with WP Save Custom Header to allow user uploads
     */
    function get_random_header_image() {
    $posts = get_posts(array(
          'numberposts'	=>	1,
          'post_type'	=>	'attachment',
          'meta_key'	=>	'_header_image',
          'orderby'	=>	'rand',
        ));
    
        foreach($posts as $post) {
    	$meta = get_post_meta( $post->ID, '_wp_attachment_metadata' );
        	$meta = ( 1 == count($meta) ) ? $meta[0] : $meta;
    	if(!empty($meta) AND is_array($meta)) {
    		if($meta['file']) {
    			echo '<img src="' . get_bloginfo('stylesheet_directory') . '/images/headers/' . $meta['file'] . '" width="' . HEADER_IMAGE_WIDTH . '" height="' . HEADER_IMAGE_HEIGHT . '" alt="" />';
    		return true;
    		}
        	}
        }
        return false;
    }
    endif;

    I imagine that might be out of the scope for your plugin, but I wanted to share it! Thanks for the great work!

Viewing 4 replies - 16 through 19 (of 19 total)