将此添加到您的子主题功能文件中,并更改图像ID以匹配您希望包含在库中的图像。
add_action( \'wp_head\', \'wpsites_front_page_gallery\' );
function wpsites_front_page_gallery() {
if ( is_home() ) {
echo do_shortcode(\'[gallery columns="5" link="file" ids="45266,45258,45250,45229,45227" orderby="rand"]\');
}}

将wp\\u head钩子更改为任何WordPress或主题特定的钩子以进行定位。