Don’t know how to describe to correctly but i will give it a shoot.
Am using following code will give me a list like
Android
iPhone
Blackberry
<?php
// args
$args = array(
'posts_per_page' => -1,
'post_type' => 'bonus',
'meta_query' => array(
array(
'key' => 'listing_type', // name of custom field
'value' => '"Mobile"', // matches exaclty "red", not just red. This prevents a match for "acquired"
'compare' => 'LIKE'
))
);
// get results
$the_query = new WP_Query( $args );
// The Loop
?>
<?php if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a class="list-group-item" href="<?php the_permalink(); ?>" title="">
<?php the_title();?>
</a>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Is there any way that i can show the number of objects in each of this ? like.. “Android 15”
For example on the android page i would use the following query to fetch my items.
$type = casino;
$key = mobile_platforms;
$value = Android;
// args
$args = array(
'meta_key' => 'votes_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'posts_per_page' => -1,
'post_type' => $type,
'meta_query' => array(
array(
'key' => $key, // name of custom field
'value' => $value, // matches exaclty "red", not just red. This prevents a match for "acquired"
'compare' => 'LIKE'
))
);
Any idea ?