TODO: To change the header's content go to Dr.Explain menu Options : Project Settings : HTML (CHM) Export : Setup HTML Template and Layout
×
Menu
Index

Nav Menu Custom fields

Tạo custom field cho nav menu.
 
Bạn tải file mẫu, tạo custom fields cho nav menu tại đây:
 
Tên trường bạn thiết lập trong file ‘menu-item-custom-fields-example.php’, ví dụ ta có field ‘menu-item-field-01′.
Dữ liệu Nav menu chứa trong bảng wp_posts do đó chúng ta có thể lấy custom field bởi hàm get_post_meta().
$field01 = get_post_meta( $item_id, 'menu-item-field-01', true );
$custom=get_post_custom($item_id);
if(isset($custom['menu-item-field-01'])) echo $custom['menu-item-field-01'][0];
 
 
Made with help of Dr.Explain

Unregistered version