使页面ajax停止在Wordpress中重新加载

时间:2016-10-15 08:36:17

标签: php jquery ajax wordpress

如何让这个停止重新加载页面以获取我想要发布的category_name。点击链接时我有一个代码,它会将我的category_name从我的wordpress查询帖子更改为其他类别,但我的问题是它重新加载页面。

这是我的代码:

<div class="row">
    <div class="col-md-4">
    <p class="title1"><?php echo get_theme_mod('qmark-services-section-service-title') ?></p>
    <p class="servicelist"><a href="http://localhost/qmark/?category=water-pumps">Water Pumps Repairs</a></p>
    <p class="servicelist"><a href="http://localhost/qmark/?category=water-heater">Water Heater Repairs</a></p>
    <p class="servicelist">PPR Pipes Repairs</p>
    <p class="servicelist">Electrical Repairs</p>
    </div>
    <div class="col-md-8">
        <div class="row row-left">
            <?php
            $args = array(
            'post_type' => 'post',
            'category_name' => $_GET['category'],
            'posts_per_page' => '6',
            );
            $queryBlog = new WP_Query( $args );

            $count = 0;
            if( $queryBlog->have_posts() ) : 
                while ( $queryBlog->have_posts() ) : $queryBlog->the_post(); 
            ?>
        <div class="col-xs-3 col-box2">
                <?php the_post_thumbnail('thumbnail'); ?>
            </div>
                <?php if($count==2) :
                    echo '</div>';
                    echo '<div class="row row-left">';
                endif; 
                $count++; endwhile; 
            endif; 
            wp_reset_postdata();
                ?> 
        </div>
    </div>
</div>

0 个答案:

没有答案