小编Mr *_*Yar的帖子

如何在woocommerce中列出最畅销的产品

我想在这个循环中考虑最畅销的产品:

<?php
    $args4 = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'cat', 'order' => 'DEC' );
    $loop4 = new WP_Query( $args4 );
    while ( $loop4->have_posts() ) : $loop4->the_post();?>
    <div class="view-back">
        <span><?php echo $product->get_categories( ) ?></span>
        <span><?php echo $product->get_price_html(); ?></span>
        <a class="pb" href="<?php echo get_permalink( $loop4->post->ID ) ?>">more<i class="fa fa-arrow-circle-o-right fa-2x" aria-hidden="true"></i></a>
        <span class="pt"><?php the_title(); ?></span>
    </div>
    <?php $image4 = wp_get_attachment_image_src( get_post_thumbnail_id($loop4->post->ID), 'single-post-thumbnail' );?>
    <img src="<?php  echo $image4[0]; ?>" data-id="<?php echo $loop4->post->ID; ?>">
    <?php endwhile; ?>
    <?php wp_reset_postdata(); ?>
Run Code Online (Sandbox Code Playgroud)

wordpress woocommerce

6
推荐指数
1
解决办法
2万
查看次数

如何更改mysql中的起始ID号

我想将 id 的初始数量从 1 更改为 2000。我的表:

id  value     type 
1   e         photo     
2   f         text
3   g         photo 
Run Code Online (Sandbox Code Playgroud)

这就是我想要的结果:

id      value     type 
2001    e         photo     
2002    f         text
2003    g         photo 
Run Code Online (Sandbox Code Playgroud)

mysql database

2
推荐指数
1
解决办法
2850
查看次数

标签 统计

database ×1

mysql ×1

woocommerce ×1

wordpress ×1