2017-01-27 1 views
0

는 어떻게 워드 프레스워드 프레스 썸네일 링크

$output .= get_the_post_thumbnail(get_the_ID(),'Dave-profile', array('class' => 'img-responsive')); 

에 썸네일에 대한 링크를 추가 할 수 있습니다 나는

<a href="'.get_the_permalink().'"></a> 

을 추가하려고하지만, 그것은 당신이 이것을 달성 할 수

답변

0
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); ?> 
<?php echo $image[0]; ?> 

위의 코드를 사용하십시오. 변경해야하는 경우 크기가

전체 "단일 포스트 썸네일"

축소, 대형 매체를 대체

0

작동하지 않습니다 여러 가지 방법 중 하나는 방법 중 하나입니다 :

if (has_post_thumbnail(get_the_ID())) 
{ 
    $output .= '<a href="' . get_permalink(get_the_ID()) . '">'; 
    $output .= get_the_post_thumbnail(get_the_ID(), 'Dave-profile', array('class' => 'img-responsive')); 
    $output .= '</a>'; 
} 

희망이 도움이!