因此,我有一个基于wordpress的视频网站-搜索页面目前按日期顺序显示帖子,但我希望用户可以选择按不同选项对结果进行排序,例如按视图排序、持续时间排序,甚至按日期排序,但他们可以选择在看到搜索结果时进行排序。这是当前代码
<?php get_header(); ?> <div id="main">
<?php include(TEMPLATEPATH.\'/home_sidebar.php\') ?>
<div id="content">
<div class="mozaique"><h2 class="titlebar">Search result for <?php echo $_GET[\'s\'] ?></h2>
“rel=“bookmark”标题=”>
<img src="<?php echo $thumb; ?>" id="pic_<?=get_the_ID();?>" <? if (strpos($thumb,\'xvideos.com\')) { $thumbbaseurl=explode(\'.\',$thumb); ?> onMouseOver="startThumbSlide(\'<?=get_the_ID();?>\', \'<?=$thumbbaseurl[3];?>\', \'<? echo $thumbbaseurl[0].".".$thumbbaseurl[1].".".$thumbbaseurl[2].".";?>\')" onMouseOut="stopThumbSlide();" <?}?>alt="<?php the_title_attribute(); ?>" />
</a>
</div>
<p><a href="<?php the_permalink() ?>"><?php echo tube_get_limited_string($post->post_title,36); ?></a></p>
<p class="metadata"> <span class="bg"> <span class="duration"><?php $duration = tube_getcustomfield(\'duration\',get_the_ID()); if(empty($duration)) $duration = \' \'; echo $duration; ?></span><?php edit_post_link(\'Edit this entry\',\'\',\'.\'); ?> <?php if (is_admin_bar_showing()) { echo \'<a href="\'.get_delete_post_link().\'">Delete</a>\';}?> </span> </p>
</div>
</div>
<?php endwhile; wp_reset_query(); ?>
<?php
$next_page = get_next_posts_link(\'Previous\');
$prev_pages = get_previous_posts_link(\'Next\');
if(!empty($next_page) || !empty($prev_pages)) :
?>
<!-- navigation -->
<div class="clear"></div>
<div class="navigation">
<?php if(!function_exists(\'wp_pagenavi\')) : ?>
<div class="alignleft"><?php echo $next_page; ?></div>
<div class="alignright"><?php echo $prev_pages; ?></div>
<?php else : wp_pagenavi(); endif; ?>
</div>
<!-- /navigation -->
<?php endif; ?>
<?php
else :
?><p class="nopost">Sorry, but you are looking for something that isn\'t here.</p><?php
endif;
?>
<?php if ( !function_exists(\'dynamic_sidebar\') || !dynamic_sidebar(\'Below Content\') ) : ?>
<?php endif ?> </div> <!-- .mozaique -->
</div>
</div> <!-- #content -->