나는이 특정 WordPress 페이지 템플릿에서 특정 게시물의 발췌문을 표시하려고합니다. 게시물이 만들어지면 내가 원하는 장소에 링크를 삽입해야했습니다. 제목, 미리보기 이미지, 퍼머 링크 등을 가져올 수 있지만 어떤 이유에서 건 발췌를 얻을 수 없습니다. 나는 시도했다 :WordPress에서 게시물 발췌문을 가져 오기
the_excerpt();
get_the_excerpt();
the_content('',FALSE);
get_the_content('', FALSE, '');
get_the_content('', TRUE);
다른 것들 중에서. 내가 시도 할 때 get_the_content('', TRUE)
그것은 나에게 링크 후 모든 것에서 내용을 준다. 그러나 나는 링크 앞에 무엇이 필요하다.
아이디어가 있으십니까?
<?php
$query = 'cat=23&posts_per_page=1';
$queryObject = new WP_Query($query);
?>
<?php if($queryObject->have_posts()) : ?>
<div>
<?php while($queryObject->have_posts()) : $queryObject->the_post() ?>
<div>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<br>
<?php the_post_thumbnail() ?>
<?php #the_excerpt(); ?>
<div>
<a href="<?php the_permalink(); ?>">Read More</a>
</div>
</div>
<?php endwhile ?>
</div>
<?php endif; wp_reset_query();
>
감사합니다. 이것은 주어진 단어 수와 함께 발췌 한 것을 제외하고는 효과가 있습니다. 사용자가 해당 게시물의 CMS를 통해 콘텐츠 본문에 ""링크를 수동으로 포함 할 수있게하려는 경우이 템플릿은 더 많은 태그를 삽입 할 때마다 끝나는 발췌 부분을 표시합니다. – user2623706