<?php
/**
 * @var $terms
 * @var $display_title
 * @var $taxonomy
 */

if ( $terms ) {

	if ( $display_title == 'yes' ) { ?>

		<h4><?php _e( 'Popular categories', 'wpjobster' ); ?></h4>

	<?php } ?>

	<div class="most-popular-terms">

		<?php foreach ( $terms as $term ) { ?>

			<a href="<?php echo get_term_link( $term->slug, $taxonomy ); ?>" title="<?php echo $term->name; ?>"><?php echo $term->name; ?></a>

		<?php } ?>

	</div>

<?php } else echo '<style>.popular-categories-row-wrapper{display:none;}</style>'; // for page builder