title: Linking Wordpress index.php to single.php
body: <p>I'm working on a website that I initially coded from scratch, but am now integrating wordpress with it because my client wants a backend.</p>
  
  <p>Here's my problem, I'm using index.php for the main blog posts (which so far is working ok). But what I want to do is have just an excerpt of the posts (a brief summary) and then I want users to be able to click the 'read more' link in order to be taken a full page of that particular article/post (which I assume would be the single.php (if I'm not mistaken).</p>
  
  <p>So here we go, here is the code I have for the main blog page (ie index.php - I'm only including the php code that's relevant here not the whole page):</p>
  
  <pre><code>&lt;div id="content"&gt;              
  &lt;table cellpadding="0" cellspacing="0" border="0"&gt;
  &lt;tr&gt;
  &lt;td style="vertical-align: text-top; padding-right: 20px;"&gt;&lt;h1&gt;Blog&lt;/h1&gt;&lt;/td&gt;
  &lt;td style="vertical-align: text-top; padding-left: 20px;"&gt;
  &lt;h1&gt;Archives&lt;/h1&gt;
  &lt;select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;"&gt;
  &lt;option value=""&gt;&lt;?php echo esc_attr( __( 'Select Month' ) ); ?&gt;&lt;/option&gt;   
  &lt;?php wp_get_archives( 'type=monthly&amp;format=option&amp;show_post_count=1' ); ?&gt;
  &lt;/select&gt;
  &lt;/td&gt;
  &lt;tr&gt;
  &lt;td style="padding-right: 20px;"&gt;                   
  &lt;?php 
  $temp = $wp_query;
  $wp_query= null;
  $wp_query = new WP_Query();
  $wp_query-&gt;query('posts_per_page=5' . '&amp;paged=' . $paged);
  while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post();
  ?&gt;
  &lt;div style="background-color: #fff; margin-top: 0px; padding: 20px 20px 20px 20px; border-color: #819cc7; border-style: solid; border-width: thin;"&gt;
  &lt;h2&gt;&lt;a href="&lt;?php $permalink = get_permalink( $id ); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
  &lt;p&gt;&lt;?php the_post_thumbnail(); ?&gt;&lt;/p&gt;
  &lt;p&gt;&lt;?php the_content( $more_link_text , '' , $more_file ); ?&gt;&lt;/p&gt;
  &lt;p&gt;&lt;?php _e('Filed under&amp;#58;'); ?&gt; &lt;?php the_category(', ') ?&gt; &lt;?php _e('by'); ?&gt; &lt;?php the_author(); ?&gt;&lt;p&gt;
  &lt;p&gt;&lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt; &lt;?php edit_post_link('Edit', ' &amp;#124; ', ''); ?&gt;
  &lt;p&gt;Date posted: &lt;?php the_date(); ?&gt;&lt;/p&gt;
  &lt;!--Don't know if I need the two lines below 
  &lt;p&gt;&lt;?php //get_post_permalink(); ?&gt;&lt;/p&gt;
  --&gt;
  &lt;/div&gt;
  &lt;p&gt;&lt;?php endwhile; ?&gt;&lt;/p&gt;
  &lt;?php $wp_query = null; $wp_query = $temp; ?&gt;
  &lt;/td&gt;
  &lt;td style="padding-left: 20px;"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this is the code I have for my single.php page:</p>
  
  <pre><code>&lt;?php get_header(); ?&gt;
      &lt;section&gt;
          &lt;article id="white_bg"&gt;
              &lt;div class="content_border"&gt;
                  &lt;div id="content"&gt;
                  &lt;?php if(have_posts()) : ?&gt;&lt;?php while(have_posts()) : the_post(); ?&gt;
                  &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
                  &lt;p&gt;&lt;?php the_post_thumbnail(); ?&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;?php the_content(); ?&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;?php _e('Filed under&amp;#58;'); ?&gt; &lt;?php the_category(', ') ?&gt; &lt;?php _e('by'); ?&gt; &lt;?php  the_author(); ?&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt; &lt;?php edit_post_link('Edit', ' &amp;#124; ', ''); ?&gt;&lt;/p&gt;
                  &lt;br /&gt;
                  &lt;?php comments_template(); ?&gt;
                  &lt;?php endwhile; ?&gt;
                  &lt;div&gt;
                  &lt;?php previous_post_link('&lt; %link') ?&gt; &lt;?php next_post_link(' %link &gt;') ?&gt;
                  &lt;/div&gt;
                  &lt;?php endif; ?&gt;
              &lt;/div&gt;
              &lt;/div&gt;
          &lt;/article&gt;&lt;!--end main article--&gt;
      &lt;/section&gt;&lt;!--end main content section--&gt;
  &lt;?php get_footer(); ?&gt;    
  </code></pre>
  
  <p>I want people to be able to see the summarized article/post and click the read more link to be taken to single.php where they can view the full article/post and comment if they like.</p>