Results 1 to 4 of 4

Thread: Removing add_image_size() presets

  1. #1
    Thread Starter
    Member sed671's Avatar
    Join Date
    Apr 2010
    Location
    Guam
    Posts
    68
    Thanks
    6
    Thanked 9 Times in 9 Posts

    Removing add_image_size() presets

    I think this should be helpful for those who prefer to use their own custom image sizes and at the same time remove Classipress' and Wordpress' default sizes. Reason being is you don't want to have additional sizes that aren't being used take up space in your server. That's a waste!

    Shown is what's initialized in 'includes/theme-functions.php' - lines 2306-2316 (Classipress 3.1.6)
    Code:
    // setup different image sizes
    if ( function_exists( 'add_image_size' ) ) {
    	add_image_size('blog-thumbnail', 150, 150); // blog post thumbnail size, box crop mode
    	add_image_size('sidebar-thumbnail', 50, 50, true); // sidebar blog thumbnail size, box crop mode
    
    	// create special sizes for the ads
    	add_image_size('ad-thumb', 75, 75, true);
    	add_image_size('ad-small', 100, 100, true);
    	add_image_size('ad-medium', 250, 250, true);
    	//add_image_size('ad-large', 500, 500);
    }
    In your child theme 'functions.php' file, add this:
    Code:
    function sgr_filter_image_sizes( $sizes) {
    		
    	unset( $sizes['thumbnail']);
    	unset( $sizes['medium']);
    	unset( $sizes['large']);
    	unset( $sizes['blog-thumbnail']);
    	unset( $sizes['sidebar-thumbnail']);
    	unset( $sizes['ad-thumb']);
    	unset( $sizes['ad-small']);
    	unset( $sizes['ad-medium']);
    		
    	return $sizes;
    }
    add_filter('intermediate_image_sizes_advanced', 'sgr_filter_image_sizes');
    You should be set to create your own custom sizes. Credit to Ade Walker http://www.studiograsshopper.ch
    GuamGrabs.com - A local classifieds site for Guam

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,958
    Thanks
    169
    Thanked 3,405 Times in 3,276 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    cswebtech's Avatar
    Join Date
    Oct 2011
    Location
    United States
    Posts
    81
    Thanks
    5
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Member zuko's Avatar
    Join Date
    Apr 2011
    Location
    United Kingdom
    Posts
    81
    Thanks
    0
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Removing 'No Tag'
    By homme143 in forum ClassiPress General Discussion
    Replies: 20
    Last Post: March 12th, 2012, 02:18 PM
  2. Removing the price tag
    By caithnessbay in forum Help Using ClassiPress
    Replies: 1
    Last Post: December 5th, 2011, 08:57 AM
  3. Removing Google Map
    By ali911 in forum JobRoller General Discussion
    Replies: 1
    Last Post: May 22nd, 2011, 08:49 AM
  4. Removing Admin Bar at the top
    By nelvis in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: September 19th, 2010, 09:20 AM
  5. Removing price
    By k9media in forum Help Using ClassiPress
    Replies: 1
    Last Post: June 3rd, 2010, 05:29 PM