Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › First image in post not displaying in post grid
New Landing › How can we help? › Cardinal › First image in post not displaying in post grid
- This topic has 17 replies, 2 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Cardinal
-
July 7, 2014 at 8:38 am #88488
Hi Ed and team,
I have whipped up a quick demo to see how the news stories will display for our new client. And the issue I am seeing right away is the first image in the post is not coming through on the grid layout. I am not sure if there was a setting or tick box to have these images show.
Ed I remember yesterday you mentioned that this was in the latest update for the first image to be pulled into the Grid. Can you please confirm this as the images are not coming through.
– Ciaran
July 7, 2014 at 11:23 am #88590Hi Ciaran,
With the first image in the post, I was referring to the RSS feed, which I’m pretty sure was what you were asking about?
This is something we could provide a workaround for though, I’ll see what I can do to make it a child theme function so that you don’t have to worry about updates.
– Ed
July 7, 2014 at 11:33 am #88595Hi Ed,
Yes you are right about it being for RSS. however I didn’t realise that it wouldn’t show the images in the grid layout. That will be great if you have a workaround function for the child theme. I will test out the feed tomorrow when back in the office for Campaign Monitor. Will keep you updated on that progress.
– Ciaran
July 7, 2014 at 11:02 pm #88775Hi Ciaran,
Just implemented a filter for the post thumbnail image, so that we can use the same code that you’ll use for the RSS feed image. For reference, it should simply be this:
function custom_post_thumb_image($thumb_img_url) { if ($thumb_img_url != "") { global $post; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $thumb_img_url = $matches[1][0]; } return $thumb_img_url; } add_filter( 'sf_post_thumb_image_url', 'custom_post_thumb_image' );
– Ed
July 7, 2014 at 11:56 pm #88791Hi Ed,
I have added this to the child theme functions.php, but does not pull up the images for some reason.
http://cm.fullerdemo.com.au/campaigns/I have just ticked the box to make you super admin on the Multisite. I am sure that would have helped if I had done that from the start.
July 8, 2014 at 12:31 am #88798This reply has been marked as private.July 8, 2014 at 1:07 am #88809Hi Ed,
I have downloaded and updated to the latest build as per the link you have provided. is there a new setting somewhere that I am to tick to make the first image show? The first images do show great on the RSS as I have just tested that, but cannot see them on the grid layout.
July 8, 2014 at 2:05 am #88813This reply has been marked as private.July 8, 2014 at 2:10 am #88814Uploading the latest build now, and will add that snippet to the child functions.php
Will follow up shortly.July 8, 2014 at 2:19 am #88815Hi Ed,
oh we are so nearly there. I have updated the theme to latest build, added the snippet to child theme, and presto the images are showing. However the video auto thumbnails are not coming through. you can see this in the 4th post on my demo news site. http://cm.fullerdemo.com.au/campaigns/
July 8, 2014 at 11:06 am #88931Hi Ciaran,
Glad that’s working now! Ok, so you’re expecting the video thumbnails to pull from the first video in the page too? That might be a little more tricky…
– Ed
July 8, 2014 at 2:10 pm #89033Hi Ed,
Please note, I never expect things, but yes, I was hoping it would have brought in the preview thumb image that is rendered automatically by vimeo and youtube with that code supplied.
July 8, 2014 at 2:17 pm #89038Ahh ok. Unfortunately that would require quite a lot of custom code. To get the screenshot/thumbnail requires using the Vimeo/YouTube APIs as far as I’m aware. I’ve had a quick look and found these, something that you may be able to look into if you have the time/skills?
http://www.soapboxdave.com/2010/04/getting-the-vimeo-thumbnail/
http://stackoverflow.com/questions/18676534/generate-youtube-thumbnail-from-embed-code-using-php– Ed
July 8, 2014 at 2:20 pm #89039No issue at all, will you add the code to the next version of update? if so I will provide it. I have done it for one of our other news sites with genesis framework. I will be happy to provide the code if you don’t mind checking over it for submission to the update?
I am sure others will benefit from this as it is typical for news sites that have videos to display as thumbs in the grid.
July 8, 2014 at 2:28 pm #89042Of course! I haven’t decided the best way to go with these child theme functions, but I think it may be best if we add these to the knowledgebase so that they are searchable, and users can add what they need. I think that would be the best solution rather than integrating directly within the theme.
I think if it gets to the case where more than a few people are asking after it, then we will add it into the theme build.
Thanks,
– Ed
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.