Your cart is currently empty!
Category: WordPress
How to load WordPress JavaScript asynchronously
By putting the following code in functions.php, you can load WordPress JS asynchronously. Effective if jquery.js or jquery-migrate.min.js appears in “Exclude resources that prevent rendering” in PageSpeed Insights.
if ( !(is_admin() ) ) { function replace_scripttag ( $tag ) { if ( !preg_match( '/\b(defer|async)\b/', $tag ) ) { return str_replace( "type='text/javascript'", 'async', $tag ); } return $tag; } add_filter( 'script_loader_tag', 'replace_scripttag' ); }
However, if I do this, my PageSpeed Insights score will go up, but the Cocoon blog card image won’t display properly, so I changed it back.
[WordPress] Speed up your website
Speeding up your WordPress website is crucial for improving user experience, search engine rankings, and conversion rates. Here’s a detailed guide on how to effectively enhance your website’s performance:
(more…)How to increase the font size of bbPress [Memorandum]
You can increase the font size of bbPress by putting the following code in the additional CSS of the theme.
bbpress-forums .bbp-topic-content p, bbpress-forums .bbp-reply-content p { font-size: 18px; } .bbp-forum-title { font-size: 22px; } #bbpress-forums .bbp-forum-info .bbp-forum-content, #bbpress-forums p.bbp-topic-meta { font-size: 16px; } div#bbpress-forums .bbp-topic-permalink { font-size: 20px; } #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-replies, #bbpress-forums ul.bbp-search-results, #bbpress-forums ul.bbp-topics { font-size: 18px; LINE-HEIGHT: 1.6em; } .bbp-reply-content { font-size: 20px; } div.bbp-breadcrumb, div.bbp-topic-tags { font-size: 16px; }
To support Cocoon’s dark mode, add the following CSS.
#bbpress-forums li{ color:#000; } #bbpress-forums a, #bbpress-forums a:hover{ color:#608fbd; }
[WordPress] Cocoon’s index tab display disappeared.
After installing a plugin called “LightStart”, the tab display of Cocoon’s index disappeared. After checking the WP admin screen, settings, display settings, and checking that it is set to “Latest Posts” and saving again, the tabs are now displayed.
How to import Instagram articles to WordPress
I run another site and use a paid plugin called Intagrate Pro. There is also a free Lite version, so you should try using Lite first.
How to increase the upload size limit for cover images on BuddyPress
The steps to increase the upload limit are as follows.
You can increase the upload size limit by editing the functions.php file. For example, to increase it to 10MB, add the following code to your functions.php file:
function bbp_cover_image_file_size( $fileupload_maxk, $type ) { if ( 'avatar' == $type ) { $fileupload_maxk = 10485760; // 10MB in bytes } if ( 'cover_image' == $type ) { $fileupload_maxk = 10485760; // 10MB in bytes } return $fileupload_maxk; } add_filter( 'bp_attachments_get_max_upload_file_size', 'bbp_cover_image_file_size', 10, 2 );
This code increases the upload limit for both avatars and cover images to 10MB. It also works by pasting it in the WpCode Lite plugin and saving it.
Recommendations for WordPress permalink settings
Examples of My Past Mistakes:
Using the structure “%category%/%postname%” led to issues where only one post would appear if it belonged to multiple categories, and changing a category would alter the permalink.
Current Recommended Settings:“/post/id/%postname%”This avoids duplication with category pages and can accommodate custom post types.
Points to Note:
- Avoid using Japanese URLs.
- If the title is in Japanese, manually change the permalink to English.
With this setup, you can manage categories flexibly without negatively impacting SEO.
[Contact Form 7] How to prevent spam from being sent from the contact form
- The first is the introduction of “Google Recaptcha v3”.
- The second is “installation of checkboxes”.
How to create a contact form in WordPress
You can use the Contact Form 7 plugin.
[WordPress] What to do if the JetPack blog statistics widget does not update
If the statistics recorded on the JetPack site and the numbers displayed by the blog statistics widget are different, you can fix it using the following method.
- Install Transients Manager
- Once installed, go to Transients in your WP admin and search for a string starting with: “jetpack_restapi_stats_cache_”
- Delete everything that appears.
- If you reload the blog and check the widget, the correct value should be restored.