How to implement related logs in WordPress without using plugins

How to implement related logs in WordPress without using plugins

Many comrades use plug-ins to implement related logs, but in order not to affect the running speed of WordPress, it is better to use fewer plug-ins.
The following is a method that can implement relevant logging functions without using plug-ins.
1. Calling method

 <div class="related">
			<h3>Articles you may be interested in</h3>
			<?php include('related.php'); ?>
		</div>

On the log page, call the related.php file. This file can realize related log functions.
2. CSS adjustment To keep the page neat, it is recommended to adjust the CSS. Here is a CSS beautification provided:

 .related h3, #coms-title, #reply-title {
	height: 21px;
	line-height: 21px;
	padding: 0 5px;
	border-bottom: 3px solid #BFBFBF;
	color: #66ccff; }
.related ul { padding: 5px 0 15px; }
.related li { padding: 0 5px; }
	.related li span { float: right; }
	.related li span, .related li small {
		color: #cccccc;
		font-size: 10px; }

3. Download related.php
related
After downloading, upload related.php to the root directory of the theme you are using.
4. This blog demonstrates the method used. For reference: the theme of wpbus is mainly used as a reference.

<<:  MySQL large capacity database backup method

>>:  Web Host Directory selected high-quality hosting

Recommend

FastDomain US Web Hosting

FastDomain, like HostMonster, is owned by the sam...

Cochin Web Hosting: $30/month/2GB RAM/30GB SSD/KVM/Singapore/Hong Kong

Cochin Web Hosting, an Indian hosting provider, p...

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

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

limenex 50% off all web hosting

Limenex is a Singapore hosting company establishe...

Time4VPS: €9.55/year/256MB RAM/256GB storage/2TB bandwidth/OpenVZ/Lithuania

Time4VPS is affiliated to Interneto vizija (estab...

BandwagonHost starts to provide free IP change function

BandwagonHost is a long-established American host...

Japan VPS Recommended List

Japan has abundant Internet resources, reasonable...