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 add user defined upload avatar function in WordPress

Friends who use WordPress to build a website should know that WordPress itself does not have the function of uploading a user-defined avatar. If you want to change the avatar, the steps are very troublesome. In our development of a WordPress theme, especially the multi-user theme, it is necessary for registered users to customize the […]

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

WordPress adds links to the specified keywords in the content of the article

function replace_text_wps($text){ $replace = array( ‘Theme King’ => ‘<a href=”https://yijile.com/tag/wordpress/” rel=”tag” >Theme King</a>’, ‘WordPresstheme’ => ‘<a href=”https://wpfans.org/theme” rel=”category tag” >WordPresstheme</a>’, ‘WrodPresscourse’ => ‘<a href=”https://wpfans.org/wplearn” rel=”nofollow” target=”_blank” >WrodPresscourse</a>’ ); $text = str_replace(array_keys($replace), $replace, $text); return $text; } add_filter(‘the_content’, ‘replace_text_wps’); usage method Paste the following code into your own WordPress theme functions.php File. Related Article Two methods […]