Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Featured Images disappear on main blog page
New Landing › How can we help? › Atelier › Featured Images disappear on main blog page
- This topic has 7 replies, 2 voices, and was last updated 9 years by David Martin – Support.
-
Posted in: Atelier
-
July 1, 2015 at 3:03 pm #190653
Hello,
Firstly, thank you for one of the most feature packed and well-built themes that I’ve ever used!
Everything works perfectly, apart from what seems to be a small compatibility issue with a plugin I’m using. I’m using the WP Related Items plugin [https://wordpress.org/plugins/wp-related-items/] to display related products on single post pages. It all works correctly except that when the plugin is active, featured images disappear from the main blog page.
The plugin devs think it’s an issue with the Atelier theme as this problem does not occur with the default WP theme. Having looked through the theme files, I suspect it might have something to do with the sf_post_thumbnail function in sf-post-formats.php. It seems that this function incorrectly thinks the posts don’t have a featured image, when they do. Although I could be wrong!
I’d be grateful for any help or advice.
Regards,
Richard
July 1, 2015 at 4:20 pm #190691Hey,
This looks to be now working for me? See screenshot.
Did you amend the plugin or theme?
Thanks.
Attachments:
You must be logged in to view attached files.July 1, 2015 at 4:38 pm #190701This reply has been marked as private.July 1, 2015 at 5:13 pm #190714Hey,
I am running this on my dev version with no issues.
This could be a conflict with your child theme or another plugin.
Can you revert to the main theme and report back?
Thanks,
David.July 3, 2015 at 1:58 pm #191531Hi David,
Do you have the WRI Related plugin installed on your dev version with no issues?
I tried the main theme and the problem remains. I also tried disabling all plugins (except WRI Related and Yet Another Related Posts Plugin [https://wordpress.org/plugins/yet-another-related-posts-plugin/]) with no luck.
I’ve realised that the problem only happens in your theme if I use the Blog shortcode. If I use this shortcode (with the plugins mentioned active), no featured images are show. Other archive and category pages correctly show featured images. The problem seems to be the Blog shortcode.
Hopefully this helps.
Regards,
Richard
July 6, 2015 at 12:08 pm #191951Hi Richard,
Sorry I did not install YARPP – that then caused me to get the same error.
We cannot support all 3rd party plugins and customise the theme to work with these for individual needs.
However I can point you in the right direction:
The issue is caused because the post id’s of each post is not getting passed to the image functions, rather the page id where the shortcodes exist gets passed.1) You or your web dev will need to edit the file in a child theme sf-post-formats.php.
2) Find the function sf_post_thumbnail()
3) Change this line
function sf_post_thumbnail( $blog_type = "", $fullwidth = "no" ) {
To:
function sf_post_thumbnail( $blog_type = "", $fullwidth = "no", $postID ) {
4) On line 370 find this change:
$item_figure .= sf_post_thumbnail( $blog_type, $fullwidth );
To:
$item_figure .= sf_post_thumbnail( $blog_type, $fullwidth, $postID );
5) Go back to the function sf_post_thumbnail() and update all instances where you are getting posts meta to include the new
$postID
variable. Example:$thumb_type = sf_get_post_meta( $postID, 'sf_thumbnail_type', true);
$thumb_image = rwmb_meta( 'sf_thumbnail_image', 'type=image&size=full' );
To:
$thumb_type = sf_get_post_meta( $postID, 'sf_thumbnail_type', true, $postID );
$thumb_image = rwmb_meta( 'sf_thumbnail_image', 'type=image&size=full', $postID )
;This will get your images working, you will need to apply the same logic to creating the permalink structure for each post.
This is complex and I would recommend you work with a web developer to do this, hopefully this will help you some or all of the way.
Thanks.
August 5, 2015 at 11:41 pm #201167Many thanks for your detailed solution which got the featured images working again. However, the images only displayed for regular posts and not gallery, video or audio posts.
In the end, I managed to get around the problem by adding a function that disables YARPP from loading on the blog page only. Conflict resolved!
August 6, 2015 at 10:06 am #201278Glad to see you got it working as needed!
Thanks for reporting back.
– David.
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.