Title: Page ID problem
Last modified: August 19, 2016

---

# Page ID problem

 *  Resolved [ashmann](https://wordpress.org/support/users/ashmann/)
 * (@ashmann)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/page-id-problem/)
 * This has had me tearing my hair out for the last 2 days, I’m creating a (partially)
   dynamic footer element, basically there are 3 different events, each has it’s
   own set of sponsors and accompanying logos that i want to display on the relevant
   event page’s footer.
 * now I’ve set up the following (pretty ugly I know:
 *     ```
       if (  is_page('230')  || $post->post_parent == '230' ) {
       echo "some things";
   
       } elseif ( is_page('20') || $post->post_parent == '34' ) {
       echo "some more things";
   
       } elseif ( is_page('122') || $post->post_parent == '39' ) {
       echo "some other stuff";
   
       } else {
       echo "blah blah blah";
       }
       ?>
       ```
   
 * The problem is that on each of the ‘main’ event pages the relevant footer element
   isn’t showing, they show the ‘else’ element. The weird thing is that each of 
   the children pages of the events are showing the correct footer element for ‘
   their’ event.
 * To complicate the issue the page ID that I am getting via the admin pages for
   the ‘parent’ event pages is different from that produced by printing the_ID()–
   but still neither the admin ID or the ID printed by the_ID() forces the event
   pages to show the correct footer element.
 * And the last little bit of weirdness is that each ‘parent’ event page has its
   own template file, so I thought to circumvent the page ID weirdness i’d just 
   use `if (is_page_template('whatever-page-template.php')` but that doesn’t work
   either.
 * It seems for some reason that these ‘parent’ event pages aren’t recognising themselves
   properly.
 * Does anyone have any idea what might be causing this, I’m at a complete loss?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/page-id-problem/#post-1702996)
 * > To complicate the issue the page ID that I am getting via the admin pages for
   > the ‘parent’ event pages is different from that produced by printing the_ID()
 * that points to the possibility that the original query string got disturbed by
   something before you do your footer tests –
    try to add a ‘wp_reset_query();’
   before the first line of your if-statements.
 * [http://codex.wordpress.org/Function_Reference/wp_reset_query](http://codex.wordpress.org/Function_Reference/wp_reset_query)
 *  Thread Starter [ashmann](https://wordpress.org/support/users/ashmann/)
 * (@ashmann)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/page-id-problem/#post-1703005)
 * hallelujah, problem solved.
    thanks so much, hugely appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Page ID problem’ is closed to new replies.

## Tags

 * [Page ID](https://wordpress.org/support/topic-tag/page-id/)

 * 2 replies
 * 2 participants
 * Last reply from: [ashmann](https://wordpress.org/support/users/ashmann/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/page-id-problem/#post-1703005)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
