Grow your CSS skills. Land your dream job.

Last updated on:

Include Any File From Your Theme

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

Comments

  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:
    http://codex.wordpress.org/Function_Reference/get_template_part

    • 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

Current day month ye@r *

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