Title: Include not working from index.php
Last modified: August 19, 2016

---

# Include not working from index.php

 *  Resolved [klav](https://wordpress.org/support/users/klav/)
 * (@klav)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/include-not-working-from-indexphp/)
 * Hi all,
 * I am trying to use an include on the index.php for a certain page but it’s not
   working. Here’s what i am using.
 * `<?php if ( is_page('news') ) { include ('navigation_news.php'); } ?>`
 * Nothing shows up with that. But if i use is_home() it works just fine.
 * Any ideas? Thanks a bunch

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

 *  [mores](https://wordpress.org/support/users/mores/)
 * (@mores)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/include-not-working-from-indexphp/#post-703225)
 * DId you check the spelling of “news” ? Maybe the slug is called “News” with a
   capital “N” ?
 * Then again, I seem to have a bit of info in the back of my brain, that you can’t
   conditionalize an include.
 *  Thread Starter [klav](https://wordpress.org/support/users/klav/)
 * (@klav)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/include-not-working-from-indexphp/#post-703226)
 * thanks for your reply. I just got it but it’s a really ODD solution. Here’s what
   i had to do.
 * On index.php I included “global_navigation,” with
    `<? include ("global_navigation.
   php"); ?>`
 * then inside global_navigation i included another with:
 * `<?php if ( is_page('news') ) { include 'navigation_news.php'; } ?>`
 * Now it can see ‘news’ very weird no?

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

The topic ‘Include not working from index.php’ is closed to new replies.

## Tags

 * [index.php](https://wordpress.org/support/topic-tag/index-php/)
 * [is_page](https://wordpress.org/support/topic-tag/is_page/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [klav](https://wordpress.org/support/users/klav/)
 * Last activity: [18 years, 3 months ago](https://wordpress.org/support/topic/include-not-working-from-indexphp/#post-703226)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
