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

Hostigger: $100/year/8GB RAM/100GB SSD space/10TB bandwidth/KVM/Türkiye/Chicago

Hostigger, an American hosting provider, was foun...

How to use Paypal to dispute and get a refund

One of the benefits of using Paypal is that you c...

HostMyBytes: $12/year/512MB memory/10GB space/1TB bandwidth/KVM/Los Angeles

HostMyBytes is a Canadian hosting company founded...

XHOSTFIRE: $7/month/384MB memory/10GB space/200GB traffic/KVM/KT Korea

XHOSTFIRE has launched the Korean KT data center ...

NGClouds: $25/year/1GB/20GB SSD space/1TB traffic/KVM/Türkiye

NGClouds, a US merchant, currently mainly provide...

GDCCLOUD: $1.24/month/256MB RAM/5GB SSD space/unlimited traffic/KVM/Russia

GDCCLOUD, a Russian hosting provider, was establi...

GoMach5: $35/month/16GB memory/500GB hard drive/10TB traffic/5 IP/Los Angeles

GoMach5, which has been introduced before, is now...