Last update at :2024-01-24,Edit by888u
DUX should be the most commonly used theme on host evaluation blog sites, such as Snail Blog, Lao Zuo Blog (Lao Zuo Notes), Lao Tribe, Host Reference, VPSGO, VEIDC.COM, foreign host evaluation, etc., including our blog This site is also implemented using the WordPress site DUX theme.
Today our blog will share with you the featured image of the article on the DUX theme homepage of the WordPress blog system site. If there are no illustrations in the article content or the first featured image is not enabled, a random image in the random directory will be automatically called as a thumbnail. , so that the thumbnail area is no longer a monotonous gray frame and inferior image display.
Effect:
Steps to randomly display thumbnails:
Find the functions-theme.php file in the dux theme directory. At about line 785 (the number of lines may change depending on the version), find the following code:
if( $r_src ){ if( _hui('thumbnail_src') ){ return sprintf('Replace with:
/*Featured picture of the home page article. If there is no picture in the article content, or the first picture is not enabled as the featured picture, any picture in the random directory will be used. */ if( $r_src ){ if( _hui('thumbnail_src') ){ return sprintf('Download the random image file here:
randomdownloadDownload the image, and then extract the image folder to the img folder in the theme directory, as shown in the picture:
Recommended site search: all-purpose virtual host, ip168, foreign server, website registration information query, which server protection is the best, Japanese server rental Japanese server, free external network server, application for free space and domain name, foreign server, space service provider ,
发表评论