I’m trying to figure out the difference between these. TEMPLATEPATH doesn’t have its own Codex page, as far as I can tell, but I did find a mention of it on the load_theme_textdomain() page. The page has a very peculiar set of examples, one using TEMPLATEPATH and the other using get_template_directory().
Ex 1: get_template_directory()
load_theme_textdomain('my_theme', get_template_directory() . '/languages');
Ex 2: TEMPLATEPATH
load_theme_textdomain( 'my_theme', TEMPLATEPATH . '/languages' );
So… if two calls return the same path, what is the difference? I’ve read a couple posts from Google hinting at a possible connection to child theme/main theme relationships. Should I use one in main themes and another in child themes? What are the best practices?
- The topic ‘TEMPLATEPATH vs get_template_directory(): What is the difference?’ is closed to new replies.