In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to automatically get screenshots of the website in the WordPress article. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
I. short code
Add the following code to the current theme function template functions.php:
Function wp_screenshot ($atts, $content=null) {extract (array ("shots" = > "https://s0.wordpress.com/mshots/v1/","url" = >" https://www.wpbeginner.com","width" = > "600,000", "height" = > "450"," alt "= >" screenshot "), $atts)); $img ='
'; return $img;} add_shortcode ("shot", "wp_screenshot")
When publishing an article, add a short code:
[shot url= "http://zmingcx.com/"]
Or customize the screenshot size.
[shot url= "http://zmingcx.com/" width=" 600 "height=" 4501]
Just modify the URL link.
Concrete effect
Second, add links directly
This method is more convenient to use to obtain the basic format of the screenshot:
Https://s0.wordpress.com/mshots/v1/http://zmingcx.com/?w=600&h=450
You can also directly add the above address link format to the article as if it were normally inserted into a picture (insert from URL). This is how the screenshot above is added, without short code.
Due to the need to generate screenshots immediately, you may not be able to see the picture the first time you open it, just refresh it, or refresh it a few more times. The generated screenshots are stored on the WordPress.com server and do not take up their own space and resources, but loading may be a bit slow.
On how to achieve in WordPress articles automatically get screenshots of the method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.