Support » Theme: Kadence » Thumbnails on restricted content?

  • Looking for pointers here. I want to ensure post thumbnail displays on woocommerce membership restricted posts. (Thumbnail IS displayed if I switch to default theme such as twentytwenty, but not on Kadence). Should I look at adding custom css, add a snippet to ensure .has-post-thumbnail on access-restricted etc. A bit lost, as you can tell. Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey,
    I’m not very familiar with woocommerce memberships. Can you tell me what you’ve selected in terms of how you are showing the featured image. Can you send a link?

    Ben

    Thread Starter jvsouthwood

    (@jvsouthwood)

    Hi Ben,
    Thanks. Compare these two:

    1 Live site, Kadence theme, featured image is not called.
    https://londonsavate.co.uk/online-academy/lessons/20-minutes-of-footwork-leg-strength-drills/

    2 Staging site, otherwise identical but switched to twentytwenty-one theme, and featured image does show.
    https://staging2.londonsavate.co.uk/online-academy/lessons/20-minutes-of-footwork-leg-strength-drills/

    When I view source I cam see different handling of has-post-thumbnail and figure class. But I am not quite sure what I need to look for in order to make any adjustment.

    By this comparison it would seem to be a difference in how the theme is handling it, rather than the membership plugin, right?

    Thanks for any help you can offer.

    Can you tell me what you’ve selected in terms of how you are showing the featured image?

    https://share.getcloudapp.com/BluQw5W8

    I wonder if woocommerce memberships is hooking into post_password_required. Kadence checks if a password is required before outputting the featured image, it won’t show the featured image if a password is required.

    https://developer.wordpress.org/reference/functions/post_password_required/

    They could be filtering on that to return true for pages that are “protected”

    Ben

    Thread Starter jvsouthwood

    (@jvsouthwood)

    Hi thanks. I have ‘show featured image’ set as off, as I don’t want it to display on the posts themselves. It still appears in archive layout.

    Hey,

    I guess I am confused, If you are turning off the featured image for single posts then I suppose I am misunderstanding. I thought you wanted to show the featured image in your single posts.

    You wrote:

    1 Live site, Kadence theme, featured image is not called.
    https://londonsavate.co.uk/online-academy/lessons/20-minutes-of-footwork-leg-strength-drills/

    But it won’t be called if you have it set to off. Can you help me understand?

    Ben

    Thread Starter jvsouthwood

    (@jvsouthwood)

    Sorry, I should have specified more clearly that I am talking about the elements which are displayed when a user is restricted from viewing the page. (E.g. as you would be on the links above).

    I do not wish for the featured image to display on the posts when viewed unrestricted, but only alongside the excerpt for restricted access users. This appears to be the default behaviour on other themes (link 2 in above post), but Kadence is, it seems, not calling the featured image on access-restricted pages.

    Might I get round it by switching the Kadence setting to ‘Show Featured image’ and then adding some custom css with display:none for that element on the unrestricted page? If that sounds reasonable, can you think what it would be?

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    body:not(.access-restricted) .article-post-thumbnail {
        display: none !important;
    }

    That should be the css you are asking for.

    I wonder if showing the thumbnail is something woocommerce memberships does specifically for the default theme. I’m not familiar with that plugin.

    Ben

    Thread Starter jvsouthwood

    (@jvsouthwood)

    Oh, this is beautiful! Works perfectly. Thanks for sticking with my question!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.