wordpress 字段输出

 <?php
 $args = array(
 'posts_per_page' => ai_hao('slider_n'),
 'meta_key' => 'show',
 'ignore_sticky_posts' => 1
 );
 query_posts($args);
 ?>
 <?php while (have_posts()) : the_post();$do_not_duplicate[] = $post->ID; ?>
 
 <?php $image = get_post_meta($post->ID, 'show', true); ?>
 
 <?php $go_url = get_post_meta($post->ID, 'show_url', true); ?>
 
 
 <li>
 <?php if ( get_post_meta($post->ID, 'show_url', true) ) ://如果 ?>
 
 <a href="<?php echo $go_url; ?>" target="_blank" rel="bookmark"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" /></a>
 
 
 <?php else: //否则?>
 
 <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" /></a>
 
 
 <?php endif; ?>
 
 <p class="slider-caption"><?php the_title(); ?></p>
 
 </li>
 
 
 
 <?php endwhile; wp_reset_query(); //循环结束?>
预见

发表评论

:?::razz::sad::evil::!::smile::oops::grin::eek::shock::???::cool::lol::mad::twisted::roll::wink::idea::arrow::neutral::cry::mrgreen: