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

Các tác giả và biên tập viên của bất kỳ nguồn tin tức có uy tín được gần như là quan trọng như nội dung mà họ viết. Thông thường, người đọc thử để xác định với những tác giả có tài liệu mà họ thích, và sẽ hút đối với công trình tương lai của họ. Như vậy, nó là rất quan trọng mà bất kỳ, nghiêm trọng tác giả nhiều trang web chạy trên WordPress nên cố gắng kết hợp màn hình hiển thị của dữ liệu tác giả (như tên của họ, thông tin cơ bản về. | 9 Showing Author Information In this chapter we will cover Getting author data via an author s ID Dynamically displaying the author s name and linked e-mail address Listing all of the published authors on a site Listing the authors who most recently published a post Listing authors by the total number of comments that their posts have received Adding a custom user field to display an author s Twitter link Introduction The authors and editors of any reputable news source are almost as important as the content that they write. Often readers try to identify with the authors whose material they like and will gravitate towards their future works. As such it is very important that any serious multi-author site run on WordPress should try to incorporate the display of author data such as their name biographical background information posts or other blogs they participate in and so on in an interesting and useful way for the user. In this chapter we are going to examine how you get at that data and the different ways in which you might use it. Showing Author Information Getting author data via an author s ID An author ID is the unique numeric identifier for any user on a WordPress site. The first user created on a new WordPress site generally has an ID with a value of 1. Although it is rare that you ll have a numeric user ID without direct programmatic input you can use this technique when defining custom template tags. We re going to create a custom function that prints a user s username and their e-mail address. Getting started You will need a theme that already has an file created such as Sandbox from or you can create your own basic theme file by adding the code provided in this recipe. How to do it. First open or create your theme s file. Place your cursor at the beginning of the file and then insert the following code p b Our guest author this week b php user_info get_userdata 2 echo user_info- user_nicename .

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.