?>
					    <div class="span12">
					<?php 
    } else {
        ?>
					    <div class="span3">					
					<?php 
    }
    if ($showicons == true) {
        if (!empty($options['socialmedia_buttons_title'])) {
            echo '<h2 class="small">' . $options['socialmedia_buttons_title'] . '</h2>';
        }
        global $default_socialmedia_liste;
        echo '<nav id="socialmedia" aria-label="' . __('Social Media', 'fau') . '">';
        echo '<div itemscope itemtype="http://schema.org/Organization">';
        echo fau_create_schema_publisher(false);
        echo '<ul class="social">';
        ksort($default_socialmedia_liste);
        foreach ($default_socialmedia_liste as $entry => $listdata) {
            $value = '';
            $active = 0;
            if (isset($options['sm-list'][$entry]['content'])) {
                $value = $options['sm-list'][$entry]['content'];
                if (isset($options['sm-list'][$entry]['active'])) {
                    $active = $options['sm-list'][$entry]['active'];
                }
            } else {
                $value = $default_socialmedia_liste[$entry]['content'];
                $active = $default_socialmedia_liste[$entry]['active'];
            }
            if ($active == 1 && $value) {
Exemplo n.º 2
0
function fau_display_news_teaser($id = 0, $withdate = false)
{
    if ($id == 0) {
        return;
    }
    global $options;
    $post = get_post($id);
    $output = '';
    if ($post) {
        $output .= '<article class="news-item" itemscope itemtype="http://schema.org/NewsArticle">';
        $link = get_post_meta($post->ID, 'external_link', true);
        $external = false;
        if (isset($link) && filter_var($link, FILTER_VALIDATE_URL)) {
            $external = true;
        } else {
            $link = fau_esc_url(get_permalink($post->ID));
        }
        $output .= "\t<h2 itemprop=\"headline\">";
        $output .= '<a itemprop="url" ';
        if ($external) {
            $output .= 'class="ext-link" rel="canonical" ';
        }
        $output .= 'href="' . $link . '">' . get_the_title($post->ID) . '</a>';
        $output .= "</h2>\n";
        $categories = get_the_category();
        $separator = ', ';
        $thiscatstr = '';
        $typestr = '';
        if ($categories) {
            $typestr .= '<span class="news-meta-categories"> ';
            $typestr .= __('Kategorie', 'fau');
            $typestr .= ': ';
            foreach ($categories as $category) {
                $thiscatstr .= '<a href="' . get_category_link($category->term_id) . '">' . $category->cat_name . '</a>' . $separator;
            }
            $typestr .= trim($thiscatstr, $separator);
            $typestr .= '</span> ';
        }
        if ($withdate) {
            $output .= '<div class="news-meta">' . "\n";
            $output .= $typestr;
            $output .= '<span class="news-meta-date" itemprop="datePublished" content="' . esc_attr(get_post_time('c')) . '"> ' . get_the_date('', $post->ID) . "</span>\n";
            $output .= '</div>' . "\n";
        }
        $output .= "\t" . '<div class="row">' . "\n";
        if (has_post_thumbnail($post->ID) || $options['default_postthumb_always']) {
            $output .= "\t\t" . '<div aria-hidden="true" class="span3" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">' . "\n";
            $output .= '<a href="' . $link . '" class="news-image"';
            if ($external) {
                $output .= ' ext-link';
            }
            $output .= '>';
            $post_thumbnail_id = get_post_thumbnail_id($post->ID, 'post-thumb');
            $imagehtml = '';
            $imgwidth = $options['default_postthumb_width'];
            $imgheight = $options['default_postthumb_height'];
            $imgsrcset = '';
            if ($post_thumbnail_id) {
                $sliderimage = wp_get_attachment_image_src($post_thumbnail_id, 'post-thumb');
                $imageurl = $sliderimage[0];
                $imgwidth = $sliderimage[1];
                $imgheight = $sliderimage[2];
                $imgsrcset = wp_get_attachment_image_srcset($post_thumbnail_id, 'post-thumb');
            }
            if (!isset($imageurl) || strlen(trim($imageurl)) < 4) {
                $imageurl = $options['default_postthumb_src'];
            }
            $output .= '<img itemprop="thumbnailUrl" src="' . fau_esc_url($imageurl) . '" width="' . $imgwidth . '" height="' . $imgheight . '" alt=""';
            if ($imgsrcset) {
                $output .= ' srcset="' . $imgsrcset . '"';
            }
            $output .= '>';
            $output .= '</a>';
            $output .= "\t\t\t" . '<meta itemprop="url" content="' . fau_make_absolute_url($imageurl) . '">';
            $output .= "\t\t\t" . '<meta itemprop="width" content="' . $imgwidth . '">';
            $output .= "\t\t\t" . '<meta itemprop="height" content="' . $imgheight . '">';
            $output .= "\t\t" . '</div>' . "\n";
            $output .= "\t\t" . '<div class="span5">' . "\n";
        } else {
            $output .= "\t\t" . '<div class="span8">' . "\n";
        }
        $output .= "\t\t\t" . '<p itemprop="description">' . "\n";
        $cuttet = false;
        $abstract = get_post_meta($post->ID, 'abstract', true);
        if (strlen(trim($abstract)) < 3) {
            $abstract = fau_custom_excerpt($post->ID, $options['default_anleser_excerpt_length'], false, '', true);
        }
        $output .= $abstract;
        $output .= fau_create_readmore($link, get_the_title($post->ID), $external, true);
        $output .= "\t\t\t" . '</p>' . "\n";
        $output .= "\t\t" . '</div>' . "\n";
        $output .= "\t</div> <!-- /row -->\n";
        if (!$external) {
            $output .= fau_create_schema_publisher();
        }
        $output .= "</article> <!-- /news-item -->\n";
    }
    return $output;
}