WordPress gets statistics on the number of images in an article

as far as I knowWordPressThere is no function to count the number of pictures in the article,So if you want to get the total number of all pictures in the article, you can only add by yourselfWordPressCode to achieve。 This feature is not difficult to achieve, Just a few lines of code, There are many […]

Manually open WordPress site maintenance mode

In an updater or plug-in,WordPressThe front end will show that it is in maintenance mode,If you want to temporarily enable maintenance mode,Let users know that your site is under maintenance,It can be realized by the following code。 openWordPressSite maintenance mode Add the following code to the current topic function templatefunctions.phpin: function zm_maintenancemode() { if ( […]

Login users display different WordPress menus

If the login user and the non login browser display different menus, the following code can be used: the login user displays different WordPress menus add the following code to the current topic function template functions.php Medium: if( is_user_logged_in() ) { $args[‘menu’] = ‘logged-in’; } else { $args[‘menu’] = ‘logged-out’; } return $args; } add_filter( […]