Hiển thị toàn bộ các bài viết có cùng taxonomy
https://levantoan.com/wordpress-list-posts-by-taxonomy/
Hiển thị toàn bộ các bài viết có cùng taxonomy
Cập nhật lần cuối 17/03/2017 by Mr Toản trong WordPress vào 18/03/2014 có 2511 ViewsCó thể bạn quan tâm
Code này tuy ngắn ngọn nhưng rất hữu ích cho các bạn viết web với wordpress. Đoạn code sau giúp cho bạn hiển thị toàn bộ các bài viết cùng taxonomy.
Ví dụ như sau. Mình có post_type là sanpham và có taxonomy là mau_san_pham. Khi bạn muốn hiển thị các sản phẩm có cùng mầu đỏ thì bạn làm thế nào? đại loại là thế hi
Đoạn code này sẽ giúp bạn …
Và chèn đoạn code sau vào nơi mà bạn muốn hiển thị
1 |
|
Tham khảo tại: http://gilbert.pellegrom.me/wordpress-list-posts-by-taxonomy/
PreviousHiển thị tất cả category của custom post type | get the termsNextHiển thị tất cả các bài đăng trong một loại bài tùy chỉnh, được nhóm theo phân loại tùy chỉnh
Last updated