Exemplo n.º 1
0
                if (has_post_thumbnail()) {
                    the_post_thumbnail(array($defaultoptions['smallslider-thumb-width'], $defaultoptions['smallslider-thumb-height']));
                } else {
                    if (isset($defaultbildsrc) && strlen(trim($defaultbildsrc)) > 2) {
                        echo '<img src="' . $defaultbildsrc . '" width="' . $defaultoptions['smallslider-thumb-width'] . '" height="' . $defaultoptions['smallslider-thumb-height'] . '" alt="">';
                    } else {
                        $randombild = array_rand($defaultbilder_liste, 2);
                        echo '<img src="' . $defaultbilder_liste[$randombild[0]]['src'] . '" width="' . $defaultoptions['smallslider-thumb-width'] . '" height="' . $defaultoptions['smallslider-thumb-height'] . '" alt="">';
                    }
                }
                echo "<h3><a href=";
                the_permalink();
                echo ">";
                the_title();
                echo '</a></h3><div class="teaser-excerpt">';
                echo get_piratenkleider_custom_excerpt();
                echo "</div></div>";
            }
            echo "</li>";
        }
    }
    echo "</ul>";
    echo "</div>";
    wp_reset_query();
}
?>
</div>
<div class="second-teaser-widget-area">
<div class="skin">
    <?php 
if (is_active_sidebar('second-teaser-widget-area')) {
Exemplo n.º 2
0
 /**
  * Suchausgabe
  */
 function piratenkleider_search_teaser($teaserlength = 250, $withthumb = 1, $aslist = 1, $search = '')
 {
     global $options;
     global $post;
     $out = $output = '';
     $leftbox = $thumbnailcode = $firstpic = $output = '';
     if ($withthumb == 1) {
         $leftbox .= '<div class="infoimage">';
         if (has_post_thumbnail()) {
             $output = get_the_post_thumbnail($post->ID, 'teaser-thumb');
             if (strlen($output) < 1) {
                 $output = '<img itemprop="image" src="' . $options['src-teaser-thumbnail_default'] . '" alt="">';
             }
         } else {
             $output = '<img itemprop="image" src="' . $options['src-teaser-thumbnail_default'] . '" alt="">';
         }
         $leftbox .= $output;
         $leftbox .= '</div>';
     }
     if ($aslist == 1) {
         $out .= '<li>';
     } else {
         $out .= '<div class="searchresults">';
     }
     $out .= '<h3>';
     $out .= '<a href="' . get_permalink() . '">';
     $out .= get_the_title();
     $out .= '</a></h3>';
     $out .= "\n";
     $out .= '<div>';
     $out .= $leftbox;
     $excerpt = get_piratenkleider_custom_excerpt($teaserlength, 1, 1, 2);
     if (trim($search) !== '') {
         $keys = array_diff(explode(" ", $search), array(''));
         $excerpt = preg_replace('/(' . implode('|', $keys) . ')/iu', '<strong class="search-hit">\\0</strong>', $excerpt);
     }
     $out .= $excerpt;
     $out .= '<p class="meta">';
     $out .= '<span class="date">' . __('Created at:', 'piratenkleider') . ' ' . piratenkleider_post_pubdateinfo(0) . '.</span> ';
     $typ = get_post_type();
     if ($typ == 'post') {
         $out .= '<span class="type">' . __('Type: Entry', 'piratenkleider') . '.</span> ';
     } elseif ($typ == 'page') {
         $out .= '<span class="type">' . __('Type: Page', 'piratenkleider') . '.</span> ';
     }
     $out .= "</p>\n";
     $out .= '</div>';
     if ($aslist == 1) {
         $out .= "</li>\n";
     } else {
         $out .= "</div>\n";
     }
     return $out;
 }