[Resolved] Different featured image for list and page

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Different featured image for list and page

This topic contains 4 replies, has 2 voices, and was last updated by  Bas 1 week, 3 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12580

    Bas
    Participant

    Hi,

    I’m making a list for 9 pages and each page has a featured image.
    Is it possible to show different images (or icons) on the list, and when the list item is clicked and the page opens, it shows the true featured image?
    I’m using GeneratePress Premium as well if that might help.

    Thanks !

    #12581

    Bas
    Participant

    Update:

    I’ve added a 2nd featured image meta box with ACF but now i’m stuck on how to let WPSP know it should use the 2nd image.

    #12582

    Bas
    Participant

    Update:

    More research lead me to the following snippet I made which works but the “original” featured image which is shown by WPSP is still there as well.

    
    add_action( 'wpsp_inside_image_container', function( $settings ) {
        if ( 10449 === $settings['list_id'] ) {
            $image = get_post_meta( get_the_ID(), '2nd_featured_image', true );
    
        if( get_field('2nd_featured_image') ):
    	?><a href="<?php the_permalink(); ?>"><img src="<?php the_field('2nd_featured_image'); ?>" alt="" /></a><?php
    	  
        endif;
        }
    } );
    

    Is there a way to disable the WPSP image?

    #12636

    Tom
    Keymaster

    Hi there,

    Instead of wpsp_inside_image_container, try wpsp_before_header or wpsp_before_content (depending on where you want to put it).

    Then you can disable the image inside the settings.

    #12642

    Bas
    Participant

    Thanks, works like a charm.

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

You must be logged in to reply to this topic.