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

  • Use Markdown, and it will escape the code for you, like `<div class="cool">`.
  • Use triple-backticks for blocks of code.
      <h1>multi-line block of code</h1>
      <span>be cool yo.</span>
  • Otherwise, escape your code, like <code>&lt;div class="cool"&gt;</code>. Markdown is just easier though.

Current ye@r *

*May or may not contain any actual "CSS" or "Tricks".