Bạn muốn thêm hình ảnh nổi bật bên dưới nội dung trên các trang bài đăng trong Genesis?
Tạo một tệp có tên single-post.php trong thư mục chủ đề con của bạn có mã sau:
/**
* Show featured image (if present) before content on single posts.
*/
function custom_featured_image() {
// if there is no featured image, abort.
if ( ! has_post_thumbnail() ) {
return;
}
printf( '<figure><img src="%s" alt="%s" /></figure>', genesis_get_image( 'format=url&size=medium_large' ), the_title_attribute( 'echo=0' ) );
}
genesis();