title: Wordpress how to retrieve the post id once it's been reset in the page
body: <p>I'm working with a script in which the postid of the page has been reset via a script include. How can I retrieve the actual true post id and reset its value once it has been changed via script?</p>
  
  <p>Here is the script that I'm referring to. Somewhere in there, the postid is being reset so that the page's the_content() call is no longer pulling the current page being viewed.</p>
  
  <p>I'm Ok with that, since that's what the script needs, however, I need to reset it back once this script has done its thing.</p>
  
  <pre><code>                &lt;?php 
  
                      //$featpages = get_option('woo_slider_pages_landing');
                      $featpages = '579,584,537';
                      $featarr=split(",",$featpages);
                      $featarr = array_diff($featarr, array(""));
  
                      $i = 1;
  
                      foreach ( $featarr as $featured_tab ) {
  
                       query_posts('page_id=' . $featured_tab); while (have_posts()) : the_post();    
  
                  ?&gt;      
  
              &lt;div class="featured-slide" id="slide-&lt;?php echo $i; $i++; ?&gt;" &lt;?php if($i &gt;=3 ){echo 'style="display:none"';} ?&gt;&gt;
  
                  &lt;div class="text"&gt;
  
                      &lt;h2&gt;&lt;?php if ( get_post_meta($post-&gt;ID, "page_desc", $single = true) &lt;&gt; "" ) { echo get_post_meta($post-&gt;ID, "page_desc", $single = true); } else { the_title(); } ?&gt;&lt;/h2&gt;
  
                      &lt;p&gt;&lt;?php if ( get_post_meta($post-&gt;ID, "page_excerpt", $single = true) &lt;&gt; "" ) { echo get_post_meta($post-&gt;ID, "page_excerpt", $single = true); } else { the_excerpt(); } ?&gt;&lt;/p&gt;
  
                          &lt;?php if ( get_post_meta($post-&gt;ID, "link_text", $single = true) &lt;&gt; "" and get_post_meta($post-&gt;ID, "link_link", $single = true) &lt;&gt; "" ) { ?&gt;
  
                          &lt;p&gt;&lt;a href="&lt;?php echo get_post_meta($post-&gt;ID, "link_link", $single = true); ?&gt;" title="&lt;?php echo get_post_meta($post-&gt;ID, "link_text", $single = true); ?&gt;"&gt;&lt;?php echo get_post_meta($post-&gt;ID, "link_text", $single = true); ?&gt;&lt;/a&gt;&lt;/p&gt;
  
                          &lt;?php } ?&gt;                                  
  
                  &lt;/div&gt;&lt;!-- /.text --&gt;
  
                  &lt;?php if ( get_post_meta($post-&gt;ID, "image", $single = true) &lt;&gt; "" ) { ?&gt;
  
                  &lt;div class="image"&gt;
  
                      &lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, "image", $single = true); ?&gt;" alt="&lt;?php the_title(); ?&gt;" class="featured" /&gt;
  
                  &lt;/div&gt;&lt;!-- /.image --&gt;
  
                  &lt;?php } ?&gt;
  
              &lt;/div&gt;&lt;!-- /.featured-slide --&gt;
  
              &lt;?php endwhile; } //endforeach ?&gt;
  </code></pre>