WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] TimThumb issue, Sitewide Tags, update_option, and add_image_size function (11 posts)

  1. jw60610
    Member
    Posted 2 years ago #

    Mostly everyone's heard of the TimThumb issue, which sounds like is solved, but it got me to thinking about how to avoid using TT if possible.

    I'm using Twentyeleven as the base for my child theme. I'm using one child for my main blog and another for the sub blogs, so both are enabled for thumbnails. Also, the network settings allow for image uploads.

    I also have a custom post type that I created on the main page, and I'm using thumbnail images from those posts in a slider above the content I'm describing here.

    What I want to do is display thumbnails alongside the stream created by SiteWide Tags plugin.

    I did some research and found that you can change the media thumbnail settings through (this code may not be perfect):

    update_option ('thumbnail_size_w', 150, true);
    update_option ('thumbnail_size_h', 150, true);

    which would change the default size for the small thumbs to 150px and crop them as well.

    You can also create and name a custom size (which is gets to what my question is) using:

    add_image_size ( 'my_custom_size', 60, 60, true);

    which can then be presented in the loop for example with

    the_post_thumbnail ('my_custom_size');

    I've played with this, but I'm a bit confused. When using Sitewide Tags, in the loop created on my network home page, seems there's a lot going on to consider. There's the local default thumb size setting in the admin settings my sub sites are using, the default thumb size on the theme my main site is using, and the custom settings I created that will be in the functions.php file for either my sub blogs, main blog or both I'm not sure where to put them).

    Seems very simple at first, then get's more complicated as I try to implement it. I want the simplest solution possible.

    At first this seemed to best work by modifying the sub sites' function.php files to create a custom size, and do the same (using the same custom size name) on my main blog's function.php file, but when I try to call the image, it does not change. Each of the images is different size, reflecting some of the testing I did, but I was assuming setting a custom size and calling for that would have resulted in the same size thumbnails from each of the posts.

    By the way, I also used the regenerate thumbnail plugin before I refreshed the page.

    After all this, I'm wondering, "Is it better to just use TimThumb?"

    I hope this all makes sense, and thanks for any input.

  2. You may want to look at http://compu.terlicio.us/2011/04/timthumb-for-wordpress-multisite/

    There are many issues with TimThumb and MultiSite :/

  3. jw60610
    Member
    Posted 2 years ago #

    Ipstenu,

    Thanks, and I read through that.

    One question: which thumbnail settings affect post thumbnails in the loop created by Sitewide Tags plugin?

    The main site's thumbnail setting or the sub blogs? Which settings can I rely on to change the thumbnail size to make them uniform?

    Thanks.

  4. jw60610
    Member
    Posted 2 years ago #

    As I change the thumbnail size for the child blogs, the size also changes in the Sitewide Tags Loop output, even after I try to customize the size through the main blog's functions.php and loop using

    the_post_thumbnail('my_custom_size');

    I'm not 100 percent sure but it seems like that means that the sub blog's thumbnail settings are what affects the SWT plugin's loop thumbnail size.

    I'm a newbie to all this, so I'm not saying this from a position of authority, but would be cool if I could just set the thumbnail size on the Sitewide Tags settings page. Better yet, choose whether or not I want to select dimensions for the thumbnails or not.

  5. Right, because it;s pulling the size of the actual thumbnail, which you;ve set on the child blogs...

  6. jw60610
    Member
    Posted 2 years ago #

    Ok, so I kind of have that sorted. Thank you.

    In your opinion, what's better? Use TimThumb, or set custom thumbnail sizes and call those in the loop(s)?

  7. Use WordPress thumbnails. Unless you know how to rewrite the call to timthumb images for multisite.

  8. jw60610
    Member
    Posted 2 years ago #

    Thanks Andrea and Ipstenu!

    Wish I could do something to give back for all the generous advice. You guys are amazing.

  9. I accept bribes of quilt fabric. ;)

    (kidding. a bit.)

  10. jw60610
    Member
    Posted 2 years ago #

    Andrea,

    Ha ha, for all your help, would be happy to!!!

    Thank you again.

    JW

  11. jw60610
    Member
    Posted 2 years ago #

    FYI, here's an article on the subject I came across today:

    http://theme.fm/2011/08/images-image-sizes-and-post-thumbnails-in-wordpress-1385/

    I was able to set new thumbnail sizes for my theme and avoid TimThumb altogether.

Topic Closed

This topic has been closed to new replies.

About this Topic