首页    >    新闻资讯    >   文章中显示网页截图

文章中显示网页截图

在functions.php中做如下修改,你的主题就可以使用第二段代码,从而显示某个网页的截图,而不一定非要使用上传图片了,是不是还比较方便呢?

PHP

function wps_screenshot($atts, $content = null) {
        extract(shortcode_atts(array(
            "screenshot" => 'http://s.wordpress.com/mshots/v1/',
            "url" => 'http://',
            "alt" => 'screenshot',
            "width" => '400',
            "height" => '300'
        ), $atts));
        return $screen = '<img src="' . $screenshot . '' . urlencode($url) . '?w=' . $width . '&h=' . $height . '" alt="' . $alt . '"/>';
}
add_shortcode("screenshot", "wps_screenshot");

shortcode

[screenshot url="http://wordpress.la" alt="wordpress code snippets for your blog" width="200" height="200"]

 

分类:新闻资讯

标签:, , , ,

* 版权声明:作者WordPress啦! 转载请注明出处。

kadıköy escortbostancı escortataşehir escortbostancı escortmaltepe escortmaltepe escortanadolu yakası escortanadolu yakası escortataşehir escortbostancı escortistanbul escortkartal escortbostancı escortkartal escortkadıköy escortpendik escortpendik escortmaltepe escortataşehir escortmaltepe escortmaltepe escortanadolu yakası escortkadıköy escortataşehir escortkadıköy escortataşehir escortümraniye escortataşehir escortkartal escortescort bayankartal escortpendik escortkartal escortgöztepe escorttuzla escortkadıköy escortkartal escortkadıköy escortmaltepe escortkartal escortataşehir escortmaltepe escortbostancı escortkartal escortpendik escortkadıköy escortataköy escortavrupa yakası escortataköy escortbakırköy escortbeylikdüzü escorttaksim escorthalkalı escortetiler escortbodrum escortmalatya escortankara escortantalya escortmersin escortantalya escortHacklinkHacklinkshellwso shellwso shellgörüntülü sohbettipobetbahis siteleri