本文整理汇总了PHP中WP_Query::the_excerpt方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Query::the_excerpt方法的具体用法?PHP WP_Query::the_excerpt怎么用?PHP WP_Query::the_excerpt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Query
的用法示例。
在下文中一共展示了WP_Query::the_excerpt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extract
function faqpress_shortcode($atts)
{
extract(shortcode_atts(array('category' => '', 'excerpt' => 'false'), $atts));
// set the post query arguments
$post_query_args = array('posts_per_page' => -1, 'post_type' => 'faqpressfaq', 'tax_query' => array(array('taxonomy' => 'faqpress_categories', 'field' => 'slug', 'terms' => $category)), 'no_found_rows' => true, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'ASC');
// get the posts with our query arguments
$faq_posts = new WP_Query($post_query_args);
$postOutput = '<div id="faqpress">';
$postOutput .= '<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">';
// loop it!
while ($faq_posts->have_posts()) {
$faq_posts->the_post();
$faq_item_title = get_the_title();
$faq_item_permalink = get_the_permalink();
$faq_item_content = get_the_content();
if ($excerpt == 'true') {
$faq_item_content = $faq_posts->the_excerpt() . '<a href="' . $faq_item_permalink . '">' . __('More...', 'faqpressfaq') . '</a>';
}
$postCount = $faq_posts->current_post + 1;
$postOutput .= '<div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse' . $postCount . '" aria-expanded="false" aria-controls="collapse' . $postCount . '">';
$postOutput .= $faq_item_title;
$postOutput .= '</a></h4></div>';
$postOutput .= '<div id="collapse' . $postCount . '" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"><div class="panel-body">';
$postOutput .= $faq_item_content;
$postOutput .= '</div></div></div>';
}
wp_reset_postdata();
$postOutput .= '</div></div>';
echo $postOutput;
}
示例2: property_fancy_function
//.........这里部分代码省略.........
the_post_thumbnail('javo-box', array('class' => 'img-responsive', 'style' => ''));
?>
</a>
</div>
</div>
<span class="up-text"><?php
echo $ks_property_str->__hasStatus();
?>
</span>
</div> <!-- col-md-5 -->
<div class="col-md-7 blog-meta-box">
<h2 class="title">
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a>
</h2>
<div class="excerpt">
<?php
echo $ks_this_posts->the_excerpt();
?>
<a href="<?php
the_permalink();
?>
">
<span class="more">[<?php
_e('MORE', 'property-house');
?>
]</span>
</a>
</div>
<div class="property-meta">
<span class="col-md-4"><i class="icon-bed"></i><?php
echo $ks_property_str->__meta('bedrooms');
?>
</span>
<span class="col-md-4"><i class="icon-bed"></i><?php
echo $ks_property_str->__meta('bathrooms');
?>
</span>
<span class="col-md-4"><i class="icon-bed"></i><?php
echo $ks_property_str->__cate('property_type', 'No Type', true);
?>
</span>