ที่จะทำให้เรื่องยาวสั้น: get_bloginfo( 'template_directory' )และก็กลับget_bloginfo( 'template_url' )get_template_directory_uri()
ดังนั้นคุณสามารถช็อตคัตการโทรครั้งที่สองได้ง่ายๆโดยอ้างอิงโดยตรงกับแท็กเทมเพลตหลัง
get_bloginfo()อ้างถึงแหล่งที่มาของ
อื่น ๆ ไม่กี่:
'url' => home_url()
'wpurl' => site_url()
'stylesheet_url' => get_stylesheet_uri()
'stylesheet_directory' => get_stylesheet_directory_uri()
'locale' => get_locale()
แก้ไข
หมายเหตุด้วย: TEMPLATEPATHและSTYLESHEETPATHมีกำหนดสำหรับการคัดค้านดังนั้นคุณจะดีขึ้นเพียงแทนที่พวกเขาตอนนี้ด้วยget_template_directory()และget_stylesheet_directory()ตามลำดับ
แก้ไข 2
เรื่องความคิดเห็นนี้
สิ่งที่ฉันกำลังจะบอกว่า :) ฉันจะเพิ่มที่get_template_directory()คืนค่าเส้นทางและget_template_directory_uri()URL ดังนั้นผู้เขียนจึงไม่สอดคล้องกัน: get_bloginfo( 'template_directory' )และget_template_directory()คืนสิ่งต่าง ๆ !
อ้างอิงกลับไปแหล่งที่มา :)
case 'template_directory':
case 'template_url':
$output = get_template_directory_uri();
break;
เรื่องความคิดเห็นนี้:
ข้อแม้หนึ่งเมื่อพัฒนาชุดรูปแบบเด็กคุณจะต้องใช้get_stylesheet_directory()อย่างชัดเจน มีคนแก้ไขฉันถ้าฉันผิด
จริง แต่มันก็เป็นอย่างนั้นเสมอ get_bloginfo()ไม่กลับอะไรget_stylesheet_directory()ที่เกี่ยวข้องกับ มันเพียง แต่ผลตอบแทนและget_stylesheet_uri()get_stylesheet_directory_uri()