Example #1
0
function featured_image_in_rss($content)
{
    global $post;
    global $options;
    // Überprüfen, ob Artikel ein Beitragsbild hat
    if (is_feed() && $options['feed-addthumbnail']) {
        if (!isHTML($content)) {
            $leftbox = '<div class="rss_bild" style="float: left;">';
            $firstpic = get_piratenkleider_firstpicture(false);
            if (has_post_thumbnail($post->ID)) {
                $output = get_the_post_thumbnail($post->ID, 'feedthumb', array('style' => 'margin-bottom:10px;'));
            } else {
                $output = '<img src="' . $options['src-teaser-thumbnail_default'] . '" alt="">';
            }
            $leftbox .= $output;
            $leftbox .= '</div>';
            $content = $leftbox . $content;
        }
    }
    return $content;
}
Example #2
0
     <?php 
     if ($num_comments > 0) {
         comments_popup_link('0<span class="skip"> Kommentar</span>', '1<span class="skip"> Kommentar</span>', '%<span class="skip"> Kommentare</span>', 'comments-link', '%<span class="skip"> Kommentare</span>');
     } else {
         // Wenn der Zeitraum abgelaufen ist UND keine Kommentare gegeben waren, dann
         // liefert die Funktion keinen Link, sondern nur den Text . Daher dieser
         // Woraround:
         $link = get_comments_link();
         echo '<a href="' . $link . '">0<span class="skip"> Kommentar</span></a>';
     }
     ?>
   </div> 
   <?php 
 }
 if ($options['aktiv-images-instead-date']) {
     $firstpic = get_piratenkleider_firstpicture();
     if (!empty($firstpic)) {
         ?>
                
         <div class="infoimage">                    
                 <?php 
         echo $firstpic;
         ?>
         </div>
     <?php 
     } else {
         ?>
                 
         <div class="cal-icon">
             <span class="day"><?php 
         the_time('j.');
Example #3
0
 /**
  * Erstellung eines Artikelteasers
  */
 function piratenkleider_post_teaser($titleup = 1, $showdatebox = 1, $showdateline = 0, $teaserlength = 200, $thumbfallback = 1, $usefloating = 0, $titlenum = 2)
 {
     global $options;
     global $post;
     $post_id = $post->ID;
     $sizeclass = '';
     $out = '';
     if ('linktipps' == get_post_type()) {
         $out = linktipp_display($post);
         return $out;
     }
     $leftbox = '';
     $sizeclass = 'p3-column withthumb';
     if ($showdatebox > 0 && $showdatebox < 5) {
         // Generate Thumb/Pic or Video first to find out which class we need
         $leftbox .= '<div class="infoimage">';
         $sizeclass = 'p3-column withthumb';
         $thumbnailcode = '';
         $firstpic = '';
         $firstvideo = '';
         if (has_post_thumbnail()) {
             $thumbnailcode = get_the_post_thumbnail($post->ID, 'teaser-thumb');
         }
         $firstpic = get_piratenkleider_firstpicture();
         $firstvideo = get_piratenkleider_firstvideo();
         $fallbackimg = '<img src="' . $options['src-teaser-thumbnail_default'] . '" alt="">';
         if ($showdatebox == 1) {
             if (!isset($output)) {
                 $output = $thumbnailcode;
             }
             if (!isset($output)) {
                 $output = $firstpic;
             }
             if (!isset($output) && isset($firstvideo)) {
                 $output = $firstvideo;
                 $sizeclass = 'p3-column withvideo';
             }
             if (!isset($output)) {
                 $output = $fallbackimg;
             }
             if (isset($output) && strlen(trim($output)) < 10) {
                 $output = $fallbackimg;
             }
         } elseif ($showdatebox == 2) {
             if (!isset($output)) {
                 $output = $firstpic;
             }
             if (!isset($output)) {
                 $output = $thumbnailcode;
             }
             if (!isset($output) && isset($firstvideo)) {
                 $output = $firstvideo;
                 $sizeclass = 'p3-column withvideo';
             }
             if (!isset($output)) {
                 $output = $fallbackimg;
             }
             if (isset($output) && strlen(trim($output)) < 10) {
                 $output = $fallbackimg;
             }
         } elseif ($showdatebox == 3) {
             if (!isset($output) && isset($firstvideo)) {
                 $output = $firstvideo;
                 $sizeclass = 'p3-column withvideo';
             }
             if (!isset($output)) {
                 $output = $thumbnailcode;
             }
             if (!isset($output)) {
                 $output = $firstpic;
             }
             if (!isset($output)) {
                 $output = $fallbackimg;
             }
             if (isset($output) && strlen(trim($output)) < 10) {
                 $output = $fallbackimg;
             }
         } elseif ($showdatebox == 4) {
             if (!isset($output) && isset($firstvideo)) {
                 $output = $firstvideo;
                 $sizeclass = 'p3-column withvideo';
             }
             if (!isset($output)) {
                 $output = $firstpic;
             }
             if (!isset($output)) {
                 $output = $thumbnailcode;
             }
             if (!isset($output)) {
                 $output = $fallbackimg;
             }
             if (isset($output) && strlen(trim($output)) < 10) {
                 $output = $fallbackimg;
             }
         } else {
             $output = $fallbackimg;
         }
         $leftbox .= $output;
         $leftbox .= '</div>';
     } else {
         $sizeclass = 'p3-column';
     }
     if ($usefloating == 1) {
         $sizeclass .= " usefloating";
     }
     $out .= '<section class="' . implode(' ', get_post_class($sizeclass)) . '" id="post-' . $post->ID . '" >';
     $titlenum = (int) $titlenum;
     if ($titlenum < 1 || $titlenum > 6) {
         $titlenum = 2;
     }
     $htmltitlestart = '<h' . $titlenum . '>';
     $htmltitleend = '</h' . $titlenum . '>';
     if ($titleup == 1) {
         $out .= '<header class="post-title p3-cbox">' . $htmltitlestart;
         $out .= '<a href="' . get_permalink() . '" rel="bookmark">';
         $out .= get_the_title();
         $out .= '</a>' . $htmltitleend . '</header>';
         $out .= "\n";
         $out .= '<div class="p3-column">';
     }
     if ($showdatebox < 5) {
         $out .= '<div class="post-info p3-col1"><div class="p3-cbox">';
         if ($showdatebox == 0) {
             $num_comments = get_comments_number();
             if ($num_comments > 0 || $options['zeige_commentbubble_null']) {
                 $out .= '<div class="commentbubble">';
                 $link = get_comments_link();
                 $out .= '<a href="' . $link . '">' . $num_comments . '<span class="skip"> ';
                 if ($num_comments > 0) {
                     $out .= __('Comments', 'piratenkleider') . '</span></a>';
                 } else {
                     $out .= __('Comment', 'piratenkleider') . '</span></a>';
                 }
                 $out .= "</div>\n";
             }
             $out .= '<div class="cal-icon">';
             $out .= '<span class="day">' . get_the_time('j.') . '</span>';
             $out .= '<span class="month">' . get_the_time('m.') . '</span>';
             $out .= '<span class="year">' . get_the_time('Y') . '</span>';
             $out .= "</div>\n";
         } else {
             $out .= $leftbox;
         }
         $out .= "</div></div>\n";
         $out .= '<article class="post-entry p3-col3">';
         $out .= '<div class="p3-cbox';
         if ($usefloating == 0) {
             $out .= ' p3-clearfix';
         }
         $out .= '">';
     } else {
         $out .= '<article class="post-entry p3-cbox">';
     }
     if ($titleup == 0) {
         $out .= '<header class="post-title">' . $htmltitlestart;
         $out .= '<a href="' . get_permalink() . '" rel="bookmark">';
         $out .= get_the_title();
         $out .= "</a>" . $htmltitleend . "</header>\n";
     }
     if ($showdatebox != 0 && $showdateline == 1) {
         $out .= '<p class="pubdateinfo">';
         $out .= piratenkleider_post_pubdateinfo(0);
         $out .= "</p>\n";
     }
     $out .= get_piratenkleider_custom_excerpt($teaserlength, 1, 1, $options['continuelink']);
     if ($showdatebox < 5) {
         $out .= "</div>\n";
         $out .= '<div class="p3-ie-clearing">&nbsp;</div>';
     }
     $out .= "</article>\n";
     if ($titleup == 1) {
         $out .= '</div>';
     }
     $out .= "</section>\n";
     return $out;
 }