<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;
global $post;
$petition_date  = isset($campoal_options['conikal_petition_date_field']) ? $campoal_options['conikal_petition_date_field'] : 1;

$petition_id    = $post->ID;
$date           = get_the_date('', $petition_id);
$topics         = wp_get_post_terms($petition_id, 'petition_topics');
?>

<div class="petition-data-section">
    <?php if ($petition_date == 1) : ?>
        <div class="ui right floated tiny header"><?php echo esc_html($date) ?></div>
    <?php endif; ?>
    <?php if ($topics) { ?>
        <div class="petition-tag-section">
            <div class="ui labels">
                <?php foreach($topics as $topic) { ?>
                    <a href="<?php echo esc_url(get_term_link($topic->term_id)) ?>" class="ui label" data-bjax><?php echo esc_html($topic->name) ?></a>
                <?php } ?>
            </div>
        </div>
    <?php } ?>
    <div class="clearfix"></div>
</div>