WordPress 7.1 Client-Side Image Processing: How to Disable It
WordPress 7.1 resizes editor uploads in the browser and skips server image hooks. Check if it runs, disable it with one filter, or keep it safely.
💡 functions.php is the theme functions file included in every WordPress theme.
Here you can find thousands of code snippets that you can insert into the functions.php file to add new features or change default settings on a WordPress site.
WordPress 7.1 resizes editor uploads in the browser and skips server image hooks. Check if it runs, disable it with one filter, or keep it safely.
Add the following to your theme functions.php file: Source: WordPress搜索功能结果只有一个时直接跳转到结果文章页面
At the time of writing this article (December 03.2022), PHP8 is no longer actively supported and will only receive security support for the next 1 year. New PHP versions offer better optimization and security, but not all plugins, themes, or even WordPress itself is NOT fully compatible with PHP 8.0 How to force your WordPress … Read full article →
By default .css and .js files used in WordPress themes and plugins will add a version number using ?ver= To disable this add the following inside your theme functions.php file or as a new plugin:
I have a WordPress blog on pcelarstvopejcic.com/blog and a few pages that I would like to move to the domain document root, so that: pcelarstvopejcic.com/blog/contact becomes pcelarstvopejcic.com/contact pcelarstvopejcic.com/blog/shop becomes pcelarstvopejcic.com/shop So this way I only have one WP installation and blog posts would be accessible via pcelarstvopejcic.com/blog/POST and pages in pcelarstvopejcic.com/PAGE To do this, edit … Read full article →
Figuring out templates that are being used while you are building and developing a custom WordPress website can be problematic. Using the following snippets you can quickly and easily display template name or full path to the file in your wp-admin bar. Display Template name To display just template name add the following to functions.php … Read full article →
Step 1. Add the following inside your theme functions.php file or create a new Child theme first and add the code to it: Step 2. Add the shortcode [total_posts] anywhere on the website where you want to display the total number of posts: And it will display the number. 🙂
To put a string before the price of WooCommerce product and cart pages, use the WooCommerce filters woocommerce_cart_item_price and woocommerce_get_price_html Add the following code to your active theme functions.php file. Make sure to change <span class=”price-prefix”>TEXT BEFORE THE PRICE</span> with your text or HTML code. NEXT: How to Add text after the price in WooCommerce
Here is a simple code snippet that you can add to your theme functions.php file to show the “last updated” date in your posts. A new line will be added to the beginning of the post content if the last modified and published time is different:
PHP has a built-in function get_defined_constants that returns an array with the names of all the constants and their values. Because WordPress is built in PHP, We can use this function to get all WordPress constants. ⚠️ Use this snippet with caution, as the code will display sensitive information including your database username and password … Read full article →