WP工作经理:不同的列表风格的特色工作


WP Job Manager: Different list style to featured jobs

如何在网格列表视图和其他列表视图中显示特色作业?

我尝试在class-wp-job-manager-ajax.php 上进行多个查询

    if ( $jobs->have_posts() ) : $result['found_jobs'] = true; ?>
        <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
            <?php 
                $email = get_the_author_meta('user_email');
                $id = get_the_author_meta('ID');
                if ( woocommerce_customer_bought_product( $email, $id, 1013) || woocommerce_customer_bought_product( $email, $id, 1017) ) {
                    get_job_manager_template_part( 'content', 'job_listing-premium' ); 
                }
            ?>
        <?php endwhile; ?>

        <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
            <?php 
                $email = get_the_author_meta('user_email');
                $id = get_the_author_meta('ID');
                    get_job_manager_template_part( 'content', 'job_listing' ); 
            ?>
        <?php endwhile; ?>
    <?php else : ?>
        <?php get_job_manager_template_part( 'content', 'no-jobs-found' ); ?>
    <?php endif;

但我的高级列表视图带有erro风格,不像其他人那样没有ID名称。

有人已经试着做那样的事了?

谢谢=D

在ajax-filters.js中,将下面的代码放在加载作业列表的函数的末尾。

    $('.style-grid').addClass('style-list');
    $('.style-grid').removeClass('col-sm-6');
    $('.style-grid').removeClass('style-grid');
    $('.job_position_featured').removeClass('style-list');
    $('.job_position_featured').addClass('style-grid');
    $('.job_position_featured').addClass('col-sm-6');