WordPress Theme Creation Tutorial 9: Article form

Source: Internet
Author: User

WordPress Article form:

Aside-----------------log: Standard article with no title displayed
Image--------------Images: Single image. The first tag in the article will be considered as the image.

Video---------------Videos: Single video.

Quote-----------------Quote: Quote another word.

Link-----------------Links: links to other websites.

Gallery---------------Album: Image showroom.

Status--------------state: A short update, typically up to 140 characters. Similar to Weibo
Audio----------------: An audio file
Chat------------------Chats: Chat History

If you want to add support for these forms, add the type aliases for the above list in the functions.php corresponding array

Array (' aside ', ' image ', ' video ', ' quote ', ' link ', ' Gallery ', ' status ', ' Audio ', ' chat ');

How can different types of articles be displayed in different styles? Integrate article styles to output different formats in single.php by Has_post_format judging the type of the article:

<?phpif(Has_post_format (' status ')) {//Status?>State Style<?php}Else if(Has_post_format (' aside ')) {//Log?>Log Style<?php}Else if(Has_post_format (' gallery ')) {//album?>album Style<?php}Else if(Has_post_format (' video ')) {//Video?>Video Style<?php}Else if(Has_post_format (' Audio ')) {//Music?>music Style
//....<?php}Else{//Standard?>General Style<?php}?>

Add article Type plugin: Custom Post type UI

WordPress Theme Creation Tutorial 9: Article form

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.