Danh mục

thiết kế giao diện wordpress phần 5

Số trang: 18      Loại file: pdf      Dung lượng: 2.20 MB      Lượt xem: 10      Lượt tải: 0    
Thư viện của tui

Hỗ trợ phí lưu trữ khi tải xuống: 13,000 VND Tải xuống file đầy đủ (18 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Tham khảo tài liệu thiết kế giao diện wordpress phần 5, 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ả
Nội dung trích xuất từ tài liệu:
thiết kế giao diện wordpress phần 5 Chapter 3 Category Links (with how many posts per category): This displays your • categories using the wp_list_categories template tag. A BlogRoll set of links: This list is controlled by the wp_list_bookmarks() • template tag which displays bookmarks found in the Administration | Blogroll | Manage Blogroll panel. A set of Meta links (links to info about the site): These links are hand-coded • into the sidebar.php page in the default template.Generally, the above works out great for a more standard blog. But as discussed,I would like my page links to display horizontally up top of my sidebar, and Iwant my theme to display a vertical sidebar that looks more like the contents pageof a magazine. [ 75 ]Coding It UpTime For Action: 1. To start, Ill be treating my archives as Past Issues. So showing the month and year will be just fine. Under my Past Issues heading Ill add the following code which will display my archive links wrapped in unordered list elements: Formatting tip: Youll see Ive wrapped each bit of PHP and its template tag in (unordered list XHTML markup). WordPress will automatically return each item wrapped in (list item tags). Adding the unordered list tags (or ordered list tags if you want.) ensures I have a valid list that is easy for me to customize with my CSS. XHTML comments: Youll also note that Im wrapping most of my WordPress code in XHTML comment tags. I do this so that scanning the markup is easier for myself and any other developer who comes across the code (a nice idea for those of you who are looking forward to creating commercial themes to make a little money; the more clear your markup, the less time youll spend helping purchasers troubleshoot your theme). Also, indicating where WordPress code starts and ends as well as what kind of code it is, will also come in very handy when we get ready to break the code out into template pages, reducing the chance of possible cut-and-paste errors that can occur. 2. Next, my Columns are really just a list of my categories. The default sidebar lists the title as Categories, but as I have my own special header hand-coded into the side bar, Ive removed the following: &title_li=CategoriesI have changed it to this: &title_li=It gives me the code under my Columns header that looks like this: [ 76 ] Chapter 3 3. Next, my Features will require a little bit of finessing. I would like WordPress to display the most recent five posts that are only in the Features category. There are a few clean template tags that will display the most recent post titles, but they dont seem to let me limit the posts to just coming from my Features category.Because I understand a little PHP, Ill include a small custom loop which will usethree WordPress template tags to call in the post information for the last five posts incategory 3 (which is my Features category), then just display the perma link for eachpost and its title.Again, as long as you recognize what the template tags look like and how topaste them into your theme template pages, you dont have to understand PHP orwrite any special scripts yourself. You can do a whole lot with just the existingtemplate tags.Understanding PHP and how to craft your own bits of code and loops will enableyou to have no limits on your themes capabilities. The following script has theWordPress template tags highlighted in it, so you can see how theyre used. Coding It Up 4. Last, I am ready for my page navigation. At the moment, my only static pages are About and Contact. Ill place the wp_list_pages template tag into my top_navlist div tags as follows: [ 78 ] Chapter 3Breaking It Up–Separating Your Theme IntoTemplate FilesAs I mentioned earlier, the advantage to having your WordPress themes partsseparated into individual template pages is that your theme will be more flexible andable to accommodate a wider range of content. As nice as my theme currently looks,there are some problems with it that ca ...

Tài liệu được xem nhiều: