Friday, 25 June 2010

Wordpress Search.php question?


hey, own blog. whenever search on in search bar 1 result. know why? here's example http://www.macview.ca/?s=diablo.
code search.php below.

php:
<?php get_header(); ?>


   <div id="primary" class="grid_15">
   <div class="informationbar">
  <h4 class="topnews"> ipad 3 released on march 7th </h4>
  
  
   </div>
            





<?php $posts=query_posts($query_string .
'&posts_per_page=15'); ?>         
<?php if (have_posts()) : ?>
      





<div class="pushhh">

<div class="thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<img src="http://macview.ca/wp-content/themes/macview.ca/timthumb.php?src=<?php echo catch_that_image() ?>&w=140&h=105&zc=1">
</a>
</div>



<a class="titlesearch" href="<?php the_permalink() ?>" rel="bookmark" 
title="permanent link to <?php the_title_attribute(); ?>">
<?php the_title(); ?></a>

<div>

<a class="textunderneath"><?php the_time('l js f, y - g:ia'?> <?php $author get_the_author(); ?> </a>
<a class="searchcomments" href="<?php comments_link(); ?>"><?php comments_number'no responses''one response''% responses' ); ?> </a>
 

</div> 
</div>



      
      
      <div class="navigation">
 <div class="alignleft">

<p class="alignleft2"><?php next_posts_link('continue reading'?> </p> </div>

<div class="alignright">

<p class="alignright2"><?php previous_posts_link('newer posts'?> </p> </div> 

 </div>
<?php else : ?>
<h2 class="center">not found</h2>
<p class="center">sorry, but you are looking for something that
         isn't here.</p>
      <?php get_search_form(); ?>
   <?php endif; ?>         
            
            
            
            
            
            
            
            
<?php get_sidebar(); ?>

<?php get_footer(); ?>
 

at cursory glance looks code's missing
php:
while(have_posts())
the display of search results needs in loop otherwise it'll show first result.
 


Forums Special Interests Web Design and Development


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment