Archives: Tech

The Charm of Miscellaneous Blogs

·
Miscellaneous blogs, often referred to as lifestyle or eclectic blogs, hold a unique appeal that attracts a diverse audience. These
  • Is there a way to display featured images in the post list on the WordPress admin screen?

    Is there a way to display featured images in the post list on the WordPress admin screen?

    At the moment, something like Display Featured Image In Post List is good.

    Quick Featured Images is also good.

    in
  • [WordPress] Cocoon’s index tab display disappeared.

    [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.

    in ,
  • [WordPress] How to prevent spammy logins

    [WordPress] How to prevent spammy logins

    It’s a good idea to turn on “Completely block access to XML-RPC” in the All In One WP Security plugin. This will prevent spammy logins related to logins via XMLRPC.

    Additionally, you can prevent brute force login attacks by enabling the login lockdown feature using the same All In One WP Security plugin.

    in
  • How to increase the upload size limit for cover images on BuddyPress

    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.

    in
  • How to load WordPress JavaScript asynchronously

    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.

    in ,
  • [Rank Math SEO] How to set the date archive to not return to the top page.

    [Rank Math SEO] How to set the date archive to not return to the top page.

    If you install Rank Math SEO, it won’t jump to the date archive, so if you want to change that, you’ll need to change the settings. To do this, enable date archiving in Titles & Meta, Misc Pages tab in Rank Math SEO.

    in
  • [Contact Form 7] How to set Recaptcha.js so that it does not load on anything other than the contact page.

    [Contact Form 7] How to set Recaptcha.js so that it does not load on anything other than the contact page.

    I am creating a contact form using Contact Form 7. I use Recaptcha to prevent spam, but because of this, Recaptcha.js always comes up in Pagespeed Insights in “Eliminate render-blocking resources” or in “Reduce unused JavaScript”. Therefore, I researched and implemented a method to prevent Recaptcha.js from loading on pages other than the contact page. Try putting the following code in functions.php.

    function block_recaptcha_badge() {
     if ( !is_page( array( 'contact-me' ) ) ) {
     wp_dequeue_script( 'google-recaptcha' );
     wp_deregister_script( 'google-recaptcha' );
     add_filter( 'wpcf7_load_js', '__return_false' );
     add_filter( 'wpcf7_load_css', '__return_false' );
     }
    }
    add_action( 'wp_print_scripts', 'block_recaptcha_badge' );

    If you have multiple contact form pages, you can increase the array(‘contact-me’ part, like below.

    array( ‘contact-me’, ‘contact-me’, ‘contact-me-3’

    in
  • [Cocoon] Increase site loading speed by lazy loading Adsense

    [Cocoon] Increase site loading speed by lazy loading Adsense

    Today I will show you how to lazy load Adsense to increase site loading speed. First, if you have auto ads turned on, turn them off from the Google Adsense page. After that, go to your own site and paste the following code in the ad code of the ad tab of Cocoon settings, so let’s change that.

    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456"
         crossorigin="anonymous"></script>
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-1234567890123456"
         data-ad-slot="1234567890"
         data-ad-format="auto"
         data-full-width-responsive="true"></ins>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    Delete <script> to </script> from at the top of this and make it look like the following.

    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-1234567890123456"
         data-ad-slot="1234567890"
         data-ad-format="auto"
         data-full-width-responsive="true"></ins>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    Save it.

    Next, go to the access analysis/authentication tab in Cocoon settings, enter the following code in the footer code, and save.

    <script>
    //<![CDATA[
    //lazy load ads
    var lazyloadads = false;
    window.addEventListener("scroll", function() {
        if ((document.documentElement.scrollTop != 0 && lazyloadads === false) || (document.body.scrollTop != 0 && lazyloadads === false)) {
    
            (function() {
                var ad = document.createElement('script');
                ad.type = 'text/javascript';
                ad.async = true;
                ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
                var sc = document.getElementsByTagName('script')[0];
                sc.parentNode.insertBefore(ad, sc);
            })();
    
            lazyloadads = true;
        }
    }, true)
    //]]>
    </script>
    in ,
  • [WordPress] Speed up your website

    [WordPress] Speed up your website

    Boost your WordPress site’s speed with these steps:

    • Hosting & Themes: Choose optimized hosting and lightweight themes like Astra.
    • Image Optimization: Compress images with tools like Smush or ShortPixel; use WebP format.
    • Plugins: Keep only essential plugins, update them regularly, and avoid overload.
    • Caching: Use WP Rocket or similar plugins and enable browser caching.
    • Database: Clean junk data and schedule regular maintenance.
    • Code: Minify CSS/JS/HTML with Autoptimize; use plugins for custom code.
    • External Requests: Prefer system fonts and minimize external scripts.
    • Ads: Optimize ads with lazy loading and asynchronous delivery.
    • Extras: Enable GZIP compression, use a CDN, and monitor performance with GTmetrix.

    Fast sites lead to better user experience and higher SEO rankings.

    in