Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andy Mercer

    (@kelderic)

    I’ll look into switching over. I need to overhaul the css that controls it anywhere. Weird proportions can cause it to look odd.

    Thread Starter klihelp

    (@klihelp)

    // Made it work when commented out some css attributes
    // Plus php, js changes bellow

    #featuredgallerydiv ul li {
    	margin:10px 10px 0 0;
    	position:relative;
    	/* width:100%; */
    }
    
    #featuredgallerydiv ul li {
    	/* width:32%; */
    /* 	margin-right:1%; */
    	float:left;
    }
    
    #featuredgallerydiv ul li img {
    	/* width:100%; */
    	height:auto;
    	display:block;
    }

    // PHP changes in metabox.php function fg_display_metabox()
    // replace $galleryHTML lines with two lines, see

    // $galleryHTML .= '<li>'.$button.'<img id="'.$id.'" src="'.wp_get_attachment_url( $id ).'"></li> ';
    $image_attributes = wp_get_attachment_image_src( $id,'thumbnail' );
    $galleryHTML .= '<li>'.$button.'<img id="'.$id.'" src="'. $image_attributes[0].'"></li> ';

    // JS changes in admin.js#L79
    // replace imageHTML

    // imageHTML += '<li>'+button+'<img id="'+attachment.attributes.id+'" src="'+attachment.attributes.url+'"></li>';
    imageHTML += '<li>'+button+'<img id="'+attachment.attributes.id+'" src="'+attachment.attributes.sizes.thumbnail.url+'"></li>';
    Plugin Author Andy Mercer

    (@kelderic)

    I’ve made changes recently to the styling of the images to help things look better, but I am going to leave it using large images for now, because they look better in my opinion on high resolution screens. I may add a filter for this in the next release though.

    I appreciate the feedback and the actual code suggestions.

    Thread Starter klihelp

    (@klihelp)

    Do you have the filter to the image size?
    – ps: large images are too large ( ~1600px width..) for the admin display.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘in Admin: Metabox with thumbnail or medium image’ is closed to new replies.