-
AuthorPosts
-
March 27, 2014 at 3:40 pm #243849
Hello
I have a question / problem.
I am using the layout with a sidebar for a blog post however the image that is being pulled into this page is the entry_without_sidebar image – why is this?
You can see an example of this on: http://new.mclean-williams.com/matthew-lloyd-davies-in-a-small-family-business/
I have tried forcing the post template to take the entry_with_sidebar image but this messes up other things.
Why is this page being treated as though it doesn’t have a sidebar even though it does?
Thanks
JoelMarch 30, 2014 at 9:49 am #245024Hey joelkriteman!
The image on the page right now is 710×360 so I’m not sure what you mean.
Cheers!
DevinMarch 30, 2014 at 11:01 am #245041Hey Devin
Thanks very much for coming back to me. I shall attempt to explain my problem more accurately.
You are correct that the image showing on that page is 710 x 360.
However it should be 710 x 398.I have edited the functions.php file so that the entry with sidebar image is 710 x 398 ( I do not wish to edit the size of entry without sidebar as this would impact the size of images in the slider which I have used on the homepage).
See here: http://new.mclean-williams.com/functions.png
I regenerated images etc so to my understanding, on the page in question the image showing should be 710 x 398.
If you look at this screenshot of the page in question: http://new.mclean-williams.com/sidebar.png
You can see that the page does have a sidebar and yet the class of the image being pulled in is attachment-entry_without_sidebar.
I want this to be attachment-entry_with_sidebar. As the page clearly does have a sidebar, what do I need to do so that the attachment has the class attachement-entry_with_sidebar?
I attempted forcing this page to give the image class attachment-entry_with_sidebar by modifying the includes/loop-index.php file and this did work however it messed up my newsletters page where at the moment I am choosing to show the top image full size as it made that show at 710×398 too which I don’t want.
Hope that all makes sense and you understand my problem.
Thanks
Joel
April 1, 2014 at 10:17 am #245896Kriesi often re-uses or re-simplifies code so my guess is that at some point the loop just stopped using a different image for each page. I’ll tag him on the topic as he will be able to give the best answer.
April 7, 2014 at 10:08 am #248096Hello
Just wondering if it is possible to get an answer on this issue please…
Thanks
Joel
April 9, 2014 at 8:10 am #249142Hey!
Open up wp-content/themes/enfold/includes/loop-index.php and replace:
$size = strpos($blog_style, 'big') ? strpos(avia_layout_class( 'main' , false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square';
with
$size = strpos($blog_style, 'big') ? strpos(avia_layout_class( 'main' , false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square'; if(is_single() && strpos(avia_layout_class( 'main' , false), 'sidebar')) $size = 'entry_with_sidebar';
This modification should make sure that the “entry_with_sidebar” thumbnail size is used on the single post page.
Best regards,
PeterApril 9, 2014 at 1:31 pm #249228Hi Dude
Thanks for your help on this. Could I ask you to double check that please as it doesn’t seem to have made a difference?I’m still getting the entry_without_sidebar class on that page.
I can see that I was close before with my own solution but that didn’t work either.
My solution was a bit more heavy handed but similar:My solution was to change the line below from:
$current_post[‘slider’] = get_the_post_thumbnail($current_post[‘the_id’], $size);
to$current_post[‘slider’] = get_the_post_thumbnail($current_post[‘the_id’], ‘entry_with_sidebar’);
this did work however it meant that the entry_with_sidebar image was being shown everywhere even in places where that wasn’t what was required such as where I was choosing to show blog posts with full size images within other pages.
I tried applying your solution both to my child theme and the core enfold theme and it didn’t seem to work – could you look again please?
Thanks
Joel
April 13, 2014 at 8:39 am #250690Hey!
Please create me an admin account – I’ll look into it.
Cheers!
PeterApril 13, 2014 at 11:46 am #250733This reply has been marked as private.April 14, 2014 at 8:02 am #250920Hey!
I fixed it. It seems like we can’t use the avia_layout_class() return value directly for the haystack of the strpos() function. I now replaced:
$size = strpos($blog_style, 'big') ? strpos(avia_layout_class( 'main' , false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square';
with:
$layout = avia_layout_class( 'main' , false); $size = strpos($blog_style, 'big') ? (strpos($layout, 'sidebar') !== false) ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square';
and it started to work. I’ll ask Kriesi to patch it with the next update.
Cheers!
PeterApril 14, 2014 at 11:08 am #250984That’s great thank you.
Very pleased we got there in the end.
Thanks for all your help
Joel
:-) -
AuthorPosts
- The topic ‘entry with sidebar’ is closed to new replies.