• Resolved contemplate

    (@contemplate)


    Every time this plugin updates I have to manually edit the code to change the default Feature Image size in search results.

    /wp-content/plugins/better-search/includes/main-functions.php
    Line 82

    
    if ( bsearch_get_option( 'include_thumb' ) ) {
    	$output .= '<p class="bsearch_thumb">' . get_the_post_thumbnail( $search->ID, 'large' ) . '</p>';
    }
    

    Anyway we can get a hook or theme setting to choose the feature image size?

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

    (@ajay)

    I’ve filed an issue and will implement a wrapper function in the next version that will allow you to override the image with a filter.

    Thread Starter contemplate

    (@contemplate)

    Perfect thanks!

    Thread Starter contemplate

    (@contemplate)

    hmm @ajay. Was this filter ever added?

    I tried adding this filter but it doesn’t change anything:

    
    add_filter('bsearch_get_thumb_size', 'custom_bsearch_get_thumb_size', 10, 2);
    function custom_bsearch_get_thumb_size( $thumb_size, $args ) {
    	$thumb_size = 'large';
     	return $thumb_size;
    }
    
    Plugin Author Ajay

    (@ajay)

    @contemplate

    You need something along the lines of:

    
    add_filter('bsearch_get_thumb_size', 'custom_bsearch_get_thumb_size', 10, 2);
    function custom_bsearch_get_thumb_size( $thumb_size, $args ) {
    	$thumb_size = array( 150, 150 );
     	return $thumb_size;
    }
    
    Thread Starter contemplate

    (@contemplate)

    Perfect that worked!!!

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

The topic ‘Setting or Hook for setting feature image size’ is closed to new replies.