TAILIEUCHUNG - Hướng dẫn tạo themes cho wordpress part 8

Các next_posts_link và previous_posts_link chức năng từng in một liên kết cho phép người dùng điều hướng qua các tài liệu lưu trữ của một trang web. Thật thú vị, điều hướng previous_posts_link chuyển tiếp thông qua bài viết thứ tự thời gian, trong khi next_posts_link điều hướng lạc hậu thông qua bài viết thứ tự thời gian. | Chapter 4 How it works. The next_posts_link and previous_posts_link functions each print a link that allows users to navigate through the archives of a site. Interestingly previous_posts_link navigates forward through posts chronologically whereas next_posts_link navigates backward through posts chronologically. While this is counterintuitive to many people it has yet to be changed and probably won t be due to concerns over legacy themes. In addition the lone parameter to these functions allows you to customize the text that is displayed with the link. Simply change the parameter value to change the links text in your theme. There s more. Archive navigation isn t just for big loops with multiple posts. Single pages can be navigated through similarly by using functions named almost exactly the same. In or insert the following wherever you want navigation links to appear div class navigation div php previous_post_link laquo link div div php next_post_link link raquo div div Displaying an edit link for posts After you publish a post you ll often want to go back and update facts as more becomes available on a developing story or to correct spelling and grammar errors that you ve noticed after reading through it. Rather than force your theme s users to log in and search to find the post to edit you can provide a link to the editing page directly in your theme. How to do it. Open a template file where you are displaying posts in the The Loop. Decide where you want the edit link to appear. It can appear anywhere inside The Loop. Place your cursor at that point and insert the following code php edit_post_link Edit this entry . How it works. The edit_post_link function detects the currently logged in user s role and capabilities. If the user is logged in and he or she has the ability to modify the post that is currently being displayed then the Edit link appears. Template Tags-------------------------------------------------------------------------- .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.