프리이미지
사이트 내 전체검색

워드프레스 rss description 길이 늘리기

페이지 정보

작성일15-08-18 10:22

본문

테마 function.php 에서 라인을 추가하라.

기본은 20 words 로 설정되어있다.

 

 

 

 

function custom_excerpt_length( $length ) {

return 999;  //길이

}

add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); 

 

 

 

 

 

 

 

 

====================================

 

WordPress – How to change RSS summary excerpt/description length

By default the WordPress RSS summary excerpt length is 55 words.

The steps below detail how to change the summary length to any other number.

  1. Open your themes functions.php file and look for a filter starting with
  2. add_filter( 'excerpt_length',
  3. If you find this, take note of the next part of the filter, for example if you found
  4. add_filter( 'excerpt_length', 'mts_excerpt_length', 20 );
  5. Take note of mts_excerpt_length
  6. Now look for the function called mts_excerpt_length and edit the number inside to change the except length.
  7. For example, here you would change 50
  8. function mts_excerpt_length( $length ) {
     return 50;
    }
  9. If you did not find an existing filter add the following to your functions.php below the <?php
  10. function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
  11. Save the changes.

 

게시물 검색