• Resolved klav

    (@klav)


    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

    (@mores)

    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

    (@klav)

    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.