Get the current posts's taxonomies terms to display them as an id


Staff member
I have the following code, and basically want it to display the term's slug in the data-type="HERE" part. This is on a static html page outside of the wordpress installation.

I have it displaying the custom post types as a list, but can't get it to display the terms from the taxonomy of 'categories'.

<?php $args = array( 'post_type' => 'case_study' ); ?>
<?php require($_SERVER['DOCUMENT_ROOT'] . '/news/wp-load.php'); query_posts($args );  if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li data-id="id-<?php the_ID(); ?>" data-type="DISPLAY TAXONOMY OF CATERGORIES TERMS HERE">
        <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
            <?php the_post_thumbnail('case-study-thumb'); ?>
            <?php the_title(); ?>
<?php endwhile; ?>
<?php else: ?>
    <li>No Case Studies found</li>
<?php endif; ?>

Any help would be greatly appreciated!

Many thanks