Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:42:33+00:00 2026-06-01T07:42:33+00:00

wordpress has a good support for images in general. to get new image sizes,

  • 0

wordpress has a good support for images in general.

to get new image sizes, one would just add some functions like :

add_theme_support( 'post-thumbnails' ); //thumnails
set_post_thumbnail_size( 200, 120, true ); // Normal post thumbnails
add_image_size( 'single-post-thumbnail', 400, 300,False ); // single-post-test
add_image_size( 'tooltip', 100, 100, true ); // Tooltips thumbnail size
/// and so on and so on 

my question is :

How can someone make those functions act in a dynamic manner , meaning that those sizes will be calculated on upload ?

for example – If I upload an image of 3000×4000 px – I would like my image sizes to be :

 add_image_size( 'half', 50%, 350%, False ); // Half the original
 add_image_size( 'third', 30%, 30%, true ); // One Third the original

Is there a way to do that ? where can I hook for that ?
Those image sizes are used registered in many functions –
Can someone think of an Uber-creative way to achieve that ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:42:34+00:00Added an answer on June 1, 2026 at 7:42 am

    You can use wp_get_attachment_image_src to get downsized images of an attachement, in you case you only need to specify add_theme_support( 'post-thumbnails' ) in your functions.php file then in your template do the following:

    $id = get_post_thumbnail_id($post->ID)
    $orig = wp_get_attachment_image_src($id)
    $half = wp_get_attachment_image_src($id, array($orig[1] / 2, orig[2] / 2))
    $third = wp_get_attachment_image_src($id, array($orig[1] / 3, orig[2] / 3))
    etc...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

WordPress has been installed as a blog into osCommerce. I'm trying to get the
Wordpress has a filter that automatically add paragraphs to posts. I can remove this
Has anyone ever modified the post-new.php file in their WordPress installation? I want to
I have started a wordpress blog hosted on (free)wordpress.com. Now it has good alexa
I'm trying to make a WordPress site that has six lists on a page,
A wordpress theme I'm working on has headlines which span across the entire content
I have a friend who has code like this in his wordpress files: Blockquote
I have a wordpress site with 5k post and each post has average 25
This deals with WordPress plugin development. Even if a user has not actually signed
Wordpress wraps images with captions in a div with a class of .wp-caption. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.