function get_term_image($term_id)
{
    $out = '';
    $image = get_term_meta($term_id, 'image', true);
    //interoperability:
    if (function_exists('get_term_thumbnail') && trim($image) == '') {
        //fallback to the term thumbnail plugin
        $image = get_term_thumbnail($term_id, 'full', array('class' => "venue-image"));
        return $image;
    }
    if (trim($image) != '') {
        $out = sprintf('<img class="venue-image" src="%s"/>', $image);
    }
    return $out;
}
Example #2
0
        <span class="special-nav-btn fa fa-filter js-special-toggle"></span>

        <?php 
if (function_exists('yoast_breadcrumb')) {
    yoast_breadcrumb('<nav class="breadcrumbs">', '</nav>');
}
?>
        <?php 
if (have_posts()) {
    ?>

            <article class="post-preview post-preview--spoiler" role="article">
                <?php 
    $current_term = get_queried_object()->term_id;
    the_archive_title('<h1 class="article__title">', '</h1>');
    echo get_term_thumbnail($current_term);
    echo '<section class="spoiler-body" itemscope itemtype="http://schema.org/ImageGallery">';
    echo get_the_archive_description();
    echo '</section>';
    ?>
            </article>

            <?php 
    // Start the Loop.
    while (have_posts()) {
        the_post();
        /*
         * Include the Post-Format-specific template for the content.
         * If you want to override this in a child theme, then include a file
         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
         */