Detailed Guide to TangStyle WordPress Theme Optimizations
In the previous article, WordPress Theme TangStyle V1.0.9 Optimized Version Released, Xiao Z mentioned a series of optimizations made to the TangStyle theme. This article specifically introduces what has been optimized.
1. Disable Google Fonts
After WordPress 3.8, Google Fonts are loaded from the backend. Recently, Google has been blocked in some regions, which affects loading speed. Disabling Google Fonts in the TangStyle template functions resolves this issue. For specific methods, see: Several Ways to Solve Google Font Loading Issues on WordPress Sites.
2. Add CNZZ Cloud Recommendations
Recommend related articles to users to enhance stickiness and improve user experience. The implementation method can be found here: Add CNZZ Cloud Recommendations to Your WordPress Site to Strengthen User Stickiness. Note that this feature only displays if the website content is sufficiently rich. The effect is shown in Figure 2-2:
Figure 2-2 CNZZ Cloud Recommendation
3. Add Breadcrumb Navigation
The TangStyle theme does not include breadcrumb navigation by default. Adding breadcrumbs improves user experience and is not complex to implement. See: How to Add Breadcrumb Navigation to WordPress. The effect is shown in Figure 3-3:
Figure 3-3 Breadcrumb Navigation
4. Add Article Pagination
Previously, when writing articles with long content and too many images, I added this feature to avoid affecting loading speed and user reading. The usage method can be found here: Add Pagination Function to WordPress Articles. I have integrated the pagination tags into the editor, so they can be used directly.
6. Enhance the Default WordPress Editor
The default WordPress editor has limited functionality, so I enhanced it within the theme and customized some text tags for convenience. The visual interface editor is straightforward, so no further introduction is needed.
Regarding the text editor interface:
hr: Horizontal lineh1: Level 1 heading (and so on)br: Line breakred: Display text in redhighlight: A shortcut tag for code highlighting. Requires the WP-Syntax plugin to be installed; otherwise, it is invalid.pagination: As mentioned in point 4, allows direct pagination for articles.nofollow: Quickly addsnofollowto external links, beneficial for SEO.
These text tags can be customized according to personal preference. See: Enhance WordPress Editor with Code.
Figure 6-6 Enhanced WordPress Text Editor
7. Add Baidu Share Buttons
TangStyle allows adding share button codes in the theme settings. To make it more convenient, I added the Baidu Share buttons directly from the source code, reducing one step. If you do not like them, you can modify them back.
Figure 7-1 Baidu Share Buttons
8. Article View Count Statistics
Mr. Tang Jie recommended installing WP-PostViews Plus or WP-PostViews in the theme description to track views. To save resources, I integrated the code into the theme, so no plugins are needed to track view counts.
Figure 8-1 Article View Count
9. Administrators Can Check Baidu Indexing Status for Each Article
This code was provided by netizen Di Si Wei. It detects whether each article has been indexed by Baidu. If not indexed, a red prompt and a submit button appear, which is very convenient. The effect is shown in the Baidu Indexed prompt in Figure 8-1. Testing shows that if the theme is installed locally, this code may affect it; if installed on a virtual host, it will not. Users testing locally should remove it from functions.php. The implementation method is: Check if Article Pages Are Indexed by Baidu.
To download the theme, please visit: WordPress Theme TangStyle Optimized Version Released. The optimizations listed above are the main changes, but optimization is ongoing. If you have any suggestions, please let me know. For questions, you can add my QQ: 337003006.