hosting tutorials WeChat Top

👋🏼Welcome to my WP-Host blog where I am excited to share my knowledge and expertise on WordPress hosting and website construction tutorials with you. Let’s connect and learn from each other! You can reach me at

Email Me




微信:18200592859 或 yrwordpress

Replace Functions.php with the Code Snippets plugin for easier addition of custom code

Replace Functions.php with the Code Snippets plugin: This article introduces a plugin called Code Snippets that can replace the Functions.php file in your WordPress theme. By using this plugin, you can add all the code that was previously added to the Functions.php file directly to the plugin, making code management much more convenient and not affected by theme updates or changes.


I’d like to continue sharing about WordPress plugins. Although most of the WordPress theme templates we use already have complete functionality, everyone has different requirements. Therefore, in most cases, we make some modifications to the original theme template, which are usually done in the theme’s functions.php file. This is where we can modify the theme or plugin effects, or even disable certain functions, which is very convenient. However, the only issue is that these modifications will be overwritten when the theme updates.

Today【WP-Host/悦然wordpress建站】recommend a plug-in that can replace the theme functions. After updating or modifying, it will not affect the effect of our previously modified code.

This wordpress plugin is Code Snippets, you can search and install it directly in the wordpress background plugin center, or you can download it through the link.

The download address is as follows:


Code Snippets

Enable directly after installation.


After enabling, we add a new code snippet, and then add the function code you need, as shown in the figure above. In this way, as long as the plugin exists, even if you update or change the theme template, this code effect will always exist.

Note: Although this plug-in is easy to use and convenient, we still try to use it as little as possible under normal circumstances. Plug-ins always have some impact on the website, and they are only used when they are necessary.

Well, for ordinary enterprise website construction users, there may not be many code modifications involved. If you want to modify, please be careful, and it is best to consult relevant technical personnel.

Practical code snippets to share

The following are some more practical code snippets I compiled, you can use them directly, add them to the Code Snippets plug-in and activate it to take effect.



这款wordpress插件为Code Snippets,大家可以直接在wordpress后台插件中心搜索安装,也可以通过我提供的链接下载。



Code Snippets






以下是我整理的一些比较实用的代码片断,大家可以直接拿来使用,添加到Code Snippets插件中激活即可生效。

WordPress Hosting / 悦然wordpress建站

WordPress Hosting / 悦然wordpress建站

【WordPress Hosting / 悦然wordpress建站】I am a WordPress hobby from China, and I like to communicate with friends from all over the world to learn WordPress website building and maintenance related knowledge.