我正在使用此代码在我的网站中显示我最近的帖子:
<div class="post_content">
<div class="home_posts">
<?php
$args2 = array(
\'post_type\' => \'post\',
\'posts_per_page\' => 6,
\'order_by\'=>\'post_date\',
\'paged\' => ( get_query_var(\'paged\') ? get_query_var(\'paged\') : 1),
);
$query = new WP_Query( $args2 );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
echo \'<div class="grid_post">
<h3><a href="\'.get_permalink().\'">\'.get_the_title().\'</a></h3>\';
$type = get_post_meta($post->ID,\'page_featured_type\',true);
switch ($type) {
case \'youtube\':
echo \'<iframe width="560" height="315" src="http://www.youtube.com/embed/\'.get_post_meta( get_the_ID(), \'page_video_id\', true ).\'?wmode=transparent" frameborder="0" allowfullscreen></iframe>\';
break;
case \'vimeo\':
echo \'<iframe src="http://player.vimeo.com/video/\'.get_post_meta( get_the_ID(), \'page_video_id\', true ).\'?title=0&byline=0&portrait=0&color=03b3fc" width="500" height="338" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>\';
break;
default:
echo \'<div class="grid_post_img">
<a href="\'.get_permalink().\'">\'.get_the_post_thumbnail().\'</a>
</div>\';
break;
}
echo \'<div class="grid_home_posts">
<p>\'.dess_get_excerpt(120).\'</p>
</div>
</div>
\';
endwhile;
?>
</div>
然而,它显示了我的“美丽”部分的帖子。此外,我发现在该页面中,有以下代码:
[posts-for-page cat_slug=\'beauty\' hide_images=\'false\' num=\'10\' read_more=\'
Read More »\' show_full_posts=\'false\' use_wp_excerpt=\'true\' strip_html=\'true\'
hide_post_content=\'false\' show_meta=\'false\' force_image_height=\'200\'
force_image_width=\'250\']
请问你知道怎么换吗?这是我的网站:
www.wha2wear.com