WordPress.org

Ready to get started?Download WordPress

Forums

Cannot select featured image sizes - only original size (8 posts)

  1. blend1
    Member
    Posted 1 year ago #

    I set up a gallery on my website and the thumbnails are meant to be generated automatically from the selected featured images. The thumbnails are supposed to remain static when you hover over them and then the full image is to open in a light box once you click on the thumbnail. However, it seems like there is something wrong with WordPress and it's ignoring the theme's command to do the cropping etc. and when I select a featured image I can only select the full size version, not the full one. As a result, the gallery looks funky as when you hover over a project on the overview page, the initial thumbnail is zoomed into the top-left hand corner of the image and once you hover it zooms out to a stretched version of the image (see here http://www.unitech-engineering.co.uk/projects/ ). When you refresh the page, it goes back to the initial zoomed in preview. I've replaced most of the wordpress files and re-uploaded them via FTP hoping that it would solve the problem but it hasn't. Any suggestions?

  2. riversatile
    Member
    Posted 1 year ago #

    Hi,

    I think the custom image size in your WordPress is broken.
    Check in your Functions.php if you have a function like this one :
    (This is a sample of my Functions.php in which I created a custom image size for post thumbnail)

    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
      set_post_thumbnail_size( 350, 150, true );
    
      add_image_size( 'post-thumb', 350, 150, true );
    }
  3. blend1
    Member
    Posted 1 year ago #

    Hello,

    Thank you for your quick reply! No, I don't appear to have this function in functions.php (it's not in the original functions.php in the wordpress 3.4.2 either, I downloaded it less than an hour ago!). Where should I paste it within the code?

  4. riversatile
    Member
    Posted 1 year ago #

    I understand the issue... I had the same issue by the past when I did not understand I can't do everything without a minimum setup for post thumbnail.
    To understand, you should go here :
    http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size

    When you upload images, images are not cropped and crunched for a post thumbnail purpose. That's why images look like this.
    I saw that in your page, post thumbnails dimensions must be 280px for Width and 140px for Height.
    So try to add this code in the Functions.php file :

    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
      set_post_thumbnail_size( 280, 140, true );
    
      add_image_size( 'post-thumb', 280, 140, true );
    }

    Then save your Functions.php file and overwrite the file on your erver.

    Then, to make this working, you have to remove and re-upload the images. They will be cropped and crunched to be used as post thumbnail in your the future.

    Finally, reassign your new images to your gallery.

    Before testing, don't forget to clear your browser cache.

  5. blend1
    Member
    Posted 1 year ago #

    I tried that and it didn't work. I still can't select an image of a different size. Where should I paste the code you gave me in functions.php? At the bottom of the code, or on any specific line? I pasted it on the bottom and it didn't work.

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    You don't actually select an image size to use.

    The code in functions.php tells WP what size images to make. When you upload an image, all the sizes specified in your code are created.

    then within your templates, you call to the appropriate sized image you established. Fo r instance looking at the example which was provided above

    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
      set_post_thumbnail_size( 280, 140, true );
    
      add_image_size( 'post-thumb', 500, 300, true );
    }

    If in your template, you called

    the_post_thumbnail();

    You would get a 280x140 image

    If you called

    the_post_thumbnail( 'post-thumb' );

    you would get the 500x300 version

    EDIT - rereading your opriginal post, I'm not 100% sure I'm answering the question you were asking. What theme are you using first of all, so we can investigate the code

  7. blend1
    Member
    Posted 1 year ago #

    The theme I'm using is Athena - here is the 3 column portfolio example http://www.freaklife.com/athena/3-columns-portfolio For example, the 2nd and 3rd thumbnails in the first row, when you hover your cursor over them you just get the magnifying glass appearing, no zooming out like on my project page. I hope this helps...

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    I'm sorry but as you are using a commercial theme, you need to seek support from the theme's vendors.
    http://themeforest.net/user/ginaalessia

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.