Support » Plugin: Contextual Related Posts » Is there filter for thumbnail output? I'd like to make them non-pinable!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ajay

    (@ajay)

    I am not familiar with how you prevent an image from being pinned, but you could use a filter function for either crp_thumb_class or crp_get_the_post_thumbnail

    Thread Starter Stachart

    (@stachart)

    I can achieve it by adding data-pin-nopin=”true” to my images! By example:

    <img src="..." alt="..." data-pin-nopin="true" />

    How can I do modifying the code! It seems that class filter function echo inside ” ” which will not fit. I think it may work with post_thumbnail filter.

    Plugin Author Ajay

    (@ajay)

    Yes, it will work with the second. Probably something like this:

    function crp_no_pin( $output ) {
      $output = str_replace( "/>", "data-pin-nopin=\"true\" />", $output );
      return $output;
    }
    add_filter( 'crp_get_the_post_thumbnail', 'crp_no_pin' );
    Thread Starter Stachart

    (@stachart)

    It works!
    Thanks a lot, Ajay!

    The only problem it gave if someone else want to implement it: it does not work with “custom size”!

    Regards!
    Pierre Eustache C.
    http://askeustache.com

    Plugin Author Ajay

    (@ajay)

    You’re welcome. By Custom size you mean the custom size thumbnail settings in the plugin settings page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is there filter for thumbnail output? I'd like to make them non-pinable!’ is closed to new replies.