새로운 올백테마 적용관련해서...
오랜만에 들어왔더니 새롭게 리뉴얼된 올백테마가 있어서 바로 적용해보았습니다.
디자인이 한결 심플하면서도 더 고급스러워 보여서 너무 만족합니다.
블록도 너무 유용한것 같아 구매했습니다~^^
한가지 궁금한게 있는데
아래 가이드 주신 대로 잘 적용해서 백업해둔 글 import 해서 정상적으로 잘 나오는데
한가지 문제점이 대표이미지가 적용이 되지 않네요.~
대표이미지 적용이 안되니 글목록에 썸네일이미지도 나오지 않습니다.
수작업으로 대표이미지 재설정해서 하긴했는데 시간이 너무 많이 걸리네요.
다른 블로그 하나도 적용할까 하는데 혹시 관련해서 해결방법이 있는지 좀 문의드립니다.
감사합니다~
혹시 코드 스니펫 사용 하실 수 있으시다면 아래 코드 한번 시도해보세요! 백업은 필수입니다!
// Auto Set featured image in WordPress
function wpsites_auto_set_featured_image() {
global $post;
$featured_image_exists = has_post_thumbnail($post->ID);
if (!$featured_image_exists) {
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {set_post_thumbnail($post->ID, $attachment_id);}
}
}
}
add_action('the_post', 'wpsites_auto_set_featured_image');