3.5.x Theme Customize: Handling Custom Control Requests
3.5.x Theme Customize: Handling Custom Control Requests
3.5.x Theme Customize: Handling Custom Control Requests
First of all set the image size in Settings > Media or seta customized image size using add_image_size function. New images you will upload will be right size, but for images already uploaded you have to recreate the image sizes, for the pourpose you can use the plugin Regenerate Thumbnails Hope it helps.
The following is entirely based on experiment over the last 15 minutes or so, so I wouldn’t call it canonical but … wp_get_attachment_image_src() uses the image_downsize() function, which will attempt to find and return the image closest in size to the supplied size values. If you experiment with know image sizes (look at the actual … Read more
Why is WordPress loading a different sized post thumbnail?
1) Check out: http://codex.wordpress.org/Function_Reference/media_sideload_image 2) I found that WP function to be somewhat limited to I wrote my own wrapper class/method. If you want to do the same you’re going to need PHP’s copy() function http://us2.php.net/manual/en/function.copy.php as well as WP’s wp_insert_attachment() http://codex.wordpress.org/Function_Reference/wp_insert_attachment Unfortunately, I haven’t pushed my code to GitHub just yet, so for now … Read more
I suggest you to build your own WP_Customize_Control class that does exactly what you want. You can copy-paste the core WP_Customize_Image_Control code on your own class and modify it to fit your needs. You can follow Otto’s guide to create a new control. I personally use the Customizer API to modify the background-position CSS property … Read more
The answer to you question can be found here: https://stackoverflow.com/questions/10722466/how-do-i-force-wordpress-thumbnails-to-stretch-to-fit-if-uploaded-image-has-smal Add this code to your functions.php to strip the hardcoded width and height of the images that are integrated inside WordPress: add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10 ); add_filter( ‘image_send_to_editor’, ‘remove_thumbnail_dimensions’, 10 ); function remove_thumbnail_dimensions( $html ) { $html = preg_replace( ‘/(width|height)=\”\d*\”\s/’, “”, $html ); return $html; … Read more
You can’t use localhost in the settings at wp-admin -> Settings -> general. That literally means “this computer”– the computer requesting the web site. It only works if the browser viewing the site is on the same computer as the web server serving the site. You have to use your domain or a static IP. … Read more
Upload button in metabox not working
Remove “align” attribute on images