当前位置: 首页>>代码示例>>PHP>>正文


PHP WP_Query::the_excerpt方法代码示例

本文整理汇总了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;
 }
开发者ID:rymcol,项目名称:FAQPress,代码行数:30,代码来源:shortcodes.php

示例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>
开发者ID:kashifullahwebdeveloper,项目名称:wp-property-house,代码行数:67,代码来源:sc-javo-property-fancy.php


注:本文中的WP_Query::the_excerpt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。