Üdv Mindenkinek!
Az új oldalam fejlesztésén dolgozom. Próbaként felraktam 11 bejegyzést és a minap kiakartam próbálni a Wordpress belső keresőjét, de valami gond lehet vagy csak én gondolom rosszul. Úgy gondoltam bemásolom ide .php kódjukat, hátha ti láttok valami hibát benne vagy netán minden klappol.
Keresés űrlap (searchform.php)
Code:
Search
Keresési eredmények (search.php)
Code:
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php
$prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick'));
$next_link = get_next_posts_link(__('« Older Entries', 'kubrick'));
?>
<?php if ($prev_link || $next_link): ?>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<?php echo implode(' | ', $icons); ?>
<?php endif; ?>
<?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>
<?php $icons = array(); ?>
<?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<?php echo implode(' | ', $icons); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php if ($prev_link || $next_link): ?>
<?php endif; ?>
<?php else : ?>
<?php if(function_exists('get_search_form')) get_search_form(); ?>
<?php endif; ?>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
<?php get_footer(); ?>
<?php if (have_posts()) : ?>
<?php _e('Search Results', 'kubrick'); ?>
<?php
$prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick'));
$next_link = get_next_posts_link(__('« Older Entries', 'kubrick'));
?>
<?php if ($prev_link || $next_link): ?>
<?php echo $next_link; ?>
<?php echo $prev_link; ?>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<?php echo implode(' | ', $icons); ?>
<?php endif; ?>
<?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>
<?php $icons = array(); ?>
<?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<?php echo implode(' | ', $icons); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php if ($prev_link || $next_link): ?>
<?php echo $next_link; ?>
<?php echo $prev_link; ?>
<?php endif; ?>
<?php else : ?>
<?php _e('Search Results', 'kubrick'); ?>
<?php _e('No posts found. Try a different search?', 'kubrick'); ?>
<?php if(function_exists('get_search_form')) get_search_form(); ?>
<?php endif; ?>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
<?php get_footer(); ?>
Remélem, ha ezt elolvastátok akkor tudtok valamit javasolni. Próbáltam a keresést úgy végrehajtani, hogy a bejegyzés címét írtam be a keresőbe, de akkor is annyi történt, hogy az összes bejegyzést beadta találatként ráadásul nem is az volt az első, aminek beírtam a címét. Aztán próbáltam, hogy a bejegyzés tartalmából szedtem ki valamit és azzal próbálkoztam, de az eredmény ugyanez volt.
Van valami ötletetek, hogy lehetne ezt finomhangolni?