• I’m using multiple featured images plugin which gives you another box to place a featured image in.
    https://www.ads-software.com/extend/plugins/multiple-post-thumbnails/changelog/

    I am also using the filter

    add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
    
    function my_post_image_html( $html, $post_id, $post_image_id ) {
    
      $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
      return $html;
    
    }

    to place each thumb in an anchor
    but this only filter thumbs made used int he default featured box.
    how can i get the second featured box to be added to this filter?

    thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Eric

    (@shamai)

    nevermind i figured it out
    i added a second filter
    add_filter( ‘post_secondary-image_thumbnail_html’, ‘my_post_image_html’, 10, 3 );

    the ‘secondary-image’ part is based on the id you used

    what is the point of using this filter if I could code in the anchor tag the way i code in anything in the post?

    is is just to make life easier?

Viewing 1 replies (of 1 total)
  • The topic ‘adding anchor to multiple featured image box’ is closed to new replies.