how to display a thumbnail of any website in Wordpress?
1 - Create the shortcode. Paste the code in your functions.php file
function wpr_snap($atts, $content = null) { extract(shortcode_atts(array( "snap" => 'http://s.wordpress.com/mshots/v1/', "url" => 'http://www.sharemycode.com', "alt" => 'My image', "w" => '400', // ancho "h" => '300' // alto ), $atts)); $img = '<img src="' . $snap . '' . urlencode($url) . '?w=' . $w . '&h=' . $h . '" alt="' . $alt . '"/>'; return $img;}add_shortcode("snap", "wpr_snap");
2 - You can use the snap shortcode in your post or page
[snap url="http://www.sharemycode.com" alt="Descripción" w="400" h="300"]
1 - Create the shortcode. Paste the code in your functions.php file
2 - You can use the snap shortcode in your post or page