Forum Replies Created

Viewing 15 replies - 16 through 30 (of 53 total)
  • Thread Starter steves_turn

    (@steves_turn)

    What line of code are you referring to here?

    I was referring to function spun_get_image( $id, $size = 'post-thumbnail' ) { IN template-tags.php (inc/template-tags.php), but you would have to update the functions.php and the css to also match post-thumbnail

    Thread Starter steves_turn

    (@steves_turn)

    I found the gray overlay, in the functions.php…I think that’s it…you can check the

    site

    -I might need to clean some stuff up and there might be more to it than that…but seems to have worked

    Thread Starter steves_turn

    (@steves_turn)

    I think that’s spot on…If you ask me the issue lies in this one line:
    function spun_get_image( $id, $size = 'home-post' ) {…I was trying to think of a way to modify that function to somehow use the ‘post thumbnail’ for the existing images and use ‘home-post’ for the new images, but somehow…also I think the set_post_thumbnail_size( 360, 360, true ); can work in conjunction with the add_image_size( 'home-post', 360, 360, true );. Wait a minute, what if we just modified the wording of ‘home-post’ to ‘post-thumbnail’? I think that would fix it. I played with that and it did seem to work…I am missing the gray overlay still somehow…need to find that css, but I think it works

    Thread Starter steves_turn

    (@steves_turn)

    So Andrew – you were totally right in your prior modifications…I tested this method and it seemed to work

    Changed the following:
    IN template-tags.php (inc/template-tags.php)
    REPLACED function spun_get_image( $id, $size = 'home-post' ) { WITH
    function spun_get_image( $id, $size = 'post-thumbnail' ) {

    IN Stylesheet (style.css)
    ADDED .blog .hentry a .attachment-post-thumbnail,

    IN Theme Functions (functions.php)
    ADDED set_post_thumbnail_size( 360, 360, true );

    I think I need to modify another css attribute because I lost some of the gray overlay on the featured image by making those changes. I also reverted them back, because I just wanted to test it out. It would also pose a problem to others if they added a bunch of posts after the 2.02 update, you would have to reupload those images I think. Anyway, I don’t think that is a fix, but maybe a possible workaround (minus the css issue).

    Thread Starter steves_turn

    (@steves_turn)

    I can try to play with the code or just regenerate, thx

    Thread Starter steves_turn

    (@steves_turn)

    So, is it just a matter of when upgrading from 1.7 to 2.02 v of Spun the ‘home-post’ does not yet exist (unless you upload a new image or reupload images)? Does that seem to be the issue? Also, you mentioned re-uploading DID fix it, right? You don’t have to reset all of your feature images though, do you?

    Thread Starter steves_turn

    (@steves_turn)

    Thanks, then are you also stumped on how to pull the 360×360 image? I looked at the code last night, but just couldn’t figure it out and I had to step away, haha. Also, what’s interesting is that sometimes I see ‘post-thumbnail’ and other times I am seeing ‘post-thumbnails’ (plural). I thought for a minute it was just a simple typo in the code somewhere, but I don’t think it is.

    Thread Starter steves_turn

    (@steves_turn)

    In your first image https://snag.gy/U6vqx.jpg, if you forced it to pickup the thumbnail, why is it 180×180? Also the pic looks weird I think because of the crop. Doesn’t add_image_size( 'home-post', 360, 360, true ); & set_post_thumbnail_size( 360, 360, true ); just add an image with those dimensions upload upload? I think the trick is using that image which is created by the set_post_thumbnail_size( 360, 360, true ); SO, instead of the URL showing https://wp-sandbox/wp-copntent/uploads/2014/01/1.jpg it should be displaying https://wp-sandbox/wp-copntent/uploads/2014/01/1-360×360.jpg…right?

    Thread Starter steves_turn

    (@steves_turn)

    Well, I don’t have any errors in my logs…what I meant by “issue accessing” is that somehow the new version of Spun I believe is not setting the featured image to the 360×360 version….it wouldn’t throw an error because I am guessing it was coded that way, but getting to the root of that is baffling me…how to set the featured image to look at the 360×360 size image…and I think it had to do with your hunch regarding add_image_size…Do you know where the code is to “set featured image”? Not sure if that will point me to the write answer though.

    Thread Starter steves_turn

    (@steves_turn)

    Haha, congrats, I think… If you look at the Spun demo site, it demonstrates the same issue even, it’s very apparent in the 2nd row, 2nd column pic ??

    To your previous comment: Which is weird because the image size is there in the uploads folder…that’s what I don’t quite understand – the old 360×360 images are in the uploads folder, it seems to be like an issue accessing or using those previously uploaded images. With the test file that worked the image was uploaded 20140204-142702-360×360.jpg…when we switched over to Twenty Thirteen in place of the 360×360 image was the 6-4×270 image (because that is what set_post_thumbnail_size told it to upload. I feel like somehow the mechanism to request the 360×360 image from the uploads folder is the problem…and it may very well be within the add_image_size function or WordPress or how Spun uses the new function (add_image_size)

    Thread Starter steves_turn

    (@steves_turn)

    Oh cool…Do you know why just switching to set_post_thumbnail_size( 360, 360, true ); doesn’t resolve the issue? I will just backup my site and regenerate the thumbs ??

    Thread Starter steves_turn

    (@steves_turn)

    Thanks again for the help – I really do want to get to the root of it, so odd. I do think that article you linked to https://wordpress.stackexchange.com/questions/108572/set-post-thumbnail-size-vs-add-image-size, has something close to an answer, but I don’t know how to make use of it (block quote below). It looks like add_image_size works when you “upload a new image”…which is why I think when I created the test image it worked as expected…I might end up just regenerating images though if I can’t figure it out:

    In addition to the functions mentioned above, there are other 2 functions that make use of image sizes: get_the_post_thumbnail and the_post_thumbnail.

    These 2 functions get (the first) and echo (the second) the image that is setted as “Featured Image” for a post.

    What is returned (or echoed) by this functions is a full img html tag (something like <img scr=”https://www.site.com/wp-content/2013/08/image-200×200.jpg&#8221; />) so, which size is used?

    Thread Starter steves_turn

    (@steves_turn)

    Yeah, I remember in my initial research playing with that function: set_post_thumbnail_size( 360, 360, true );. I even tried adding it back to the main functions.php file, but it didn’t work. It’s like all of the old images that were already uploaded in the previous version of Spun will not use the 360×360 thumb version of the pic, but if you reupload the same pic, it does…I am not sure why that is though.

    Thread Starter steves_turn

    (@steves_turn)

    OH weird, that messed up the image in Twenty Thirteen, it resized it to 604×270 (widthxheight).

    Thread Starter steves_turn

    (@steves_turn)

    You want me to reupload the newest image again, that I just uploaded in the Test post, in Twenty Thirteen theme, then check if the image is resized?

Viewing 15 replies - 16 through 30 (of 53 total)