The [Comment] on the background of the WordPress website can be accessed and viewed by other roles, such as contributors, in addition to the administrator. This is obviously unreasonable and will reveal the privacy of the comment user, because who has the comment content and also has the commenter's email, IP or other user-defined extension information.Therefore, it is necessary to modify the access permissions of WordPress background comments. It is suggested to remove the [Comment] menu from the background for non administrator roles, and then prohibit non administrator roles from accessing.Implementation code and modification method: 1. Add code in the functions.php file of the current topic: function remove_edit_comments_m
When using the WordPress Baidu sitemap generation plug-in in Liucheng to generate the XML file, when clicking the "Update XML file" button to generate the XML file, the prompt "This site has encountered a fatal error" appears. The check found that the WordPress Baidu Sitemap Generator plug-in may not work properly in PHP 7+.Since the plug-in author has not updated and maintained this plug-in for a long time, the author's website has been unable to open and feed back problems. At the same time, it seems that there is no better solution to replace the generation of Baidu sitemap xml files. So think about it, you can only repair and update it by yourself, so that it can
The method of WordPress domain name change Blog Bar has shared the "Two Simple Methods of WordPress Website Domain Name Change Tutorial" before. The method of WordPress multi site mode domain name change is similar to the previous one. The difference is that the data table and data field are different. There are several more statements that need SQL query, and the domain name of the multi site configuration code in wp-config.php needs to be modified.Operating steps: Note: The following tutorials involve website data, so be sure to back up the website data before operation.1. Edit Web
WordPress theme or plug-in application development often requires uploading function of media files such as pictures, videos, documents, etc. If developers write media upload components independently, they need to spend a lot of time and effort. However, by calling the media library components provided with WordPress, they can achieve twice the result with half the effort. Only simple js code can be written to have a powerful media upload function.Wp.media code parameter var mediaObj=wp.media ({frame: 'select',//Select the media type to call the media library. You can select, post, image, audio, video, and select s
After WordPress is updated to version 6.1, WordPress will automatically generate and reference a class-themes.min.css style file with the ID of class-theme-styles-css in the front end head. The file contains a style code for the class selector.wp-block-button__link, which seems to work on Gutenberg blocks,It can be deleted through the wp_enqueue_scripts hook.The generated calling code is as follows: Delete classic theme
There is no hint about the size of the image when uploading the featured image edited by WordPress articles. If the theme is developed for your own use, it will have no impact. But if it is a custom theme, it will obviously affect the size selection of the thumbnail when the customer uploads it, thus affecting the display effect of the front page of the website.Therefore, when developing WordPress applications that use featured images, you can effectively avoid some details by adding a hint of image size to the location where featured images are uploaded.The code for adding prompts is relatively simple
The previous blog has shared the tutorial code for WordPress to add custom fields for category keywords. This time, the core code for adding custom fields for categories and labels is the same as the code for custom fields for category keywords, with only minor optimization and expansion and the addition of hook functions for labels. The following steps are taken to add custom titlesSample code for custom fields of custom keywords and custom descriptions.Add the following code to the functions.php file of the topic: The output code code is very simple. You can copy it directly or add more custom fields by reference.
When logging into the WordPress background, if the user or password entered is incorrect, a targeted prompt will appear.If you enter an incorrect user name, you will be prompted that the user name is not registered on this site;Entering an incorrect password will prompt that the password specified by the user name is incorrect.If the user name and password are entered incorrectly at the same time, according to the default error prompt priority of WordPress, it will first prompt that the user name is not registered, and then prompt that the password is incorrect if the user name is registered.Prompt that the user name is correct and the password is incorrect. Prompt that the user name does not exist
The WordPress function is_active_widget() detects whether a visual gadget (such as a search gadget) is enabled (added to the sidebar) after the gadget is initialized. If the gadget is enabled, it returns true or the ID of the sidebar where the gadget is located. If the gadget is not enabled, it returns false or the ID of the sidebar where the gadget is located is empty.It should be noted that the test shows that this function is only effective for old gadgets, and does not support block gadgets.Function code is_active_widget (call | false $callback=fa
The login page starting from WordPress 5.9 has a language selection setting (as shown in the figure below). You can change the language of the login page, such as "Simplified Chinese", so the language of the login page is Chinese;Select "English", and the language of the login page is English.After the blog bar test, it seems that this setting only changes the language and text of the login page, and has no effect on other pages (perhaps not found), then this function does not seem to have much effect, and removing it should
WordPress 5.5 started with its own XML site map, but many WordPress users used plug-ins or third-party tools to generate the site map XML file, and did not intend to replace it with the wp-sitemap.xml provided by WordPress, so that the XML site map provided by WordPress would become redundant,You can also choose to disable WordPress wp-sitemap.xml.Blog Bar currently knows that there are two ways to disable WordPress wp-sitemap.xml, one of which is
WordPress does not have its own XML site map generation function for a long time. Most users may use the relevant Wordpress plug-ins to generate XML site map files (such as sitemap. xml). From WordPress 5.5, you can choose whether to discard the plug-ins and directly use the site map provided by WordPress.WordPress 5.5 has a built-in sitemap (XML Sitemap
Many people may not have noticed that WordPress has always compressed the image quality of uploaded JPEG formats (such as. jpeg and. jpg) by default. Before WordPress 4.5, the image quality will be compressed to 90%. After WordPress 4.5, the image quality will be compressed to 82%. This is to reduce the image size and optimize the loading speed.But not everyone wants the uploaded image to be compressed, because the compression quality means that the uploaded image will be blurred or distorted. Of course, some people think that the image quality is not compressed low enough and want to compress it smaller.Perhaps the WordPress official also took these situations into consideration, so it also provided modifications
The mzablog theme is a set of zblog blog themes with white as the main body and blue as the embellishment.The theme is the structure layout of the left and right columns, the layout of the image text list, the responsive structure, and the design of the carousel map, recommended articles, popular articles, hot reviews
The [Comments] on the background of the WordPress website can be viewed by other roles such as contributors, in addition to the administrator. This is obviously unreasonable and will reveal the privacy of comment users, because who has comments in addition to comments
The unreasonable permission setting of website files on the server is one of the reasons why the website was breached (hacked). Therefore, for the security of the website, it is recommended to set the permissions of website files. The following is a copy of the official Z-Blog blog "ZB File Permission Security..."
The two-step verification of website login means that in addition to the user name and password, you need to enter a dynamic password generated by the mobile phone APP before you can successfully log in to the background.In this way, even if the password of the website is leaked, it can also be used in certain procedures