New Landing How can we help? Atelier Featured Images disappear on main blog page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Atelier
  • #190653
    flavius
    Member
    Post count: 5

    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

    #190691
    David Martin – Support
    Moderator
    Post count: 20834

    Hey,

    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.
    #190701
    flavius
    Member
    Post count: 5
    This reply has been marked as private.
    #190714
    David Martin – Support
    Moderator
    Post count: 20834

    Hey,

    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.

    #191531
    flavius
    Member
    Post count: 5

    Hi 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

    #191951
    David Martin – Support
    Moderator
    Post count: 20834

    Hi 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.

    #201167
    flavius
    Member
    Post count: 5

    Many 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!

    #201278
    David Martin – Support
    Moderator
    Post count: 20834

    Glad to see you got it working as needed!

    Thanks for reporting back.

    – David.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register