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

    (@seestheday)

    To do this you would have to modify the plugin code. I can give you pointers on how to do this if you feel comfortable with that.

    Thread Starter zericha

    (@zericha)

    I am capable of cutting and pasting php if you tell me where it needs to go.

    Plugin Author Kremental

    (@seestheday)

    In the file called visual-recipe-index/includes/RecipeIndexView.php, edit the function called “private function ri_get_image”.

    Modify the last line of that function to add target='_blank' within the href tag.

    Plugin Author Kremental

    (@seestheday)

    I should also note that I can’t help you if you modify code and it breaks your site in any way. I hope that helps.

    Thread Starter zericha

    (@zericha)

    This is the function I’ve got:

    }
    private function ri_get_image($single){
    		$ri_img = '';
      		ob_start();
      		ob_end_clean();
    		if(get_ri_option('image_source')=='featured'){
    			if (has_post_thumbnail($single->ID )){
    				$image = wp_get_attachment_image_src(get_post_thumbnail_id( $single->ID ), 'single-post-thumbnail' );
    				$ri_img = $image[0];
    			}
    			else {
    				$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $single->post_content, $matches);
     				$ri_img = $matches [1] [0];
    			}
    		}
    		else {
     			$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $single->post_content, $matches);
     			$ri_img = $matches [1] [0];
    		}
    
      		if(empty($ri_img)){ //Defines a default image
        			$ri_img = get_ri_option('custom_image');
    		}
    
    		$size=array();
    		$size=$this->ri_get_size();
    
    			if((!is_numeric($this->params['quality']))||(int)$this->params['quality']>100)
    				$this->params['quality']='75';
    		//uses TimThumb to generate thumbnails on the fly
    		$ri_url = plugin_dir_url(__FILE__);
    		$returnlink = ($this->params['lightbox'])? ('"'.$ri_url.'RecipeIndexPost.php?ID='.$single->ID.'" class="ripost"') : ('"'.get_permalink($single->ID)).'"';
    		return '<a href='.$returnlink.'><img src="'.$ri_url.'timthumb.php?src='.urlencode($ri_img).'&h='.$size[1].'&w='.$size[0].'&zc=1&q='.$this->params['quality'].'" alt="'.$single->post_title.'" title="'.$single->post_title.'"/></a>';

    Can you show where I’d add and how?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Open link in new window’ is closed to new replies.