我正在尝试使用\\u execrpt()显示自定义摘录。完整代码如下:
<div id="content">
<?php
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
query_posts(array(
\'post_type\' => \'post\', // You can add a custom post type if you like
\'paged\' => $paged,
\'category_name\' => \'technology\',
\'posts_per_page\' => 10 // limit of posts
));
if ( have_posts() ){
$i = 0;
while ( have_posts() ) :
$i++;
the_post();
?>
<?php if($i%2 == 1){?>
<div class="row">
<?php } ?>
<div class="col-md-6">
<h3><a class="card-link" href="<?php echo the_permalink(); ?>"> <?php the_field(\'title_for_excerpt\'); ?> </a> </h3>
<div class="row">
<div class="col-md-6">
<?php the_post_thumbnail(\'full\', array(\'class\' => \'rounded featured-image\')); ?>
</div>
<div class="col-md-6 ">
<div class="exceprt-container"> <?php the_excerpt(); ?> </div>
<a class="btn btn-primary" href="<?php echo the_permalink(); ?>">বিস্তারিত </a>
</div>
</div>
</div>
<?php if($i%2 == 0){?>
</div>
<?php }
endwhile;
if($i%2 == 1){?>
</div>
<?php }
} ?> <!-- END have-post -->
<?php
但奇怪的是:摘录是印刷部分实际内容。但我单独输入自定义摘录:
有什么想法吗?