WordPress TinyMCE editing mode to add the code of size prompt for characteristic image upload

WordPress TinyMCE editing mode to add the code of size prompt for characteristic image upload

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
WordPress Tutorial 1442 ℃

How does WordPress disable its own XML sitemap wp-sitemap.xml

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 Tutorial 1758 ℃

Delete the new global style inline CSS style of the front end page in Wordpress 5.9

After WordPress 5.9 is updated, a large block of style inline style code with the ID of global styles inline css will be added to the source code of the front page (see its ID means global inline style). This inline style should serve the site editor function added in WordPress 5.9, but for webmasters who do not use this function, It seems redundant. Although it does not affect the normal operation of the website, it is believed that many users will not be able to bear such a large piece of useless code, so deleting it will be a choice for many users. Delete Method
WordPress Tutorial 1997 ℃

Wordpress restores the code of the classic gadget setting interface

Since the beginning of WordPress 5.8, the gadget management mode in the background appearance has also used the Gutenberg editor's block editing mode, which is very powerful, but I am not really used to using it, and the original classic gadget is more friendly for users with little demand for gadget editing function, The WordPress official also considered this problem, so it released the classic gadget WordPress plug-in classic widgets. Enabling this plug-in can restore the classic WordPress gadget device interface in the past. (More...)
WordPress Tutorial 1986 ℃

Wordpress Previous and Next Article Codes with Thumbnails

Wordpress calls the functions previous_post_link() Next_post_link() calls plain text hyperlinks. How can I call the featured images of the previous and next articles? The idea is to obtain the ID of the previous article and the next article, and then pass it to the function get_the_post_thumbnail() to obtain the thumbnail to call the corresponding characteristic image. (More...)
WordPress Tutorial 1379 ℃

WordPress counts the number of articles published today

Get the number of articles published by Wordpress today, that is, get the number of articles published during the period from 0:00 to 24:00. Bloggers have shared the code of the number of articles published on the day WordPress calls. The implementation method is through the WP_Query class. The code shared today is counted by using the $wpdb object query quantity database. (More...)
WordPress Tutorial 2296 ℃

Code for excluding top articles in the main loop of WordPress home page

For the development needs of the website, the top articles of the website are called separately outside the main loop on the home page. Since you don't want to see two lists of the same top articles on the home page, you should exclude the top articles before the latest articles in the main loop. Blog Bar has previously shared the tutorial "Exclude top articles from the latest Wordpress article list", which uses query_posts() to exclude top articles. However, using query_posts() can easily cause pagination problems in the article list, so it is not recommended. The following code is recommended. (More...)
WordPress Tutorial 1400 ℃
 Wordpress modifies the button text on the background article management page

Wordpress modifies the button text on the background article management page

You can modify the display text of the top level menu on the left side of the background by modifying the display name tutorial code of the "Article" in the background management menu through Wordpress, but when you enter the article management interface, the button or link text on the page still uses "Article". To modify these text, you need to continue to add the following code. (More...)
WordPress Tutorial 1801 ℃
 Wordpress modifies the display name of "Article" in the background management menu

Wordpress modifies the display name of "Article" in the background management menu

The name of the WordPress background management menu on the left is fixed. No top-level menu or submenu provides relevant setting options for users to modify freely, but the corresponding function hook admin_menu is provided. Therefore, to modify the display text of the background management menu, you can install the WordPress plug-in or add function code. The following is to modify the background "article" The function code for managing menu names can be used as a reference to modify other menu names. (More...)
WordPress Tutorial 2201 ℃

Wordpress restricts non login users from browsing classified articles

The wordpress website has created multiple classified directories. By default, all classified directory articles are allowed to be viewed by all visitors. How can I achieve this if I want to let non logged in visitors only access specified classified articles? WordPress does not provide this function in the background by default, but it needs to be implemented through code or plug-ins. The code shared below implements wordpress to restrict visitors from accessing specified classified articles. (More...)
WordPress Tutorial 1793 ℃