0

I'd like to create new thumbnail options in Bones and have followed the instructions in the Bones theme Functions.php file. I am expecting therefore that one should be able to choose from the Size Dropdown menu the new thumbnail I have set like this. (note, the default wp sizes is showing)

enter image description here

taken from this example http://www.limecanvas.com/adding-custom-image-sizes-to-wordpress-3-5-media-manager/

Am I misunderstanding how it works in Bones perhaps? These are the instructions from the Functions.php file.

To call a different size, simply change the text inside the thumbnail function.

For example, to call the 300 x 300 sized image, we would use the function: for the 600 x 100 image:

But I don't want to be use the PHP code, rather a specific size from the dropdown menu as mentioned from the Add Media (Media Library) as above

Many thanks

EDIT:

In the Bones theme, this is where the add_image_size is added: https://github.com/eddiemachado/bones/blob/master/functions.php And this is where the add_theme_support function is called: https://github.com/eddiemachado/bones/blob/master/library/bones.php

EDIT: I can see that the images are being generated so that part is working. I just don't get the dropdown option to choose the images from.

0

If your theme already includes:

add_theme_support( 'post-thumbnails' );

Then you can just add a new size in functions:

add_image_size('custom', 70, 70, TRUE);

http://codex.wordpress.org/Function_Reference/add_theme_support http://codex.wordpress.org/Post_Thumbnails

  • Thanks Brad, I have added an EDIT above to explain where Bones theme is already doing this. – SixfootJames Jan 5 '14 at 17:22
  • I think that answers your question? – Brad Dalton Jan 5 '14 at 17:29
  • If only it did ;) But I've applied this and found it not working. – SixfootJames Jan 5 '14 at 17:39
0

WordPress already includes some default image sizes so the drop down should be there regardless of theme.

Here is what you should do.

First change theme to a default theme (2012,2013, etc..) Then try to insert an image in your post. If the drop down is there it's your theme. If it's not there start deactivating plugins checking each time you deactivate one. If that doesn't work go to http://wordpress.org download the latest version and overwrite all of your core files.

If it is your theme try re-downloading and overwrite your theme files. If you have made changes to the themes code try and trace back your steps and note your changes and keep the broken theme in a backup for comparison with the freshly downloaded theme.

This should get you on the right track.

  • Hi Jacob. The dropdown is there. It's the for the default image sizes. What I need however is for the dropdown to show the new custom image sizes I am setting up through the add_image_size function codex.wordpress.org/Function_Reference/add_image_size Specifically I am trying to get it to work through the Bones Theme. – SixfootJames Jan 6 '14 at 7:47
0

Turns out you needed to add this additional hook into your functions.php file

add_filter( 'image_size_names_choose', 'my_custom_sizes' );

function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'your-custom-size' => __('Your Custom Size Name'),
    ) );
}

Soon as I did that the image sizes appeared in the dropdown menu. Solution here: http://codex.wordpress.org/Function_Reference/add_image_size#For_Media_Library_Images_.28Admin.29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.