• I was reading the past thread and found this code below and was wondering can how to make it show a certain category in it. I created an achievement category called Levels. I want to show the most recent achieved level.

    Here is the new / improved / permanent way to display achievements in a buddypress template:

    <?php
    	// WP_Query arguments
    	$args = array (
    	'post_type'              => 'dpa_progress',
    	'post_status'            => 'dpa_unlocked',
    	'author'                 => bp_displayed_user_id(),
    	'order'                  => 'DESC',
    	'orderby'                => 'date',
    	'nopaging'		 => true
    	);
    
    	// The Query
    	$badges = new WP_Query( $args );
    ?>
    
    <?php while ($badges->have_posts()) : $badges->the_post(); ?>
         <a href="<?php echo get_permalink($post->post_parent); ?>" title="<?php esc_attr( the_title() ); ?>">
         <?php echo get_the_post_thumbnail($post->post_parent,'thumbnail'); ?>
         </a>
    <?php endwhile; ?>
    
    <?php wp_reset_postdata(); ?>

    https://www.ads-software.com/plugins/achievements/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can I add a particular category for this code?’ is closed to new replies.