Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter orangjul

    (@orangjul)

    Is there a way to target the url of the photo of the day only? Whether you build a button using https://business.pinterest.com/widget-builder/#do_pin_it_button or us a plugin, if you want to predetermine an image to get pinned, you have to provide a url. I’ve tried adding both “#potd” and the whole “[wppa type=”photo” photo=”#potd” size=”600″ align=”center”][/wppa]” shortcode and neither work.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Do not think i skipped this, it takes some time to prepare a usefull reply…

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Edit wppa-potd-widget.php.

    Find line 71, it reads:

    .
    			if ($link) $widget_content .= "\n\t".'</a>';
    		}
    		else {	// No image
    			$widget_content .= __a('Photo not found.', 'wppa_theme');
    		}

    Change to:

    .
    			if ($link) $widget_content .= "\n\t".'</a>';
    
    	// Pinterest
    	$thumb = $image;
    	$desc = urlencode(sprintf(__a('See this image on %s'), str_replace('&', __a('and'), get_bloginfo('name')))).': '.urlencode(strip_shortcodes(wppa_strip_tags(wppa_get_photo_desc($thumb['id'])), 'all')).'" ';
    	if ( strlen($desc) > 500) $desc = substr($desc, 0, 495).'...';
    	$pi = 	'<div style="float:left; padding:2px;" >';
    	$pi .= 		'<a title="'.sprintf(__a('Share %s on Pinterest', 'wppa'), esc_attr(__(stripslashes($thumb['name'])))).'" ';
    	$pi .= 			'href="https://pinterest.com/pin/create/button/?url='.urlencode(wppa_convert_to_pretty(str_replace('&', '&', wppa_get_image_page_url_by_id($thumb['id'], $wppa_opt['wppa_share_single_image']))));
    	$pi .=			'&media='.urlencode(str_replace('/thumbs/', '/', wppa_get_thumb_url($thumb['id'])));						// Fullsize image
    	$pi .=			'&description='.$desc;
    	$pi .=			'target="_blank" >';//'class="pin-it-button" count-layout="horizontal" >';
    	$pi .=			'<img src="'.wppa_get_imgdir().'pinterest.png" style="height:16px;" alt="Pin it!" />';	//border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />';
    	$pi .=		'</a>';
    	$pi .=	'</div>';
    	$widget_content .= $pi;
    
    		}
    		else {	// No image
    			$widget_content .= __a('Photo not found.', 'wppa_theme');
    		}

    Keep this file as it will be overwritten at the next update!!!

    Thread Starter orangjul

    (@orangjul)

    Thank you! I haven’t had a chance to try it out yet but will do so soon!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    If the icon is too small, you can change style="height:16px;" if you like.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add pin it button to photo of the day only?’ is closed to new replies.