Is there any reason to modify our WP_QUERY args?
In our 1.2.0 version, we introduced “filterby” shortcode attribute than can be used in our ACADP shortcodes to filter listings by featured.
Example:
[acadp_listings filterby=featured]
Kindly check https://pluginsware.com/documentation/shortcodes/ for more details.
I’m doing a carousel of products with JQuery, I’m taking the name, photo and price, but only need to show the feature.
This is my code.
`
<?php $args=array(
‘post_type’ => ‘acadp_listings’,
‘orderby’ => ‘date’,
‘order’ => ‘ASC’,
‘posts_per_page’ => -1,
‘post_status’ => ‘publish’,
‘filterby’ => ‘featured’
); ?>
<?php $bici = new WP_Query($args); ?>
<?php while($bici->have_posts()): $bici->the_post(); $post_meta = get_post_meta( $post->ID );?>
<?php the_acadp_listing_thumbnail( $post_meta ); ?>
<<?php echo $post->post_title; ?>
<?php $price = acadp_format_amount( $post_meta[‘price’][0] );
echo acadp_currency_filter( $price ); ?>
<?php endwhile; wp_reset_postdata(); ?>
This is my code.
<?php $args=array(
'post_type' => 'acadp_listings',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => -1,
'post_status' => 'publish',
'filterby' => 'featured'
); ?>
<?php $bici = new WP_Query($args); ?>
<?php while($bici->have_posts()): $bici->the_post(); $post_meta = get_post_meta( $post->ID );?>
<?php the_acadp_listing_thumbnail( $post_meta ); ?>
<<?php echo $post->post_title; ?>
<?php $price = acadp_format_amount( $post_meta['price'][0] );
echo acadp_currency_filter( $price ); ?>
<?php endwhile; wp_reset_postdata(); ?>
Try using the following code,
$args = array(
'post_type' => 'acadp_listings',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => -1,
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'featured',
'value' => 1,
'compare' => '='
)
)
);