Viewing 7 replies - 1 through 7 (of 7 total)
  • I don’t see the include that you are talking about, but you should check out the Template sHierarchy. You will notice that index.php will be used for just about any request if another template PHP file is not present.

    If you don’t want to add the individual template files, then you could use the various is_xxxx() functions to check and see what is being viewed and do special processing for each.

    Conditional_Tags – is_home

    Thread Starter plaidgirl

    (@plaidgirl)

    Sorry. I was testing some things out. The include is in there now. It show up on the main page and the pages for individual posts. Is there any way to fix it so it only shows up on the home page?

    And did you read the Codex page I sent to you to???

    Thread Starter plaidgirl

    (@plaidgirl)

    Yes, I did. But I don’t know what to do with the codes on that page. Right now my index.php has this code:

    <?php get_header(); ?>
    <?php include(“lori.php”); ?>
    <?php include (TEMPLATEPATH . ‘/articles.php’); ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I’m guessing the “is_home()” code might help. But I don’t know how or where to add it. Is that right?

    <?php if (is_home()) include(TEMPLATEPATH.'/articles.php');?>

    Thread Starter plaidgirl

    (@plaidgirl)

    You are awesome! I think that worked!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add include to index.php page only’ is closed to new replies.