If you use Wordpress to build a website, you are no longer familiar with tags. There are also different views on the use of tags, mainly focused on two points: one is tend to block, the other is not blocked. The reason for tends to block is that as the number of articles increases, the number of tags increases, resulting in a bloated website. The reason for not blocking is that tags are conducive to the indexing of search engines. I think this tag should not be blocked. wordpress, as one of the most popular blog programs, naturally has a hidden location. Below I will give a list and comment on the current popular usage, and provide an advanced usage for sharing with netizens.
I. Flashy label cloud
I remember many years ago, when I didn't use wordpress, I saw a lot of blogs from netizens. There was a tag cloud on the sidebar, and some were dynamic clouds. I used the CMS system in China, so I tried to implement the same function, but I was not allowed to end it. Later I realized that I was using wordpress and there was a tag cloud plug-in. It seems that this is nothing. This floating function is actually a flashy function. for users, the access speed is more important. If the general network speed is not fast, load it, user endurance is limited.
Ii. Practical hot tags
Under the navigation bar of the website, if there is a hot tag, it will undoubtedly make users feel that the website is professional. In the past, when using the CMS system, the website background provided the input of popular tags. Obviously, this label is false and not necessarily popular. Wordpress tags can be used to implement popular tags. As your article grows, tags will change. Especially when wordpress is used as a CMS website, it seems to be a standard.
3. Outdated keyword functions using tags
Once upon a time, Meta Tags (only keywords and descriptions are considered) in a website are essential for SEO. However, after a big update of Baidu, the key words have become increasingly weak. You can see the products under Baidu, such as Baidu know and Baidu encyclopedia, and almost no keyword settings. This shows that keywords are a dispensable identifier for search engines. The search engine can analyze the content of a webpage. In fact, wordpress does not have any keyword set. Obviously, it is unnecessary to use tags for keywords.
Iv. Use tags to enhance user experience
Obviously, wordpress users may wonder, how can I use tags? What I want to talk about is to use tags to enhance the user experience of the website. We have all guided that a website has its main keywords. If there are three main keywords on our website, there may be several hundred long-tail keywords derived from these three keywords. We should use these long-tail keywords when publishing articles or products, and then organize these keywords using tags, place them in the appropriate location of the website, and guide users to access them, however, users can quickly find the information they need. I think this is the role of tags. At least in this way, your users will not lose their way on your website.
5. Advanced tag usage
In fact, tags are used to organize website content. How can we organize content? This requires some skills. The following is an example.
Example 1: use tags to create navigation.
Background hypothesis: There is a website that is used for Chinese poetry. This involves dynasties and authors, and some also require classification by letter. Although we can use classification for the dynasty, the author cannot use classification because there are too many. There are only 26 letters that can be classified, which is too large. So classification is not a good solution. How can this problem be solved?
The solution is as follows:
Now we enter a poem "wanglushan Waterfall" by Li Bai. We can enter W, Tang Dynasty, Li Bai, and Qi Yan in this label. Add the following code to the funtion. php file:
Add_action ('admin _ menu ', array ('djpluginsoptions', 'add '));
Function get_tag_link_by_slug ($ tag_slug ){
$ Tag = get_term_by ('slug', $ tag_slug, 'Post _ tag ');
If ($ tag) return get_tag_link ($ tag-> term_id );
Return 0;
}
The function of this section is to obtain the link of the tag. the following reference can be made in the template:
<A href = "[? Php echo get_tag_link_by_slug ('tagname');?> "> Tag name </a>
Now, we can make the navigation we need.
Example 2: use tags for project identification.
Background hypothesis: we are now going to create a product-type enterprise website. For a product, it involves price, specification, color, material, details, and other information. Although these can be added in the editor, the problem is that the information cannot be raised separately. So we can only need another method, such as placing details in the editor, and putting others in the tag. These labels need to be designed with multiple input boxes for easy calling.
The solution is as follows:
Add some code to the funtion. php file:
Function create_my_taxonomies (){
Register_taxonomy ('price', 'post', array (
'Hierarchical '=> false, 'label' => 'price ',
'Query _ var' => true, 'rewrite' => true ));
}
Add_action ('init ', 'create _ my_taxonomies', 0 );
Here we only use "price" as an example, and so on. After the above Code is added, the "price" input box will appear in the wordpress background. When releasing a product, you only need to enter the price in the "price" input box. Then, enter the call code in the appropriate position of the template to implement the functions we need:
<? Php echo get_the_term_list ($ post-> ID, 'price', 'price: ',', ');?>
Of course, the use of tags is far more than that. I just played a role here. More advanced usage needs to be further discovered. I also hope that netizens will share it in the spirit of sharing.
This article is an original article. The author's blog is www.dianjin123.com. You are welcome to repost it, but please keep the link. Thank you!