Custom search page - how to make results link to products broght up in search?

Social theme's search results included my gravatar. As I am making a site with a MarketPress focus, rather than providing my pic in results, I would prefer to display the featured image for each product. After reviewing posts here, I concluded that I needed to create a unique search.php template. Problem? Currently, my search results lead to my 404 page.
Obviously, I know this is wrong:
<h1 class="post-title">"><?php the_title(); ?></h1>

There must be a php statement for the link to my specific product, but I have no idea what it is. <?php my_product(); ?> LOL, but seriously, can anyone point me in the right direction so my search query actually links to the content it is 'finding'?

Here is current example so you can see where I am thus far:

Thanks much for any help you can send my way! (Yes, I know it's currently ugly, but when I can make it work correctly, I'll css it into a tasty result. )

  • camparoo

    Yes, I do have featured images in my product posts, but they do not appear in the search results when I use the search page results generated by the Social theme. This is why I am trying to make a custom search page, so I can add featured images to the results. I simply do not know how to call for the individual products in the search results. Instead, the current search results create a non-usable link to the actual title of the image.

  • camparoo

    OK, I got this one. Working in the 'Social' theme, I made a page called 'search.php' by using the contents of 'page.php' and I then augmented it with some stolen code from 'index-post.php' and made a few edits.

    Here's the altered section of the code:

    Template Name: Search Page
    <?php get_header(); ?>
    <div id=&quot;post-entry&quot;>
    <p style=&quot;font-weight:bold;font-size:2em;padding-bottom:30px;color:#000000;&quot;>Search Results for <?php the_search_query(); ?></p>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <div class=&quot;post&quot; id=&quot;post-<?php the_ID(); ?>&quot;>
    global $query_string;
    $query_args = explode(&quot;&&quot;, $query_string);
    $search_query = array();
    foreach($query_args as $key => $string) {
    	$query_split = explode(&quot;=&quot;, $string);
    	$search_query[$query_split[0]] = urldecode($query_split[1]);
    } // foreach
    $search = new WP_Query($search_query);
    <div class=&quot;post-meta&quot;>
    <div class=&quot;post-info&quot;  style=&quot;width:600px;&quot;>
    <?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
    <h1 class=&quot;post-title&quot;><a href=&quot;<?php the_permalink() ?>&quot; rel=&quot;bookmark&quot; title=&quot;<?php _e('permalink to', TEMPLATE_DOMAIN); ?> <?php the_title(); ?>&quot;><?php the_title(); ?></a></h1>
    <?php $post_meta_status = get_option('tn_buddysocial_post_meta_status'); if($post_meta_status != 'disable') { ?>
    <p><?php the_time( 'F j, Y', TEMPLATE_DOMAIN ); ?><?php the_excerpt(); ?> <br />&nbsp;&nbsp;&nbsp;<?php edit_post_link(__('edit', TEMPLATE_DOMAIN), '', ''); ?></p>
    <?php } ?>
    <div class=&quot;post-content&quot;>
    <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    <?php endwhile; ?>

    If you're trying to do something like this, you'll prob need a few less closing divs, as I have been rather creative with this theme, but you'll get the idea.

    I added just a touch of css to the 'custom.css' page to add a border to the thumbnails,

    #custom .wp-post-image {
    	border:1px solid #CCC;

    This gave me search results for both products and pages that work correctly and has the layout I seek.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.