Treehouse: Grow your CSS skills. Land your dream job.

Last updated on:

Include Any File From Your Theme

<?php include (TEMPLATEPATH . '/your-file.php'); ?>


  1. Guy Haines
    Permalink to comment#

    Thanks Dude.

  2. stefan zimmermann
    Permalink to comment#

    awesome site for someone who hates learning to suck

  3. If your trying to include another file in (.php file) for your theme, then use get_template_part(), which looks like:

    <?php get\_template\_part( 'content' ); ?>

    It has an optional second paramater too which you can use to include something like: content-post.php by using:

    <?php get\_template\_part( 'content', 'post' ); ?>

    Read More:

    • You don’t need the backslashes, the “comment preview” didn’t like my underscores unless they had backslashes, and now its screwed up the actual comment.. -.-

Leave a Comment

Posting Code

Markdown is supported in the comment area, so you can write inline code in backticks like `this` or multiline blocks of code in in triple backtick fences like this:

<div>Example code</div>