title: the_permalink(); not working
body: <p>Ok, I'm going crazy over the_permalink() function. This is not going to be easy to explain the issue, but I will try. When I'm on the index page of my website(index.php), and when I click on a link that's in the footer section, it will take me to the recent post (single.php), and that is fine. However, when I start off on the index page(index.php), and when I use the navigation bar to navigate to a certain page(page.php)(which has the same layout as the index.php), and then, when I click the same link that's in the footer section it should take me to the recent post (single.php), but it is not. It's taking me to the current page(page.php) instead of single.php. Here is a snippet of my code:</p>
  
  <p>The footer:</p>
  
  <pre><code>   &lt;div id="clear"&gt;&lt;/div&gt;
  
          &lt;div id="video"&gt;
              &lt;!--&lt;a href="http://www.youtube.com/watch?v=WYc4ZOxRX-4" target="_blank"&gt;&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/video_03.png" alt="Video" border="0" width="263" height="193" title="Video" /&gt;&lt;/a&gt;--&gt;
              &lt;iframe width="263" height="208" src="http://www.youtube.com/embed/WYc4ZOxRX-4?rel=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
          &lt;/div&gt;&lt;!-- end of video --&gt;
  
          &lt;div id="weeklyadbox"&gt;
              &lt;p id="content"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/weeklyad.jpg" height="147" width="178" alt="Weekly Specials" border="0" title="Click to See Our Weekly Specials" /&gt;&lt;/a&gt;&lt;/p&gt;
          &lt;/div&gt;&lt;!-- end of weeklyadbox --&gt;
  
  
          &lt;div id="weathericon"&gt;
              &lt;a href="&lt;?php bloginfo("url"); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/icons_03.png" border="0" alt="Weather Icon" title="See Weather" height="96" width="83" /&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div id="directionsicon"&gt;
              &lt;a href="&lt;?php bloginfo("url"); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/icons_04.png" border="0" alt="Directions Icon" title="Get Directions" height="94" width="96" /&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div id="webcamicon"&gt;
              &lt;a href="&lt;?php bloginfo("url"); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/icons_05.png" border="0" alt="Web Cam Icon" title="Web Cam" height="96" width="84" /&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;/div&gt;&lt;!-- end of container --&gt; 
  
          &lt;div id="footer"&gt;
          &amp;copy;&lt;?php echo date("Y"); echo " "; bloginfo('name'); ?&gt;
           &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;?php wp_footer(); ?&gt;
  </code></pre>
  
  <p>The_permalink() is fine when I'm in the index section, but not when I'm on a different page. I tried using echo get_permalink(53), and it worked, but what happens when a client goes in the dashboard and creates a new post? The new post will have a different post ID, and that link will not point out to the new post, but will point out to the old post that has an ID equals to 53.</p>
  
  <p>If you need to see other code, please let me know! </p>
  
  <p>Any advice? Thank you for your help!</p>