TAILIEUCHUNG - Tìm Hiểu về Wordpress - part 13

Tham khảo tài liệu 'tìm hiểu về wordpress - part 13', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | a href php echo get_permalink comment- comment_post_ID . comment- . comment- comment_ID php echo dp_get_author comment a php echo strip_tags substr apply_filters get_ comment_text comment- comment_content 0 comment_len li php ob_end_flush else echo li No Comments li function dp_get_author comment author if empty comment- comment_author author Anonymous else author comment- comment_author return author To use this function simply call it from anywhere in your theme php dp_recent_comments 6 Displaying Recent Posts Lets do this again from easiest to hardest. Widget - The easiest possible way to do this is through a widgetized sidebar. 107 Resetting The query string is set when any page in WordPress is loaded. You can override it by doing you own query_posts but then that original query string is destroyed. You can restore it with this wp_reset_query Just like recent comments there is a built-in Recent Posts widget which will do the trick. Just drag it into your sidebar zone and save it. Function - We don t have to write a custom function this time we can just use the wp_get_archives function which we already looked at a little. A simple function like this will display linked titles to recent posts php wp_get_archives type postbypost limit 5 Custom Loop - Finally we could go totally home-brew and just write a custom loop to display recent posts. This offers by far the most control as we can do anything inside this loop including accessing the full content or custom fields. php query_posts posts_per_page 10 what_to_show posts orderby date if have_posts while have_posts the_post output custom stuff here Post title content custom fields. endwhile else message if nothing found endif wp_reset_query . Listing Popular Posts Popularity is more loosely defined than something like recent. How do you define popularity Page views Number of comments Back links If you want to accommodate all the above try the WordPress Popular Posts plugin which is available at http .

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.