?> </div> </div> <div class="span9"> <?php } else { ?> <div class="span12"> <?php } ?> <main> <?php while (have_posts()) { the_post(); echo FAU_Person_Shortcodes::fau_person(array("id" => $post->ID, 'format' => 'kompakt', 'showlink' => 1, 'showlist' => 1)); } ?> <nav class="navigation"> <div class="nav-previous"><?php previous_posts_link(__('<span class="meta-nav">«</span> Vorherige Einträge', 'fau')); ?> </div> <div class="nav-next"><?php next_posts_link(__('Weitere Einträge <span class="meta-nav">»</span>', 'fau'), ''); ?> </div> </nav>
function fau_display_search_resultitem($withsidebar = 1) { global $post; global $options; $output = ''; $withthumb = $options['search_display_post_thumbnails']; $withcats = $options['search_display_post_cats']; $withtypenote = $options['search_display_typenote']; $attachment = array(); if (isset($post) && isset($post->ID)) { $link = get_post_meta($post->ID, 'external_link', true); $external = 0; if (isset($link) && filter_var($link, FILTER_VALIDATE_URL)) { $external = 1; } else { $link = fau_make_link_relative(get_permalink($post->ID)); } $type = get_post_type(); $typeclass = "res-" . $type; $output .= '<article class="search-result ' . $typeclass . '">' . "\n"; $output .= "\t<h3><a "; if ($external == 1) { $output .= 'class="ext-link" '; } $output .= "href=\"" . $link . "\">" . get_the_title() . "</a></h3>\n"; $typeinfo = get_post_type_object($type); if ($type == 'post') { $typestr = '<div class="search-meta">'; if ($withtypenote == true) { $typestr .= '<span class="post-meta-news"> '; $typestr .= __('Beitrag', 'fau'); $typestr .= '</span>'; } $categories = get_the_category(); $separator = ', '; $thiscatstr = ''; if ($withcats == true && $categories) { $typestr .= '<span class="post-meta-category"> '; $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> '; } $topevent_date = get_post_meta($post->ID, 'topevent_date', true); if ($topevent_date) { $typestr .= '<span class="post-meta-date"> '; $typestr .= date_i18n(get_option('date_format'), strtotime($topevent_date)); $typestr .= ' ('; $typestr .= __('Veranstaltungshinweis', 'fau'); $typestr .= ')'; $typestr .= '</span>'; } else { $typestr .= '<span class="post-meta-date"> '; $typestr .= get_the_date(); $typestr .= '</span>'; } $typestr .= '</div>' . "\n"; } elseif ($type == 'person') { $typestr = '<div class="search-meta">'; $typestr .= '<span class="post-meta-kontakt"> '; $typestr .= $typeinfo->labels->singular_name; $typestr .= '</span>'; $typestr .= '</div>' . "\n"; } elseif ($type == 'event') { $typestr = '<div class="search-meta">'; $typestr .= '<span class="post-meta-event"> '; $typestr .= __('Veranstaltungshinweis', 'fau'); $typestr .= '</span>'; $typestr .= '</div>' . "\n"; } elseif ($type == 'attachment') { $attachment = wp_prepare_attachment_for_js($post->ID); $filesize = isset($attachment['filesizeHumanReadable']) ? $attachment['filesizeHumanReadable'] : ''; $filesize = isset($attachment['filesize']) && !isset($filesize) ? $attachment['filesize'] : $filesize; $filesize = isset($attachment['filesizeInBytes']) && !isset($filesize) ? $attachment['filesizeInBytes'] . " Bytes" : $filesize; $filetype = wp_check_filetype($attachment['url']); $typestr = '<div class="search-meta">'; $typestr .= '<span class="post-meta-attachment">'; $typestr .= ' <span class="dateityp">' . $filetype['ext'] . '</span> '; $typestr .= __('Datei', 'fau'); $typestr .= '</span>'; $typestr .= ' <span class="post-meta-date"> '; $typestr .= get_the_date(); if (get_the_date() != get_the_modified_date()) { $typestr .= ' (' . __('Erstellungsdatum', 'fau') . ')'; $typestr .= '</span>'; $typestr .= ' <span class="post-meta-date"> '; $typestr .= get_the_modified_date(); $typestr .= ' (' . __('Letzte Änderung', 'fau') . ')'; } $typestr .= '</span>'; $typestr .= ' <span class="download">'; $typestr .= ' <a href="' . fau_esc_url($attachment['url']) . '">' . __('Download', 'fau') . '</a>'; $typestr .= ' <span class="filesize">(<span class="unsichtbar">'; $typestr .= __('Größe:', 'fau') . ' </span>' . $filesize; $typestr .= ')</span>'; $typestr .= '</span>'; $typestr .= '</div>' . "\n"; } elseif ($withtypenote == true) { $typestr = '<div class="search-meta">'; $typestr .= '<span class="post-meta-defaulttype"> '; $typestr .= $typeinfo->labels->singular_name; $typestr .= '</span>'; $typestr .= ' <span class="post-meta-date"> '; $typestr .= get_the_modified_date(); $typestr .= ' (' . __('Letzte Änderung', 'fau') . ')'; $typestr .= '</span>'; $typestr .= '</div>' . "\n"; } else { $typestr = ''; } if (!empty($typestr)) { $output .= "\t" . $typestr . "\n"; } $output .= "\t"; if ($type == 'person' && class_exists('FAU_Person_Shortcodes')) { if ($withthumb == true && has_post_thumbnail($post->ID)) { $output .= '<div class="row">' . "\n"; $output .= "\t\t" . '<div class="span3">' . "\n"; $output .= '<a href="' . $link . '" class="news-image"'; if ($external == 1) { $output .= ' ext-link'; } $output .= '">'; $post_thumbnail_id = get_post_thumbnail_id($post->ID, 'post-thumb'); $imagehtml = ''; $imgsrcset = ''; if ($post_thumbnail_id) { $sliderimage = wp_get_attachment_image_src($post_thumbnail_id, 'post-thumb'); $imgsrcset = wp_get_attachment_image_srcset($post_thumbnail_id, 'post-thumb'); $imageurl = $sliderimage[0]; } if (!isset($imageurl) || strlen(trim($imageurl)) < 4) { $imageurl = $options['default_postthumb_src']; } $output .= '<img src="' . fau_esc_url($imageurl) . '" width="' . $options['default_postthumb_width'] . '" height="' . $options['default_postthumb_height'] . '" alt=""'; if ($imgsrcset) { $output .= ' srcset="' . $imgsrcset . '"'; } $output .= '>'; $output .= '</a>'; $output .= "\t\t" . '</div>' . "\n"; if ($withsidebar) { $output .= "\t\t" . '<div class="span6">' . "\n"; } else { $output .= "\t\t" . '<div class="span9">' . "\n"; } } $output .= FAU_Person_Shortcodes::fau_person(array("id" => $post->ID, 'format' => 'kompakt', 'showlink' => 0, 'showlist' => 0, 'hide' => 'bild')); if ($withthumb == true && has_post_thumbnail($post->ID)) { $output .= "\t</div> <!-- /row -->\n"; } /* }elseif (($type == 'standort') && (function_exists('fau_standort'))) { $output .= fau_standort(array("id"=> $post->ID)); */ } elseif ($type == 'attachment') { if ($withthumb == true) { $output .= '<div class="row">' . "\n"; $output .= "\t\t" . '<div class="span1 span-small">' . "\n"; $output .= '<img src="' . fau_esc_url($attachment['icon']) . '" width="48" height="64" alt="">'; $output .= "\t\t" . '</div>' . "\n"; if ($withsidebar) { $output .= "\t\t" . '<div class="span7">' . "\n"; } else { $output .= "\t\t" . '<div class="span11">' . "\n"; } } $output .= "\t\t" . '<p><em>' . "\n"; $output .= "\t\t\t" . $attachment['caption']; $output .= "\t\t" . '</em></p>' . "\n"; $output .= "\t\t" . '<p>' . "\n"; $output .= "\t\t\t" . $attachment['description']; $output .= "\t\t" . '</p>' . "\n"; if ($withthumb == true) { $output .= "\t</div> <!-- /row -->\n"; } } else { if ($withthumb == true && has_post_thumbnail($post->ID)) { $output .= '<div class="row">' . "\n"; $output .= "\t\t" . '<div class="span3">' . "\n"; $output .= '<a href="' . $link . '" class="news-image"'; if ($external == 1) { $output .= ' ext-link'; } $output .= '">'; $post_thumbnail_id = get_post_thumbnail_id($post->ID, 'post-thumb'); $imagehtml = ''; $imgsrcset = ''; if ($post_thumbnail_id) { $sliderimage = wp_get_attachment_image_src($post_thumbnail_id, 'post-thumb'); $imgsrcset = wp_get_attachment_image_srcset($post_thumbnail_id, 'post-thumb'); $imageurl = $sliderimage[0]; } if (!isset($imageurl) || strlen(trim($imageurl)) < 4) { $imageurl = $options['default_postthumb_src']; } $output .= '<img src="' . fau_esc_url($imageurl) . '" width="' . $options['default_postthumb_width'] . '" height="' . $options['default_postthumb_height'] . '" alt=""'; if ($imgsrcset) { $output .= ' srcset="' . $imgsrcset . '"'; } $output .= '>'; $output .= '</a>'; $output .= "\t\t" . '</div>' . "\n"; if ($withsidebar) { $output .= "\t\t" . '<div class="span6">' . "\n"; } else { $output .= "\t\t" . '<div class="span9">' . "\n"; } } $output .= "\t\t" . '<p>' . "\n"; $output .= fau_custom_excerpt($post->ID, $options['default_search_excerpt_length'], false, '', true, $options['search_display_excerpt_morestring']); if ($options['search_display_continue_arrow']) { $output .= fau_create_readmore($link, '', $external, true); } $output .= "\t\t\t" . '</p>' . "\n"; if ($withthumb == true && has_post_thumbnail($post->ID)) { $output .= "\t</div> <!-- /row -->\n"; } } $output .= "</article>\n"; } else { $output .= "<!-- empty result -->\n"; } return $output; }