Có phải bạn muốn thiết kế website tiết kiệm chi phí và thời gian mà còn chuẩn seo ?

12/7/13

Viết shortcode trong wordpress

Yêu cầu: Kết nối cơ sở dữ liệu, hiện danh sách dữ liệu lên site

Chuẩn bị:

Cài wordpress

Tạo bảng wp_hocsinh



Nhập dữ liệu.

B1: Tạo cấu trúc cho plugin như sau:



B2: Mở wp-content/plugins/quanlyhocsinh/index.php, gõ code sau:



Lưu ý: QuanLyHocSinh là tên plugin đang thiết kế

B3: Vào trang quản trị WordPress, chọn Plugins/Installed Plugins



- Click “Activate” plugin QuanLyHocSinh

B4: Mở file wp-content/plugins/quanlyhocsinh/index.php, viết code cho plugin





B5: Trang quản trị wordpress, chọn Pages, click “Add New”



- Nhập nội dung Page dạng shortcode



Xem kết quả:


0 comments:

Post a Comment