Use WordPress custom column to label the article source

Source: Internet
Author: User
Keywords WordPress

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

If using WordPress to do information site will usually involve submitting or reprint other site articles, we need to mark the source of the article. Because the appearance of the page, is generally in the article under the title of the text indicated. The specific method can use WordPress custom column.

1. In the WordPress background writing article page in the upper right corner, click the following figure "Display Options", in the Pull out menu "custom column" option to tick.

  

2. The "Custom column" Edit menu is added below the article edit box. Fill in the name with "author" (Other English is also OK). Fill in the author's name in the value.

  

3. Next in the article page this value. In single.php, under the heading corresponding code, add:

< php echo Get_post_meta ($post->id, "author", true);? >

If the previous article does not have this option, we can make a judgment:

< php $author = Get_post_meta ($post->id, ' author ', true); if ($author) {echo "$author";} else echo "micro-interest"? >

When there is no corresponding value, the direct output "micro-interest bar." The effect is as follows:

  

This article author: micro-letter Interesting bar: http://www.vxin78.com/reprint Please specify!

Related Article

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.