Title: Problem with is_page
Last modified: August 18, 2016

---

# Problem with is_page

 *  [Kenn](https://wordpress.org/support/users/kenn/)
 * (@kenn)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/)
 * I’m been attempting to get the following chunk of code to work but it does not
   seem to. If I remove the “25” parameter from the is_page function, it works fine,
   but as soon as I enter any type of paramter (page ID, page-slug or page title)
   for any page, it simply falls through to the else option. Can someone advise 
   me on what I’m doing wrong here? Thanks!
 * `<h4><?php if (is_page('25')) { _e('Tracks:'); } else { _e('Links:'); } ?></h4
   >
    <ul class="mnav"> <?php if (is_page('25')) { wp_get_links('3'); } else { wp_get_links('
   1'); } ?> </ul>

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

 *  [maerk](https://wordpress.org/support/users/maerk/)
 * (@maerk)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417344)
 * Try `is_page(25)` maybe? — i.e. send the parameter as an integer, not a string.
 *  Thread Starter [Kenn](https://wordpress.org/support/users/kenn/)
 * (@kenn)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417561)
 * Nope…I tried it both with and without quotes on the ID number, as well as using
   page-slug and the page title (all of which are supposed to be acceptable parameters
   for this function.
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417562)
 * > _“as well as using page-slug and the page title (all of which are supposed 
   > to be acceptable parameters for this function”_
 * I may be wrong but I don’t think so. Only the page ID is a valid parameter. As
   for it not working – I thought you had to be in “the loop” for the code to work.
   Is that where you’re executing it?
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417591)
 * You’re wrong. ID, title, and slug are all acceptable inputs. See the is_page()
   function in functions.php, or just look at the codex: [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417597)
 * > _“You’re wrong. ID, title, and slug are all acceptable inputs.”_
 * Yes, you’re right – I was wrong. Having checked the code I can see that “post_title”
   and “post_name” will also work.
 * Thanks for the correction. It looks like you have to be in “the loop” for it 
   to work though.

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

The topic ‘Problem with is_page’ is closed to new replies.

 * 5 replies
 * 4 participants
 * Last reply from: [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * Last activity: [19 years, 10 months ago](https://wordpress.org/support/topic/problem-with-is_page/#post-417597)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
