Hi,
I’m using Woocommerce’s Membership plugin to display content for my members only. This means some posts are public and some are accessible for members only. With this plugin, when you specify that a post is for members only, it replaces the_content()
with whatever message you want to display.
My issue is that I also need to replace the featured image with another image for non-members. I really don’t know how to do this, but I went in this direction:
add_filter( 'generate_featured_image_output', 'edf_display_featured_image' );
function edf_display_featured_image(){
if(current_user_can('wc_memberships_view_restricted_post_content',get_the_ID() ) ){
// Display post image
} else {
// Display image ID 1699
}
Any way you could help me out with the // Display post image
and // Display image ID 1699
parts?
Thanks a lot for your help
Andrew