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 ( […]

WordPress gets the subcategory of the current category

In productionWordPressWhen the theme is often met, how to be inWordPressThe category page displays the subcategories under the current category or displays the subcategories of the category on the article page,Especially when doing Chinese enterprise theme, we must use this skill。Today, I’d like to share with you the functions that I used to call subcategory […]

The method of forbidding the automatic saving of WordPress articles

Before, Xiao Bian talked about it《solveWordPressarticleidA simple method of discontinuity》Mentioned inWordPress自动保存article的时间间隔的问题,And today we are talking about direct prohibitionWordPressarticle自动保存的方法,The method is simple,And it’s focused onfuntions.phpIn the file,The advantage is thatwpThere is no need to reset after the version is updated! Now let’s ban this function! Put the following code in theWordPressThematic funtions.phpwithin,Pay attention to the last […]

how to automatically add tag links to the article

Today, I’d like to share a WordPress SEO optimization tip, which can realize the automatic addition of keyword tags in the article. Inside the link of good outside, naturally needless to say, it can let Baidu spider in your website crawling more places. Of course, many WordPress plugins can also achieve this function, but today […]

WordPress displays the registration time of the login user in the frontend

When using WordPress to build a website, some users want to display the user registration time in the frontend, but WordPress does not have this option, so how to realize this function? It’s very simple. Although this function is not common, it doesn’t work much. This function is basically used in a user centric site. […]

WordPress adds the number of SQL queries at the bottom

An excellent woodpress theme is definitely that the less SQL consulting is used, the better. How can we see how many times there are SQL consulting in our theme? The following is a piece of code to check the number of times to load SQL Using the tutorial <span>common <?php echo get_num_queries(); ?> secondSqlconsulting service</span> […]

Some WordPress articles can be seen after comments / replies

If we want to hide part of the content of the article and need the user’s comments and replies to be visible, today’s WordPress tutorial article is just right for you. This function is easy to implement, and can improve the enthusiasm of users, is a very good function. Here is the main core code. […]

WordPress common template function reference document

Basic template file file namedescribe style.css Theme style file index.php Home page template file header.php Header template file single.php Single article template file archive.php Archive / categorize template files searchform.php Search form template file search.php Search template file 404.php 404 template file comments.php Message template file footer.php Bottom template file sidebar.php Sidebar template file page.php […]

WordPress gets the first picture in the article as a thumbnail

If you have a large number of articles on your site, it will be a complicated step to manually set the thumbnails for each article. We shared an article “implementation method of random display of thumbnails for WordPress articles” before WordPress realizes random display of article thumbnails. I don’t know if bloggers will forget to […]