title: Get Current Page Title and Id after post loop
body: <p>I am trying to get my current page id and title for reference but before I output them I override the global $post in my header.</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;?php 
      global $post;
      $current_page_id = $post-&gt;ID;
      echo $current_page_id;
  ?&gt;
  </code></pre>
  
  <p>This is my header code:</p>
  
  <pre><code>&lt;div id="slider" class="nivoSlider"&gt;
      &lt;?php
          $slides = get_posts( array( 'post_type' =&gt; 'slide' ) );
          foreach( $slides as $post ): setup_postdata( $post );
              $slide_url = get_slide_url();
              $slide_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), "slide" );
              ?&gt;&lt;a href="&lt;?php echo $slide_url; ?&gt;" title="&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;img src="&lt;?php echo $slide_thumbnail[0]; ?&gt;" /&gt;&lt;/a&gt;&lt;?php
          endforeach;
      ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It returns the last used post but I want my current page post.</p>
  
  <p>I have created a custom meta box for post type product to select a page to display on. I am trying to get posts of type product and of the current page id to output onto the screen.</p>
  
  <p>Thanks</p>