Javascript 缩略图网格以相反的顺序显示

Javascript 缩略图网格以相反的顺序显示,javascript,jquery,css,wordpress,Javascript,Jquery,Css,Wordpress,我有一个wordpress网站,它使用了一个缩略图网格(9篇文章,3篇文章宽,响应性强),每篇文章上的特色图片创建了一个网格 我控制网格的代码是 <?php /** * controls main grid images */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class('col-md-4 col-sm-4 pbox '); ?>> <div class

我有一个wordpress网站,它使用了一个缩略图网格(9篇文章,3篇文章宽,响应性强),每篇文章上的特色图片创建了一个网格

我控制网格的代码是

<?php
/**
 * controls main grid images
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('col-md-4 col-sm-4 pbox '); ?>>

    <div class = "box-ovrly">
      <h2 class="box-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
      <div class="box-meta"><?php the_category(', '); ?></div>
    </div>

    <?php
        $thumb = get_post_thumbnail_id();
        $img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
        $image = aq_resize( $img_url, 750, 560, true ); //resize & crop the image
    ?>

    <?php if($image) : ?>
    <a href="<?php the_permalink(); ?>"> <img class="img-responsive" src="<?php echo $image ?>"/></a>
    <?php endif; ?> 

</article><!-- #post-## -->

它创建了一个网格,但它以相反的顺序显示(9到1,而不是1到9)。这不是什么大问题,但我有“下一步”和“上一步”按钮,它们与帖子不协调

在我的第一篇文章中,“上一篇”按钮出现了,因为它认为它在第九篇文章中,等等

创建“后退/下一步”菜单时使用以下命令

function web2feel_content_nav( $nav_id ) {
global $wp_query, $post;

// Don't print empty markup on single pages if there's nowhere to navigate.
if ( is_single() ) {
    $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
    $next = get_adjacent_post( false, '', false );

    if ( ! $next && ! $previous )
        return;
}

// Don't print empty markup in archives if there's only one page.
if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
    return;

$nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation';

?>
<nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?> row">
    <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'web2feel' ); ?></h1>

<?php if ( is_single() ) : // navigation links for single posts ?>

    <?php previous_post_link( '<div class="nav-previous col-xs-6">%link</div>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'web2feel' ) . '</span> %title' ); ?>
    <?php next_post_link( '<div class="nav-next col-xs-6">%link</div>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'web2feel' ) . '</span>' ); ?>

<?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>

    <?php if ( get_next_posts_link() ) : ?>
    <div class="nav-previous col-md-6"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'web2feel' ) ); ?></div>
    <?php endif; ?>

    <?php if ( get_previous_posts_link() ) : ?>
    <div class="nav-next col-md-6"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'web2feel' ) ); ?></div>
    <?php endif; ?>

<?php endif; ?>

</nav><!-- #<?php echo esc_html( $nav_id ); ?> -->
<?php
} 
函数web2feel\u content\u nav($nav\u id){
全局$wp\u查询,$post;
//如果无处导航,请不要在单个页面上打印空标记。
if(is_single()){
$previous=(is_attachment())?获取_post($post->post_parent):获取相邻的_post(false,,,true);
$next=获取相邻的帖子(false,,,false);
如果(!$next&&!$previous)
回来
}
//如果只有一页,请不要在存档中打印空标记。
如果($wp_query->max_num_pages<2&&(is_home()| is|archive()| is|search()))
回来
$nav_class=(is_single())?“后导航”:“分页导航”;
?>

从循环的开始位置(foreach(have_posts())前面的行)共享wordpress查询参数和代码网格的CSS是什么?是否有一个
float:right
在某个地方?我设法解决了它,它可能是混乱和错误的,但它可以工作。在“Is\u single”循环中切换了前一个\u post\u链接和下一个\u post\u链接。似乎可以满足我的需要