get parent theme file path, get child theme file path (ok) get_template_directory_uri

get_parent_theme_file_path( '/images/svg-icons.svg' );
// '/home/admin/domains/nhungspa.com.vn/public_html/tpcn/wp-content/themes/yootheme/images/svg-icons.svg'
get_theme_file_path('/images/svg-icons.svg');
// '/home/admin/domains/nhungspa.com.vn/public_html/tpcn/wp-content/themes/yoo1/images/svg-icons.svg'
Hoặc
echo get_stylesheet_directory();
C:\xampp\htdocs\arcadia-multisite/wp-content/themes/genesis-sample
get_template_directory();
"/home/admin/domains/nhungspa.com.vn/public_html/tpcn/wp-content/themes/yootheme"
get_template_directory_uri();
'https://tpcn.nhungspa.com.vn/wp-content/themes/yootheme'
echo get_stylesheet_directory_uri();
'https://tpcn.nhungspa.com.vn/wp-content/themes/yoo1'
echo get_stylesheet_directory_uri();
http://localhost/reset/wp-content/themes/genesis-sample
if (!defined('LEARNDASH_LMS_LIBRARY_DIR')) {
	/**
	 * Define LearnDash LMS - Set the plugin includes/lib path.
	 *
	 * Will be set based on the LearnDash define `LEARNDASH_LMS_PLUGIN_DIR`.
	 *
	 * @since 2.1.4
	 * @uses LEARNDASH_LMS_PLUGIN_DIR
	 *
	 * @var string $value Directory path to plugin includes/lib internal directory.
	 */
	// define( 'LEARNDASH_LMS_LIBRARY_DIR', trailingslashit_ct( get_stylesheet_directory_uri() ) . 'includes/lib' );
	define('LEARNDASH_LMS_LIBRARY_DIR', ABSPATH . 'wp-content' . DIRECTORY_SEPARATOR . 'themes'  . DIRECTORY_SEPARATOR . 'kadence-child' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'lib');
};

58

It's almost the same functions:

Add a comment8

For Retrieve Theme stylesheet directory URL:

get_theme_file_uri() oR 
get_stylesheet_directory_uri()

For Retrieve Absolute File Paths:

get_stylesheet_directory() oR 
get_theme_file_uri()

Last updated