Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tamara

    (@tsymonds)

    ok – so it looks like I figured it out . . . I looked at the codex for help on this one (one of the links I posted before), and this is what I came up with:

    // START - POST THUMBNAILS / FEATURED IMAGES SECTION
    
    	/** Enable support for Post Thumbnails **/
    
    	// Make sure featured images are enabled
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 150, 150, true ); // W x H, hard crop
    
    	// Add featured image sizes
    	add_image_size( 'featured-250', 250, 250, true ); // 250W x 250H, hard crop
    
    	// Add other useful image sizes
    	add_image_size( '570-lg-full-width', 570 );  // 570W x unlimitedH
    	add_image_size( '380-sq', 380, 380, true );  // 250W x 250H, hard crop
    
    	// Make your custom image sizes selectable from your WP admin
    	// Register the image sizes for use in the media modal WP admin area
    	add_filter( 'image_size_names_choose', 'my_custom_sizes' );
    
    	function my_custom_sizes( $sizes ) {
    	    return array_merge( $sizes, array(
    	        'featured-250' => __( '250 Featured Sq' ),
    	        '380-sq' => __( '380 Sq' ),
    	        '570-lg-full-width' => __( '570 Full Width' ),
    	    ) );
    	}
    
    // END Post Thumbnails Featured Images section

    In the section on “Make your custom image sizes selectable from your WP admin” — what I found was that in my 1st version, I had some conflicting variables:

    add_filter( 'image_size_names_choose', 'creativeandcurly_custom_sizes' );
    	function wpshout_custom_sizes( $sizes ) {

    If you notice, it says “creativeandcurly_custom_sizes” first and then on the next line it says “wpshout_custom_sizes” … that probably caused one problem. So when I copied my code this time, I copied it from the codex and used “my_custom_sizes” … the code also seems to be a tad bit different. In any case, no more stalling image library, and I have all of the image sizes available when I want to place an image into a post! ??

    Thanks both of you for your initial help — I am really most appreciative!!!

    Thread Starter Tamara

    (@tsymonds)

    ok so I took howtomakeWP‘s advice and removed all of my code pertaining to “Thumbnails” and “Featured Images” . . .

    And of course, then I couldn’t do anything with the thumbnail / featured image. So I added back in the following code:

    // START - POST THUMBNAILS / FEATURED IMAGES SECTION
    
    	/*
    	 * Enable support for Post Thumbnails
    	 */
    
    	// Make sure featured images are enabled
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 150, 150, true ); // W x H, hard crop
    
    // END Post Thumbnails Featured Images section

    And – voila! I was able to add back in my featured images / thumbnails, without the media library stalling. (So clearly my code was bad!)

    But — now what from my original code block was wrong / what did I do wrong? What can I add back to get the following?

    A featured image 250×250 hard crop called featured-250
    An image that is 570px wide (I don’t care how high), hard crop, called 570-lg-full-width

    The rest we can just ignore.

    Thanks again!!

    – Tamara

Viewing 2 replies - 1 through 2 (of 2 total)