本文整理汇总了PHP中wp_reset_query函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_reset_query函数的具体用法?PHP wp_reset_query怎么用?PHP wp_reset_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_reset_query函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
global $post;
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? __('Recent Posts', 'lan-thinkupthemes') : apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
$posts = new WP_Query('orderby=date&posts_per_page=' . $instance['postcount'] . '');
while ($posts->have_posts()) {
$posts->the_post();
// Insert post date if needed.
if ($instance['postdate'] == 'on') {
$date_input = '<a href="' . get_permalink() . '" class="date">' . get_the_date('M j, Y') . '</a>';
}
// HTML output
echo '<div class="recent-posts">';
if (has_post_thumbnail() and $instance['imageswitch'] == 'on') {
echo '<div class="image">', '<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_post_thumbnail($post->ID, array(65, 65)) . '<div class="image-overlay"></div></a>', '</div>', '<div class="main">', '<a href="' . get_permalink() . '">' . get_the_title() . '</a>', $date_input, '</div>';
} else {
echo '<div class="main">', '<a href="' . get_permalink() . '">' . get_the_title() . '</a>', $date_input, '</div>';
}
echo '</div>';
}
wp_reset_query();
echo $after_widget;
}
开发者ID:closings,项目名称:closings,代码行数:28,代码来源:recentposts.php
示例2: generate_ryuzine_stylesheets
function generate_ryuzine_stylesheets()
{
// verify this came from the our screen and with proper authorization.
if (!wp_verify_nonce($_POST['ryu_regenstyles_noncename'], 'ryuzine-regenstyles_install')) {
return;
}
// Check permissions
if (!current_user_can('administrator')) {
echo "<div class='error'><p>Sorry, you do not have the correct priveledges to install the files.</p></div>";
return;
}
$my_query = null;
$my_query = new WP_Query(array('post_type' => 'ryuzine'));
if ($my_query->have_posts()) {
while ($my_query->have_posts()) {
$my_query->the_post();
$stylesheet = "";
$issuestyles = get_post_meta(get_the_ID(), '_ryustyles', false);
if (!empty($issuestyles)) {
foreach ($issuestyles as $appendstyle) {
// If there are multiple ryustyles append them //
$stylesheet = $stylesheet . $appendstyle;
}
}
if ($stylesheet != "") {
ryu_create_css($stylesheet, get_the_ID());
}
}
}
// reset css check //
// update_option('ryu_css_admin',0);
wp_reset_query();
return;
}
开发者ID:ryumaru,项目名称:ryuzine-press,代码行数:34,代码来源:rp_generate_css.php
示例3: widget
/**
* Outputs the HTML for this widget.
*
* @param array An array of standard parameters for widgets in this theme
* @param array An array of settings for this widget instance
* @return void Echoes it's output
*/
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$title = apply_filters('widget_title', $instance['title']);
if ($title != '') {
echo $before_title;
echo $title;
echo $after_title;
}
// Remove the filter from the Posts Order By Plugin
if (function_exists('CPTOrderPosts')) {
remove_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
}
// Get the articles
$args = array('post_type' => 'post', 'posts_per_page' => $instance['number'], 'meta_key' => 'ipt_kb_like_article', 'meta_value' => '0', 'meta_compare' => '>', 'orderby' => 'meta_value_num', 'order' => 'DESC');
$args = apply_filters('ipt_kb_popular_widget_query_args', $args);
$popular_posts = new WP_Query($args);
echo '<div class="list-group">';
if ($popular_posts->have_posts()) {
while ($popular_posts->have_posts()) {
$popular_posts->the_post();
get_template_part('category-templates/content', 'popular');
}
} else {
get_template_part('category-templates/no-result');
}
echo '</div>';
wp_reset_query();
// Add the filter from the Posts Order By Plugin
if (function_exists('CPTOrderPosts')) {
add_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
}
echo $after_widget;
}
开发者ID:andychoi,项目名称:k-knowledgebase-theme-wp,代码行数:42,代码来源:class-ipt-kb-popular-widget.php
示例4: show_category
function show_category($cid = 1)
{
$args = array('showposts' => 4, 'cat' => $cid, 'orderby' => 'post_date', 'order' => 'desc');
query_posts($args);
global $the_post;
$category = '';
while (have_posts()) {
the_post();
$cat = get_the_category(get_the_ID());
$link = get_permalink(get_the_ID());
$src = get_the_post_thumbnail(get_the_ID(), 'index_thumb');
$c_name = $cat[0]->name;
$title = get_the_title();
echo $category .= <<<EOF
<div class="box">
<a href="{$link}">
<div class="boximg">{$src}</div>
<div class="category">{$c_name}</div>
<p>{$title}</p>
</a>
</div>
EOF;
}
wp_reset_query();
return $category;
}
开发者ID:bloemen,项目名称:success,代码行数:26,代码来源:top-category.php
示例5: zp_custom_blog_page
function zp_custom_blog_page()
{
global $post, $paged;
$include = genesis_get_option('blog_cat');
$exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
//* Arguments
$args = array('cat' => $include, 'category__not_in' => $exclude, 'posts_per_page' => genesis_get_option('blog_cat_num'), 'paged' => $paged);
query_posts($args);
if (have_posts()) {
while (have_posts()) {
the_post();
do_action('genesis_before_entry');
printf('<article %s>', genesis_attr('entry'));
// check post format and call template
$format = get_post_format();
get_template_part('content', $format);
do_action('genesis_after_entry_content');
//do_action( 'genesis_entry_footer' );
echo '</article>';
do_action('genesis_after_entry');
}
}
//* Genesis navigation
genesis_posts_nav();
//* Restore original query
wp_reset_query();
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:34,代码来源:home.php
示例6: featured_index
function featured_index()
{
$output = '';
$args = array('tag' => 'featured', 'posts_per_page' => 3);
query_posts($args);
if (have_posts()) {
while (have_posts()) {
the_post();
$the_img = $this->get_img_src(get_the_ID());
if ($the_img == 'zero') {
}
$output .= '<div class=" mdl-cell mdl-cell--4-col mdl-card mdl-shadow--2dp">';
$output .= ' <div class="mdl-card__title mdl-card--expand" style="background-image: url( \' ' . $the_img . ' \' )">
</div>
<div class="mdl-card__supporting-text">
' . get_the_title() . '
</div>
<div class="mdl-card__actions mdl-card--border">
<a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
View Updates
</a>
</div>';
$output .= '</div>';
}
} else {
$output = 'gagal';
}
wp_reset_query();
return $output;
}
开发者ID:madebyaris,项目名称:arisdes-wp-blog,代码行数:30,代码来源:mdl_custom.php
示例7: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$number = $instance['number'];
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<div class="recent-works-items clearfix">
<?php
$args = array('post_type' => 'evolve_portfolio', 'posts_per_page' => $number, 'has_password' => false);
$portfolio = new WP_Query($args);
if ($portfolio->have_posts()) {
?>
<?php
while ($portfolio->have_posts()) {
$portfolio->the_post();
?>
<?php
if (has_post_thumbnail()) {
?>
<?php
$link_target = "";
$url_check = get_post_meta(get_the_ID(), 'pyre_link_icon_url', true);
if (!empty($url_check)) {
$new_permalink = get_post_meta(get_the_ID(), 'pyre_link_icon_url', true);
if (get_post_meta(get_the_ID(), 'pyre_link_icon_target', true) == "yes") {
$link_target = ' target="_blank"';
}
} else {
$new_permalink = get_permalink();
}
?>
<a href="<?php
echo $new_permalink;
?>
"<?php
echo $link_target;
?>
title="<?php
the_title();
?>
">
<?php
the_post_thumbnail('recent-works-thumbnail');
?>
</a>
<?php
}
}
}
wp_reset_query();
?>
</div>
<?php
echo $after_widget;
}
开发者ID:berniecultess,项目名称:infirev,代码行数:60,代码来源:recent-works-widget.php
示例8: writeShoppingCart
function writeShoppingCart()
{
global $wpdb;
$settings = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "photocrati_ecommerce_settings WHERE id = 1", ARRAY_A);
foreach ($settings as $key => $value) {
${$key} = $value;
}
$cart = $_SESSION['cart'];
if (!$cart) {
return '<p><em>' . $ecomm_empty . '</em> </p>';
} else {
// Parse the cart session variable
$items = explode(',', $cart);
$s = count($items) > 1 ? 's' : '';
if (get_option('permalink_structure') != '') {
return '<button id="addto2" class="positive" style="margin:0 5px;" onClick=\'window.location.href = "' . get_bloginfo('url') . '/' . str_replace(" ", "-", strtolower($ecomm_title)) . '/"\'><img src="' . photocrati_gallery_file_uri('image/cart.png') . '"> ' . $ecomm_title . ': ' . count($items) . ' item' . $s . '</button>';
} else {
$pgid = query_posts(array('pagename' => $ecomm_title));
foreach ($pgid as $pgid) {
$pageid = $pgid->ID;
}
wp_reset_query();
return '<button id="addto2" class="positive" style="margin:0 5px;" onClick=\'window.location.href = "' . get_bloginfo('url') . '/?page_id=' . $pageid . '"\'><img src="' . photocrati_gallery_file_uri('image/cart.png') . '"> ' . $ecomm_title . ': ' . count($items) . ' item' . $s . '</button>';
}
}
}
开发者ID:nicoladj77,项目名称:code-veronica,代码行数:26,代码来源:ecommerce.php
示例9: sys_recent_posts
function sys_recent_posts($atts, $content = null)
{
extract(shortcode_atts(array('limit' => '2', 'description' => '40', 'cat_id' => '23', 'thumb' => 'true', 'postdate' => ''), $atts));
$out = '<div class="widget_postslist sc">';
$out .= '<ul>';
global $wpdb;
$myposts = get_posts("numberposts={$limit}&offset=0&cat={$cat_id}");
foreach ($myposts as $post) {
$post_date = $post->post_date;
$post_date = mysql2date('F j, Y', $post_date, false);
$out .= "<li>";
if ($thumb == "true") {
$thumbid = get_post_thumbnail_id($post->ID);
$imgsrc = wp_get_attachment_image_src($thumbid, array(9999, 9999));
$out .= '<div class="thumb"><a href="' . get_permalink($post->ID) . '" title="' . $post->post_title . '">';
if ($thumbid) {
$out .= atp_resize('', $imgsrc['0'], '50', '50', 'imgborder', '');
} else {
//$out .= '<img class="imgborder" src="'.THEME_URI.'/images/no-image.jpg'.'" alt="' .$post->post_title. '" />';
}
$out .= '</a></div>';
}
$out .= '<div class="pdesc"><a href="' . get_permalink($post->ID) . '" rel="bookmark">' . $post->post_title . '</a>';
if ($postdate == "true") {
$out .= '<div class="w-postmeta"><span>' . $post_date . '</span></div>';
} else {
$out .= '<p>' . wp_html_excerpt($post->post_content, $description, '...') . '</p>';
}
$out .= '</div></li>';
}
$out .= '</ul></div>';
return $out;
wp_reset_query();
}
开发者ID:pryspry,项目名称:MusicPlay,代码行数:34,代码来源:recentposts.php
示例10: friend_list_func
public static function friend_list_func($atts, $content = "")
{
$atts = shortcode_atts(array('per_page' => '100'), $atts, 'friend_list');
$return = "";
query_posts(array('post_type' => 'friend', 'showposts' => $atts['per_page'], 'meta_query' => array('relation' => 'AND', array('key' => 'avatar150', 'value' => 'https://static0.fitbit.com/images/profile/defaultProfile_100_male.gif', 'compare' => 'NOT LIKE'), array('key' => 'avatar150', 'value' => 'https://static0.fitbit.com/images/profile/defaultProfile_100_female.gif', 'compare' => 'NOT LIKE'))));
if (have_posts()) {
while (have_posts()) {
the_post();
$displayName = get_post_meta(get_the_id(), 'displayName', true);
$avatar = get_post_meta(get_the_id(), 'avatar150', true);
$return .= sprintf('<div class="col-lg-3 col-sm-3 focus-box">
<div class="service-icon">
<i style="background:url(%s) no-repeat center;width:100%%; height:100%%;" class="pixeden"></i>
</div>
<h3 class="red-border-bottom">%s</h3>
<a class="btn btn-primary btn-block green-btn btn-sm" href="https://www.fitbit.com/user/%s"><i class="fa fa-plus"></i> Add Friend</a>
<br/>
</div>', $avatar, $displayName, get_the_title(), get_the_content());
}
$return = '<div class="hwd-wrapper"><div class="row">' . $return . '</div></div>';
} else {
$return = 'No Friends Found';
}
wp_reset_query();
return $return;
}
开发者ID:HealthyWebDeveloper,项目名称:HWD-friend-finder,代码行数:26,代码来源:class-friend-shortcode.php
示例11: get_post_count
public function get_post_count($post_type = 'item')
{
$author_args = array('post_status' => 'publish', 'post_type' => $post_type, 'author' => $this->author->ID);
$author_posts = query_posts($author_args);
wp_reset_query();
return count($author_posts);
}
开发者ID:ksingh812,项目名称:epb,代码行数:7,代码来源:javo-author.php
示例12: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
$instance = wp_parse_args($instance, array('title' => __('Closed Questions', 'dwqa'), 'number' => 5));
echo $before_widget;
echo $before_title;
echo $instance['title'];
echo $after_title;
$args = array('post_type' => 'dwqa-question', 'meta_query' => array('relation' => 'OR', array('key' => '_dwqa_status', 'compare' => '=', 'value' => 'resolved'), array('key' => '_dwqa_status', 'compare' => '=', 'value' => 'closed')));
$questions = new WP_Query($args);
if ($questions->have_posts()) {
echo '<div class="dwqa-popular-questions">';
echo '<ul>';
while ($questions->have_posts()) {
$questions->the_post();
echo '
<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' ' . get_the_author_link();
'</li>';
}
echo '</ul>';
echo '</div>';
}
wp_reset_query();
wp_reset_postdata();
echo $after_widget;
}
开发者ID:Korotkin-Solutions,项目名称:dw-question-answer,代码行数:26,代码来源:list-closed-question.php
示例13: film_shortcode_query
function film_shortcode_query($atts, $content)
{
extract(shortcode_atts(array('posts_per_page' => '1', 'post_type' => 'landing', 'caller_get_posts' => 1), $atts));
global $post;
$posts = new WP_Query($atts);
$output = '';
if ($posts->have_posts()) {
while ($posts->have_posts()) {
$posts->the_post();
$out = '<div class="film_box">
<h4>Film Name: <a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></h4>
<p class="Film_desc">' . get_the_content() . '</p>';
// add here more...
$out .= '</div>';
/* these arguments will be available from inside $content
get_permalink()
get_the_content()
get_the_category_list(', ')
get_the_title()
and custom fields
get_post_meta($post->ID, 'field_name', true);
*/
}
} else {
return;
}
// no posts found
wp_reset_query();
return html_entity_decode($out);
}
开发者ID:futr3,项目名称:cdt-fsf,代码行数:30,代码来源:shortcodes.php
示例14: widget
function widget($args, $instance)
{
if (!is_home()) {
return false;
}
/*
Query the first post:
If it has a featured image, display it,
and store its ID in an array.
*/
query_posts('posts_per_page=1');
while (have_posts()) {
the_post();
$do_not_duplicate[] = $post->ID;
get_template_part('feature', 'index');
}
/*
Excerpt post loop.
If a #feature post exists, do not duplicate.
*/
if ((int) $instance['excerpts_count'] > 0) {
query_posts(array('post__not_in' => $do_not_duplicate, 'offset' => 1, 'posts_per_page' => (int) $instance['excerpts_count']));
echo '<div class="clearfix">';
for ($post_count = 1; have_posts(); $post_count++) {
the_post();
$do_not_duplicate[] = $post->ID;
/*
See: lib/helpers.php -> sourdough_excerpt()
*/
sourdough_excerpt($post_count);
}
echo '</div>';
}
wp_reset_query();
}
开发者ID:staydecent,项目名称:wp-sourdough,代码行数:35,代码来源:sourdough-featured-posts.php
示例15: adm_sitemap_posts
function adm_sitemap_posts($atts)
{
extract(shortcode_atts(array('comments_number' => true, 'number' => '0', 'cat' => '', 'posts' => '', 'author' => '', 'type' => 'post', 'comments' => 'true'), $atts));
if ($number == 0) {
$number = 1000;
}
if ($comments_number === 'false') {
$comments_number = false;
}
$query = array('showposts' => (int) $number, 'post_type' => $type);
if ($cat) {
$query['cat'] = $cat;
}
if ($posts) {
$query['post__in'] = explode(',', $posts);
}
if ($author) {
$query['author'] = $author;
}
$archive_query = new WP_Query($query);
$output = '';
while ($archive_query->have_posts()) {
$archive_query->the_post();
$output .= '<li><a href="' . get_permalink() . '" rel="bookmark" title="' . sprintf(__("Permanent Link to %s", 'striking_front'), get_the_title()) . '">' . get_the_title() . '</a>';
if ($comments == 'true') {
$output .= $comments_number ? ' (' . get_comments_number() . ')' : '';
}
$output .= '</li>';
}
wp_reset_query();
return '<div class="sc-sitemap sitemap-posts"><ul>' . $output . '</ul></div>';
}
开发者ID:AdmiumNL,项目名称:adm-default,代码行数:32,代码来源:inc_shortcodes.php
示例16: sc_speaker_loop
/**
* Speaker Loop
*
*/
function sc_speaker_loop()
{
$args = array('post_type' => 'sc-speakers', 'posts_per_page' => '-1', 'orderby' => 'menu_order', 'order' => 'ASC');
$loop = new WP_Query($args);
if ($loop->have_posts()) {
while ($loop->have_posts()) {
$loop->the_post();
global $post;
echo '<div class="speaker"><div class="one-half first">';
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'sc_thumbnail');
if ($image) {
echo '<p><img src="' . $image[0] . '" class="border" alt="' . get_the_title() . '" /></p>';
}
$url = esc_url(get_post_meta($post->ID, 'sc_speaker_url', true));
if (!empty($url)) {
echo '<h4><a href="' . $url . '" target="_blank">' . $url . '</a></h4>';
}
$twitter = esc_attr(get_post_meta($post->ID, 'sc_speaker_twitter', true));
if (!empty($twitter)) {
echo '<p><a href="http://www.twitter.com/' . $twitter . '" target="_blank">@' . $twitter . '</a></p>';
}
echo '</div><div class="one-half">';
echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
the_content();
echo '</div></div>';
}
}
wp_reset_query();
}
开发者ID:hscale,项目名称:webento,代码行数:33,代码来源:template-speakers.php
示例17: ktz_mustread_content
function ktz_mustread_content()
{
global $post;
if (ot_get_option('ktz_popup_activated') == 'yes') {
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array('post_type' => 'post', 'orderby' => 'rand', 'order' => 'desc', 'showposts' => 3, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
$ktz_topfeatquery = new WP_Query($args);
if ($ktz_topfeatquery->have_posts()) {
echo '<div id="ktz_slidebox">';
echo '<strong class="mustread_title">' . __('Must read', ktz_theme_textdomain) . '</strong><a href="#" class="close">×</a>';
echo '<ul class="mustread_list">';
while ($ktz_topfeatquery->have_posts()) {
$ktz_topfeatquery->the_post();
echo '<li class="mustread_li">';
echo '<div class="title">';
echo ktz_posted_title_a();
echo '</div>';
echo '</li>';
}
echo '</ul>';
echo '</div>';
}
wp_reset_query();
}
}
开发者ID:gigikir,项目名称:adebe,代码行数:25,代码来源:_slider_ktz.php
示例18: widget
function widget($args, $instance)
{
extract($args);
global $socialProfiles;
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<ul class="social">
<?php
foreach ($socialProfiles as $item) {
$id = strtolower($item);
$iditem = $id . "_title";
$iddesc = $id . "_desc";
if ($instance[$id] && $instance[$id] != '') {
if (simple_email_check($instance[$id])) {
$instance[$id] = 'mailto:' . $instance[$id];
}
echo '<li><a class="' . $id . '" href="' . $instance[$id] . '" rel="external,nofollow" title="' . $instance[$iditem] . '"><img src="' . get_bloginfo('template_directory') . '/images/icons/' . strtolower($item) . '.png" alt="' . $instance[$iddesc] . '" />' . $instance[$iditem] . '<span>' . $instance[$iddesc] . '</span></a></li>';
}
}
?>
</ul>
<div class="cleaner"> </div>
<?php
echo $after_widget;
wp_reset_query();
}
开发者ID:johngow,项目名称:liveeyetv,代码行数:30,代码来源:social.php
示例19: widget
/** @see WP_Widget::widget */
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$a = array("orderby" => "id", "order" => "asc");
$categories = get_categories($a);
foreach ($categories as $category) {
echo $before_title;
// var_dump($category);
echo "<h2>" . $category->name . "</h2><ul>";
global $post;
$args = array('category' => $category->term_id, "numberposts" => -1, "orderby" => "title", "order" => "ASC");
$myposts = get_posts($args);
foreach ($myposts as $post) {
setup_postdata($post);
?>
<li><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></li><?php
}
echo "</ul>";
wp_reset_query();
echo $after_title;
}
echo $after_widget;
}
开发者ID:besimhu,项目名称:legacy,代码行数:31,代码来源:all-posts-by-category.php
示例20: shortcode_faqs
function shortcode_faqs($atts, $content = null)
{
extract($atts = shortcode_atts(array('counts' => '12', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'filter' => 'yes', 'post_type' => 'faq', 'taxonomy' => 'faq_cat'), $atts));
// Get Query
$query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => $post_type, 'taxonomy' => $taxonomy));
$grid = new Twoot_Template_Grid();
$do_query = new WP_Query($query->do_template_query());
$faqs_class = $filter == 'yes' ? 'column nine' : 'twelve';
$html = '<div class="the-faq-list shortcode-toggle outer clearfix">' . "\n";
if ($filter == 'yes') {
$html .= '<div class="column three">';
$html .= $grid->filter_terms_menu($do_query->posts, $atts);
$html .= '</div>';
}
$html .= '<div id="faqs" class="' . $faqs_class . '">';
while ($do_query->have_posts()) {
$do_query->the_post();
//Get terms class
$terms_class = $grid->filter_terms_class(get_the_ID(), $atts);
$html .= '<div class="tog-item faq-item inner ' . $terms_class . '">';
$html .= '<a href="#" class="tog"><i class="icon twoot-icon"></i>' . get_the_title() . '</a>';
$html .= '<div class="tog-content clearfix">' . do_shortcode(get_the_content()) . '</div>';
$html .= '</div>';
}
wp_reset_query();
$html .= '</div>';
$html .= '</div>';
return $html;
}
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:29,代码来源:faqs.php
注:本文中的wp_reset_query函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论