Cho mình hỏi, mình đang sử dụng code Get_template_directory_uri trong function.php của themes child mà nó toàn lấy đường dẫn của url gốc, mà nó không lấy các url folder của themes child !! bạn nào biết vì sao không? mình đang gọi nó trong themes child mà nó lại toàn ra themes gốc. Cảm ơn
Ah bạn ơi, bạn sử dụng get_stylesheet_directory_uri để gọi đường dẫn themes child nhé. get_template_directory_uri: dùng để gọi cho themes gốc. get_stylesheet_directory_uri: dùng để gọi cho themes child bạn nhé. Bạn có thể tìm thấy các hàm này gọi ở wp-includes/default-constants.php Mã: //get_template_directory() define('TEMPLATEPATH', get_template_directory()); ... //get_stylesheet_directory_uri() define('STYLESHEETPATH', get_stylesheet_directory()); Khi không tìm thấy child themes nó sẽ trả về đường dẫn url folder gốc nhé.