[워드프레스] YARPP의 글 목록에 기본으로 들어가는 마중그림 쓰기

  워드프레스에서 쓰는 YARP(Yet Another Related Posts) 끼우개(플러그인, plugin)에는 얽힌 글 목록을 미중그림(섬네일, 썸네일, thumbnail)으로 보여 주는 기능이 있는데, YARPP는 얽힌 글들의 목록에 보여 줄 마중그림을 따로 만들 때 옆으로 긴 그림의 옆을 자르기도 한다.

YARPP(Yet Another Related Posts Plugin)의 설정 화면
YARPP(Yet Another Related Posts Plugin)의 설정 화면

  마중그림의 옆이 잘리는 걸 피하고 싶다면, YARPP가 만든 마중그림을 쓰지 않고 글에 올리면서 기본으로 들어가는 마중그림을 목록에 쓰는 방법이 있다. 워드프레스의 끼우개 설정 화면에는 이를 손쉽게 바꿀 수 있는 설정 항목이 없다. 다른 쪽으로 여러 가지 방법이 있겠는데, 아래처럼 YARPP의 PHP 코드를 고쳐서 글에 기본으로 들어간 마중그림을 불러 쓸 수도 있다.

  YARPP 5.1.1을 기준으로 /wp-content/plugins/yet-another-related-posts-plugin/includes/template_thumbnails.php의 37째 줄을 고쳐 준다.

$post_thumbnail_html = get_the_post_thumbnail(null, $dimensions['size'], array('data-pin-nopin' => 'true') );

$post_thumbnail_html = get_the_post_thumbnail(null, 'post-thumbnail', array('data-pin-nopin' => 'true') );
글 걸기 주소 : 이 글에는 글을 걸 수 없습니다.

덧글을 달아 주세요