- This topic has 10 replies, 2 voices, and was last updated 9 years, 4 months ago by Leonardo Martinez. 
- 
		AuthorPosts
- 
		
			
				
June 4, 2016 at 9:28 pm #92921Leonardo Martinez ParticipantHi! I’m trying to change the thmbnail’s size.  As you can see, they have a square aspect 1×1 and I’d like to make it a Wide aspect 16×9, but I don’t know how to do it. June 5, 2016 at 10:06 am #92952Mahesh Participant@leonardo-martinez: Changing thumbnail will change size for all post’s thumbnail. For changing thumbnail, you’ll need to create a child theme first. You can find more details on creating child them HERE. Then in your child theme’s functions.phpadd the following codes:add_action( 'init', 'catchresponsive_child_custom_thumbnail_size' ); function catchresponsive_child_custom_thumbnail_size() { remove_image_size( 'catchresponsive-square', 200, 200, true ); // used in Archive Left/Right Ratio 1:1 add_image_size( 'catchresponsive-square', width, height, true ); // used in Archive Left/Right Ratio 16:9 }Note: In the above code, Please change the X and Y to your desired Width and Height in px for 16:9 appect ratio 
 Then after that use Regenerate Thumbnails to regenerate the thumbnails for existing images.
 https://wordpress.org/plugins/regenerate-thumbnails/
 Let me know if any problem.Regards, 
 MaheshJune 7, 2016 at 7:52 pm #93123Leonardo Martinez ParticipantHello Mahesh, I created the Child Theme and then in its functions.php I pasted the code and changed the Width and Height as you told me, just like bellow. <?php // // Recommended way to include parent theme styles. // (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme) // add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') ); } // // Your code goes below // add_action( 'init', 'catchresponsive_child_custom_thumbnail_size' ); function catchresponsive_child_custom_thumbnail_size() { remove_image_size( 'catchresponsive-square', 200, 200, true ); // used in Archive Left/Right Ratio 1:1 add_image_size( 'catchresponsive-square', 325, 200, true ); // used in Archive Left/Right Ratio 16:9The result is: Parse error: syntax error, unexpected $end in /home/sosna518/public_html/narguilebr.com.br/wp-content/themes/child-themere/functions.php on line 20 What did I do wrong? I didn’t even use the Regenerate Thumbnails. June 8, 2016 at 10:08 am #93156Mahesh Participant@leonardo-martinez: You missed the trailing/closing curly brace (}) at the end. Please add it and it’ll resolve the issue. 
 Let me know if any problem.Regards, 
 MaheshJune 9, 2016 at 8:48 am #93224Leonardo Martinez ParticipantMahesh, I did what you told me but it didn’t go right. It fixed the syntax error but it broke my site’s layout, just like the image.  Any suggest? June 9, 2016 at 10:36 am #93231Mahesh Participant@leonardo-martinez: Was your child theme working fine before? Please remove the code I’ve provided you above from the child theme and test if the layout is working fine. 
 The function is working fine as I test in our server.
 Let me know further.Regards, 
 MaheshJune 9, 2016 at 7:39 pm #93267Leonardo Martinez Participant@mahesh: Yes, it was working before the change, I removed the code you provided and it worked as before. Any idea? I don’t know what is wrong, because it should be working as you tested it. June 10, 2016 at 9:53 am #93284Mahesh Participant@leonardo-martinez: For testing, I copied the code to functions.phpwith a trailing brace and it worked fine on our server.
 It should have worked fine. You can download the theme file from the link below:
 https://www.dropbox.com/s/dyzcmcrlhuv9jbu/catch-responsive-child.zip?dl=0
 Let me know if any problem.Regards, 
 MaheshJune 18, 2016 at 6:47 am #93801Leonardo Martinez Participant@Mahesh: I inserted the code you gave me in the .rar and it didn’t brake the layout this time, but it has no effect. It keeps the same size of the thumbnails.  June 19, 2016 at 9:51 am #93833 June 19, 2016 at 9:51 am #93833Mahesh Participant@leonardo-martinez: Have you used the Regenerate Thumbnails plugins to regenerate new sized thumbnails? You have to run it once you’ve changed the image size. 
 Find the plugin in the link below.
 https://wordpress.org/plugins/regenerate-thumbnails/Let me know if any problem. Regards, 
 MaheshJune 20, 2016 at 7:12 am #93875Leonardo Martinez Participant
- 
		AuthorPosts
- The topic ‘How to change first page thubnail's size’ is closed to new replies.
