İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

Search Sonuclarini genisletme Yardim Lutfen

mehliz

0
İyinet Üyesi
Katılım
11 Şubat 2017
Mesajlar
16
Reaction score
0
Merhaba
wordpress de bir thema kullaniyorum
ziyaretciler arama yaptiklarinda sayet dosyanin ilk kelimesini tam anlami ile dogru yazmadiklari zaman search sonuclarinda hicbirsey gozukmuyor


ornek "Besiktas sampiyonluk yillari" bunu araticak ve boyle bir baslik var sitede

ama "Besiktask sampiyonluk yillari" yazdiginda yani bir k fazla eklediginde arama sonuclarinda hicbirsey gozukmuyor

bunu nasil duzeltebilirim yardimci olurmusunuz



search.php ve searchresult php kodlarini ekliyorum


Searchform.php
PHP:
<form class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input class="search-input" type="text" name="s" placeholder="<?php _e('Search...','mtms'); ?>
<button type="submit" id=""><span class="icon-search2"></span></button>
</form>

SearchResult.php

PHP:
<?php get_header(); ?>
<div class="module <?php echo get_option('homepage_layout'); ?>">
	<?php get_template_part('inc/parts/sidebar'); ?>
	<div class="content">
		<header>
			<h1><?php _e('Results found:', 'mtms');  ?> <?php echo $_GET['s'] ?></h1> 
		</header>
		<div class="search-page">
			<div class="search_page_form">
				<form method="get" id="searchformpage" action="<?php echo esc_url( home_url() ); ?>">
					<input type="text" placeholder="<?php _e('Search...','mtms'); ?>" name="s" id="s" value="<?php echo $_GET['s'] ?>">
					<button type="submit"><span class="icon-search2"></span></button>
				</form>
			</div>

		<?php 
			if (have_posts()) :while (have_posts()) : the_post(); 
			$thumb_id = get_post_thumbnail_id();
			$thumb_url =  wp_get_attachment_image_src($thumb_id,'thumbnail', true);
			$dt_date = new DateTime(dt_get_meta('air_date'));
		?>
			<div class="result-item">
				<article>
					<div class="image">
						<div class="thumbnail animation-2">
							<a href="<?php the_permalink();?>">
							<?php if(get_post_type() == 'episodes') { ?>
							<img src="<?php if($thumb_id) { echo $thumb_url[0]; } else { dt_image_search('dt_backdrop', $post->ID, 'w90'); } ?>" alt="<?php the_title(); ?>" />
							<?php } else { ?>
							<img src="<?php if($thumb_id) { echo $thumb_url[0]; } else { dt_image_search('dt_poster', $post->ID, 'w90'); } ?>" alt="<?php the_title(); ?>" />
							<?php } ?>
							<span class="<?php echo get_post_type(); ?>">
							<?php
							// Get post types
							if($d = get_post_type() == 'movies') { _e('Movie','mtms'); } 
							if($d = get_post_type() == 'tvshows') { _e('TV','mtms'); }
							if($d = get_post_type() == 'post') { _e('Post','mtms'); } 
							if($d = get_post_type() == 'episodes') { _e('Episode','mtms'); }
							if($d = get_post_type() == 'seasons') { _e('Season','mtms'); } 
							?>
							</span>
							</a>
						</div>
					</div>
					<div class="details">
						<div class="title">
							<a href="<?php the_permalink();?>"><?php the_title(); ?></a>
						</div>
						<div class="meta">
						<?php if($rt = dt_get_meta('imdbRating')) { echo '<span class="rating">IMDb '. $rt .'</span>'; } ?>
						<?php if( get_post_type() == 'episodes') { if($d = $dt_date) { echo '<span class="year">', $d->format(DT_TIME), '</span>'; } } ?>
						<?php if($yr = $tms = strip_tags( $tms = get_the_term_list( $post->ID, 'dtyear'))) { echo '<span class="year">'. $yr .'</span>'; } ?>
						
						</div>
						<div class="contenido">
							<p><?php dt_content('',TRUE,'', '30'); ?></p>
						</div>
					</div>
				</article>
			</div>
		<?php endwhile; else: ?>
		<div class="no-result animation-2">
			<h2><?php _e('No results to show with','mtms'); ?> <span><?php echo $_GET['s'] ?></span></h2>
			<strong><?php _e('Suggestions','mtms'); ?>:</strong>
			<ul>
<li><strong><span style="color: #ff0000;"><?php _e('Make sure all words are spelled correctly ','mtms'); ?></span></strong></li>
				<li><?php _e('Make sure all words are spelled correctly.','mtms'); ?></li>
				<li><?php _e('Try different keywords.','mtms'); ?></li>
				<li><?php _e('Try more general keywords.','mtms'); ?></li>
			</ul>
		</div>
		<?php endif; ?>
		</div> 
	<?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?>
	</div>
</div>
<?php get_footer(); ?>
 

mehliz

0
İyinet Üyesi
Katılım
11 Şubat 2017
Mesajlar
16
Reaction score
0
uzun zaman olmustu iyinet e girmiyeli ..
eskiden php bolumunde soru soruldugu zaman Angelo idi sanirim yanlis hatirlamiyorsam daha acilan baslik 10 gosterim almadan hemen cevap verirdi ne gunlerdi
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst