Creating a separate tab page in WordPress

Creating a separate tab page in WordPress

The main purpose of creating a tag page is to facilitate searching and also for SEO considerations.
When using different themes, it is always necessary to create a separate Google page. This time, I will post the tutorial for easy reference.
1. Copy your theme's page.php file, rename it to tags.php, and add the following at the top of the file:

 <?php
/*
Template Name: Tags Cloud
*/
?>

2. Change the_content(); in the file to wp_tag_cloud();
3. Create a label page in the background. Select Tags Cloud as the template.
4. CSS beautification: Change wp_tag_cloud(); to

$html = '<ul>';
foreach (get_tags( array('number' => 50, 'orderby' => 'count', 'order' => 'DESC', 'hide_empty' => false) ) as $tag){
$color = dechex(rand(0,16777215));
$tag_link = get_tag_link($tag->term_id);
$html .= “<li><a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}' style='color:#{$color}'>”;
$html .= “{$tag->name} ({$tag->count})</a></li>”;
}
$html .= '</ul>';
echo $html;

And add in the css file:

ul.post_tags li {
display:block;
width:23%;
list-style:none;
background:none;
float:left;
}

At this point, the label page is created.
Demo: http://love8.org/tags
Basic reference: http://www.ludou.org/wordpress-create-tags-page.html

<<:  Justhost 50% permanent discount code

>>:  Also talk about smartphone WM and Android system

Recommend

GBServers: £5.5/month/1GB RAM/60GB storage/800GB bandwidth/XEN/UK/free cPanel

GBServers, a British hosting provider, claims to ...

JustHost 50% off coupon code

Features: unlimited space, unlimited databases, u...

Use wget to download Baidu network disk files under Linux

Requires cookies. This method also applies to Thu...

$10/month/512M/20G space/500G traffic/OpenVZ VPS —— IntoVPS

IntoVPS is an American hosting company founded in...

Eleven2 latest 60% discount code

Eleven2 has been introduced before, it is a very ...

Layerbyte: $15/year/1 CPU/128MB memory/15GB space/500GB/1 IP/OpenVZ

Layerbyte is a Canadian hosting company founded i...

Kdatacenter 1G memory 1Gbps port South Korea SK KVM VPS review

Details : Kdatacenter: $17.1/month/1G memory/100G...

WootHosting: $12/year/2GB RAM/30GB space/3.5TB bandwidth/OpenVZ/Los Angeles

WootHosting has launched 3 discounted VPS, Los An...