We're merging with GenerateBlocks! Learn more here.

[Support request] Filter to Change Image Link

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Filter to Change Image Link

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9751
    Ben
    Participant

    Hi Tom,

    I use WP Show Posts on https://www.orangewinefestival.com.au/ to list events.

    I’ve have had a request from the client to see if it’s possible to change the link on the WPSP thumbnail image to link to an external website, rather than the single post page for the event. They want to do this for just one event.

    Is there a filter I could use to do that or is it not possible?

    Thanks,
    Ben

    #9764
    Tom
    Keymaster

    Hi Ben,

    This should be possible.

    For example:

    add_filter( 'wpsp_image_href', function( $href ) {
        // 10 is the ID of the event you want to target.
        if ( 10 === get_the_ID() ) {
            return 'YOUR CUSTOM URL HERE';
        }
    
        return $href;
    } );
    #9765
    Ben
    Participant

    Excellent, thanks Tom – i’ll give it a go.

    Cheers,
    BEn

    #9776
    Tom
    Keymaster

    No problem 🙂

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