wordpress Source code functions.php Document Details[ Wordpress Development Tutorial ]
This file is in wordpress The theme is very important. Together with the style.css file, it has built a beautiful theme. Let's see what interesting uses this file has.
Source: //www. iteye.com/blog/jinsangu o-2395504
Definition: Through this file( functions.php )You can change the default behavior of Wordpress, which is located in your theme folder.
Description: functions.php The behavior of the Wordpress plug-in is similar to that of the Wordpress plug-in. You can use it to add features and functions to the Wordpress website. In this file, you can call functions, PHP files, and customize your own functions. The effects that the Wordpress plug-in can achieve can be achieved in functions.php.
WordPress plug-ins and Functions Difference of. php
WordPress plug-in features:
1. A clear and unique header text is required (similar to remarks, the official text becomes the header text);
2. It is generally stored in the subdirectory of wp content/plugins.
3. When executing, it is activated through the control panel of the plug-in.
4. Applies to any topic.
5. Single purpose, such as converting post to Pages, search engine optimization, backup and other functions.
Functions
. php file characteristics
1. No header text is required.
2. In the case of passing, it is stored in the wp content/themes of the question (or not in some cases).
3. Automatically execute when the current theme is activated Functions
. php file.
4. It is only used for the current theme. If the theme is switched, the function will disappear.
5. There can be multiple code blocks to achieve different functions.
For functions.php, some topics may not have this file. You can create it yourself through the text tool.
What can you do with functions. php?
1. Using Wordpress hooks, you can change almost anything in Wordpress. For example, you can change the length of the default summary (55 characters) to 200 characters.
2. Add functional support for topics, such as thumbnails, the form of articles, navigation menus, and gadgets (in short, very powerful).
3. The functions and functions defined here can be reused in multiple template files.
matters needing attention:
If a Wordpress plug-in calls a function or filter with the same name as the one in the functions.php file, the result is unpredictable, or even the website crashes.
Original address: //www. dubeng.com/15796.html