Home › Forums › Support › Kindly share code This topic has 7 replies, 2 voices, and was last updated 4 years, 7 months ago by Leo. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts September 16, 2019 at 8:11 am #1010764 Jim Hi. would you kindly share the following PHP function you use for: 1. Changing image sizes in archives only https://docs.generatepress.com/article/adjusting-the-featured-images/ 2. Changing the read more text in the free theme version. Thanks in advance. September 16, 2019 at 8:31 am #1010781 LeoStaff Customer Support Hi there, 1. That depends on if your posts page is the front page or not. You can see all the conditional tags here though: https://codex.wordpress.org/Conditional_Tags 2. GP Premium is needed for that unfortunately. Otherwise you will need to overwrite this copy and paste this file and overwrite this line: https://github.com/tomusborne/generatepress/blob/7fdcddf18209a84aaa75304ab23f768241e08ed4/inc/structure/post-meta.php#L299 September 16, 2019 at 9:33 am #1010829 Jim 1. I should have mentioned this is for the free version too. Which of these two codes is correct? add_filter( 'generate_blog_image_attributes','tu_variable_image_sizes' ); function tu_variable_image_sizes( $atts ) { // Set up our conditional if ( is_home() || is_archive() || is_search() || is_tax() ) { $atts[ 'width' ] = 740; $atts[ 'height' ] = 402; $atts[ 'crop' ] = true; } // Return our options return $atts; } add_filter( 'generate_blog_image_attributes','tu_variable_image_sizes' ); function tu_variable_image_sizes( $atts ) { // Set up our conditional if ( is_home() || is_archive() || is_search() || is_tax() ) { return 'blog-thumb'; // Already registered thumbnail } // Return our options return $atts; } September 16, 2019 at 9:42 am #1010836 LeoStaff Customer Support That looks ok. What if you go ! is_single() for “is not single post”? September 16, 2019 at 9:59 am #1010858 Jim This is the only code that worked. add_filter( 'generate_page_header_default_size', function( $size ) { if ( is_home() || is_archive() || is_search() || is_tax() ) { return 'blog-thumb'; } } ); I want to exclude both single posts and pages, but show the new thumbnail size sitewide for homepage, categories, tags, search page, etc. How will your code look like? The full size image for single posts and pages scales nicely on mobile devices. September 16, 2019 at 10:17 am #1010877 LeoStaff Customer Support Your code should work then ๐ September 16, 2019 at 10:41 am #1010889 Jim Okay, thanks. I can now deploy the test site. September 16, 2019 at 11:22 am #1010927 LeoStaff Customer Support No problem ๐ Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In