Sorry my PHP skills are lacking.
I want to use a php include in WP but I’d like to get the file path with <?php get_template_directory(); ?>
I can’t figure out how that would look.
My non WP file looks like this:
<?php include 'inc/social.php'; ?>
Basically I don’t know how to string two PHP commands together get_template_directory
+ include.
get_template_directory()
andget_stylesheet_directory()
both pull form thewp-content/themes
directory. The difference being that the former always pulls from the parent theme directory.Neither take parameters, so you just concatenate the rest of the path to the string returned from the appropriate function. That is:
If your file is not in your theme directory, you cannot use those functions. They are very specifically theme functions.