Site preview using WordPress
Very good code for those who create a directory of sites. Now I use WordPress and without third-party scripts you can make a preview.
First you need to insert into the function.php file the code that will allow you to use the preview function directly from the content.
I used a similar code in one of the SEO services. You can also see something similar on a site that helps webmasters evaluate external factors affecting the site's search results.. www.cy-pr.com
Code Example:
function wps_screenshot($atts, $content = null) {
extract(shortcode_atts(array(
"screenshot" => 'https://s.wordpress.com/mshots/v1/',
"url" => 'https://',
"alt" => 'screenshot',
"width" => '400',
"height" => '300'
), $atts));
return $screen = '
';
}
add_shortcode("screenshot", "wps_screenshot");An example of a shortcode to be used on pages and posts.
An example of what happens:




