Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Featured image not being cropped (http://forum.bytesforall.com/showthread.php?t=20974)

bignall Oct 2, 2013 04:52 PM

Featured image not being cropped
 
Hi -

I've made no recent changes to my theme, however for some reason the featured images on posts are no longer being cropped. I can see the bfa_thumb(620,180 ... in the code, but it does not seem to be cropping the image. Can anyone point me to where I should look to find out why it is not working?

Site URL: http://rosina.me/

Thanks,
Rosina

juggledad Oct 2, 2013 05:13 PM

step 1 - disable all plugins to see if there is a conflict

bignall Oct 2, 2013 06:03 PM

I did disable all plugins, to no avail. I have reenabled them now but I did turn them all off and disabled all caching.

juggledad Oct 2, 2013 06:09 PM

Copy your theme export settings to a text file and attach them to a response

CrouchingBruin Oct 2, 2013 06:57 PM

Quote:

Originally Posted by bignall (Post 104015)
I can see the bfa_thumb(620,180 ... in the code,

What's the rest of the parameters? It's the third parameter that is critical, that parameter determines if the image is cropped or not. By default, the value of the third parameter is false (not cropped). It has to be set to true for the image to be cropped:
Code:

<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>' ); ?>

lmilesw Oct 2, 2013 09:40 PM

As an aside your pictures should be optimized for web. The ones I looked at were 500Kb to almost 1 Mb.

bignall Oct 3, 2013 07:09 AM

Thanks so much for your help @Juggledad. Attached are the settings.

@CrouchingBruin Here's the rest of the parameters:

PHP Code:

<?php bfa_thumb620180true'<div class="thumb-shadow"><div class="post-thumb">''</div></div>' ); ?>

As you can see it is true (which does seem to be the default since I haven't changed it).

@lmilesw Yes good point, I should stop being lazy but it's a personal site for my friends and family to see what's going on, not expecting thousands of visitors... still, always a wise idea.

bignall Oct 3, 2013 07:14 AM

1 Attachment(s)
Helps if I actually attach the file.... /o\

lmilesw Oct 3, 2013 07:33 AM

In one installation I did find the spaces between 620,180,true in the code were problematic. When I edited this
HTML Code:

<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>' ); ?>
To This
HTML Code:

<?php bfa_thumb( 620,180,true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>' ); ?>
All worked as intended so may be something to try.

bignall Oct 3, 2013 07:55 AM

Thanks for the suggestion. I tried it - it "shouldn't" make a difference (as a developer I know that sometimes compilers/interpreters do weird things so I tried anyway) -, but unfortunately in this case it didn't work.

juggledad Oct 3, 2013 09:37 AM

with your settings, posts that have featured images set work exactly like they should. It has to be something specific about your setup.

bignall Oct 3, 2013 09:19 PM

Okay, hmm. I guess I'll go back and remove all my plugins again. Hopefully I can find it.

bignall Oct 8, 2013 10:30 PM

Well at long last I figured it out. In the Jetpack plugin there is an option that lets you serve your images from wp.me. I had turned this on. When the images are served from wp.me, apparently bfa_thumb can't do its magic. I disabled Jetpack, but the images were still coming from wp.me. When I removed the image and added it back on and saved the post, they were no longer served from wp.me, bfa_thumb did its magic again and all is good again. Any chance that bfa_thumb ca work with these remote images? Or can it only work with local images.

I don't need them served from wp.me, so I'll just turn it off, but hopefully there's a resolution for this.

juggledad Oct 9, 2013 04:59 AM

I'd have to see it with the images coming from wp.me to see. I don't use jetpack, I've seen too many 'issues'

bignall Oct 9, 2013 09:43 AM

I've turned back on the service so that you can see how it works. The Jetpack subplugin is call Photon and it delivers images and videos from the WP CDN, so it apparently uploads your images and uses a http://ip2.wp.com/... url to reference it.

For the most part I've had no problems with Jetpack and it has some nice features. I'm sure it has issues. But I totally get not using a plugin, there are plugins I won't use too ;)

juggledad Oct 9, 2013 12:21 PM

It looks like the jetpack code is altering the <img...> statement. Here is what comes out normally
HTML Code:

<div class="thumb-shadow">
        <div class="post-thumb">
                <a href="http://mydomain.com/wp35/block-quote/">
                        <img src="http://mydomain.com/wp35/wp-content/uploads/2013/02/image1.jpg" width="620" height=" 180" alt="block quote"/>
                </a>
        </div>
</div>

and this is from your site
HTML Code:

<div class="thumb-shadow">
        <div class="post-thumb">
                <a href="http://rosina.me/baby-chicks/">
                        <img src="http://i2.wp.com/rosina.me/wp-content/uploads/2013/09/IMG_20130922_191240_643.jpg?resize=2591%2C1840" width="" height="" alt="Baby Chicks!"/>
                </a>
        </div>
</div>

notice the '?resize=2591%2C1840' tacked on to the end of the 'src=...' and the lack of a width or height. Unless there is a way in the plugin to shutoff the code that handles featured images.

Here is a thought, swap to twenty-thirteen and see if you get a thumbnail or large image there.

bignall Oct 9, 2013 06:59 PM

So I switched to 2013 and I get the thumbnails. On inspecting the code I see:

HTML Code:

<div class="entry-thumbnail">
  <img width="604" height="270" src="http://rosina.me/wp-content/uploads/cache/2013/10/IMG_20130923_154146_591/604x270x1819850138.jpg.pagespeed.ic.aiF0ugjqgr.jpg" class="attachment-post-thumbnail wp-post-image" alt="Z eating the chick's food">       
</div>

2013 seems to ignore the Jetpack setting and serves the page from my own server instead of the CDN.

I'll leave it with this theme for a day or so so you can see it.

juggledad Oct 10, 2013 07:02 AM

my rough guess is that it would take at least an hour to dig into this and that is just more time that I'm willing to give to the forum. Note, this could be a WP bug since Montezuma and Twenty-Thirteen use different WP functions to get the featured image.

now if you wanted to hire me to look into this send me a PM.

bignall Oct 10, 2013 11:50 AM

It could be. Well it's not that important to me to make sure it gets fixed. I was just hoping it was a quick and easy one :) . Thanks for taking a look at it and THANK YOU for all the work you've done on the themes!

For now, I'll just go back to not using the CDN. If it becomes so important that I need it for some site, then I'll look into it further.

cwikdahl Oct 9, 2015 10:50 AM

Just disable the "Photon" option i Jetpack and it works!

I have to reload and alter/save the php file a couple of times before anything happens, but that seems to be routine when using this theme.


All times are GMT -6. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.