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

Tạo một mẫu phương tiện truyền thông Mặc dù hình ảnh trực tuyến và các phương tiện khác có thể là tuyệt vời trong một số trường hợp, đôi khi bạn thực sự muốn có thể để làm nổi bật tầm quan trọng của tập tin đính kèm bằng cách đặt các mục trên trang riêng của mình và liên kết với nó. | Chapter 8 results in the following HTML div class wp-caption alignnone style width 310px img src http wp-content uploads 2009 10 Tulips2-300x225. jpg alt Test Caption title Tulips width 300 height 225 class size-medium wp-image-105 p class wp-caption-text Test Caption p div Here the pertinent classes to style are wp-caption wp-caption-text Both of them are styled in this recipe s instructions. See also Aligning images properly within a post Creating a media template Although in-line images and other media can be great in some circumstances sometimes you really want to be able to highlight the importance of an attachment by placing the item on its own page and linking to it. Luckily WordPress has support for attachment templates allowing you to emphasize attachments appropriately. Getting started The only requirement for this recipe is that you are working on a modern WordPress theme that works with WordPress or . How to do it. First we need to create the attachment template. The basic attachment template that we are going to create must be called . This template will be used to serve all attachment links. Open and insert the following template code html head title php the_title title head body 165 Integrating Media------------------------------------------------------------ php meta wp_get_attachment_metadata post- ID size medium div style margin 0 auto width php echo meta sizes size width 20 text-align left padding 10px border 5px solid 000 php echo wp_get_attachment_link post- ID size div body html Save the file and upload it to your current theme folder. You can see what the uploaded image would look like by viewing the screenshot below How it works. The above example effectively highlights the attachment image by surrounding it with a simple bordered div and aligning it to the left within the browser window. Here the medium version of the image is used and the full version is linked to directly so that users can .

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.