2012-07-15 5 views
0

나는 모든 게시물을 내용으로 가득보고 싶기 때문에 발췌 기능을 제거하거나 무의미하게 만들고 싶습니다. 나는 주제가 그 발췌가 그 선에 있는지 확인하기 위해 약간의 추적을 가지고 있다고 생각한다. 그래서 그것은 반드시 존재해야한다.워드 프레스 테마 발췌 기능 제거 - thao 스튜디오 테마

function excerpt($limit) { 
     $excerpt = explode(' ', get_the_excerpt(), $limit); 
     if (count($excerpt)>=$limit) { 
     array_pop($excerpt); 
    $excerpt = implode(" ",$excerpt).'...'; 
    } else { 
    $excerpt = implode(" ",$excerpt); 
    } 
    $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); 
    return $excerpt; 
} 

function content($limit) { 
    $content = explode(' ', get_the_content(), $limit); 
    if (count($content)>=$limit) { 
    array_pop($content); 
    $content = implode(" ",$content).'...'; 
    } else { 
    $content = implode(" ",$content); 
    } 
    $content = preg_replace('/\[.+\]/','', $content); 
    $content = apply_filters('the_content', $content); 
    $content = str_replace(']]>', ']]>', $content); 
    return $content; 
} 

나는이 두 줄의 코드 만 관련되어 있습니다. 나는 어디에서 $ 한계가 왔는지 알지 못한다. 나는 모든 주제와 관련된 PHP, 발견 결과를 찾지 못했다. 도와주세요. 고맙습니다.

+0

테마의 발췌 부분 대신 전체 내용을 표시 하시겠습니까? –

+0

예! 가능하면! 가능한 한 오리지널을 발췌하여 보여 주려고했으나 실패했습니다. –

+0

테마에서 the_content()를 사용하지 않는 이유는 무엇입니까? –

답변

0

그냥

<?php if (have_posts()) : ?> 
      <?php while (have_posts()) : the_post(); ?>  
      <!-- do other stuff ... --> 
      the_content(); 
      <?php endwhile; ?> 
<?php endif; ?> 

소개 the_content() 즉, 대신 발췌 내용의 전체 내용을 표시하고 루프 내에서 the_content()과 기능 the_excerpt()를 대체 할 템플릿 파일 (index.php를 수)를 찾아 loop.

+0

heera가 팁을 주셔서 대단히 감사합니다. –

+0

그게 효과가 있습니까? –

+1

네, 고맙습니다. 추가 기능을 주셔서 감사합니다.하지만 콘텐츠 전체를 보여 드리고자합니다. 팁으로 많은 내용을 고치겠습니다. –

관련 문제