So, meine search.php:
PHP
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="content">
<div class="article">
<h2><?php the_title(); ?>
<?php $arc_year = get_the_time('Y'); ?>
<a href="<?php echo get_year_link($arc_year); ?>" title="<?php the_time('Y'); ?>"><?php the_time('y'); ?>
<?php $arc_year = get_the_time('Y'); ?>
<?php $arc_month = get_the_time('m'); ?>
<a href="<?php echo get_month_link($arc_year, $arc_month); ?>" title="<?php the_time('F Y'); ?>"><?php the_time('m'); ?></a></h2>
<?php the_content(__('Read more', 'MLF')); ?>
<?php if ($post_type == post) : ?>
<p class="meta"><?php _e('Categorie', 'MLF') ?>: <?php the_category(', '); ?> | <?php comments_popup_link( __( 'Comments (0)', 'MLF' ), __( 'Comments (1)', 'MLF' ), __( 'Comments (%)', 'MLF' ) ) ?></p>
<?php endif; ?>
<?php if ($post_type == page) : ?>
<p class="meta"><?php comments_popup_link( __( 'Comments (0)', 'MLF' ), __( 'Comments (1)', 'MLF' ), __( 'Comments (%)', 'MLF' ) ) ?></p>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class="content">
<div class="article">
<h2><?php _e('Not Found', 'MLF') ?></h2>
<p><?php _e('Apologies, but we were unable to find what you were looking for. Perhaps searching will help.', 'MLF') ?></p>
</div>
</div>
<?php endif; ?>
<?php get_footer(); ?>
Alles anzeigen
ich glaube das ich mit der vermutung richtig liege, das es in der search.php nicht die möglichkeit gibt zu unterscheiden ob der artikel aus einem post oder page kommt. Kann man das vlt anders übergeben? Bzw der Abfrage mitteilen?