Category: Dev

  • Upgrade PHP7.2 to PHP7.4 on Ubuntu running NGINX

    Upgrading PHP versions isn’t exactly an upgrade in the sense that you will end up with both PHP versions installed. Installing PHP7.4 won’t remove 7.2, you will have both and then you can configure your server to use 7.4. First, you’ll need to install PHP7.4 and all the related packages that you used in 7.2. […]

  • Clone an app with Azure PowerShell

    Create an exact copy of an existing app including files using PowerShell. Azure portal provides an option to create additional deployment slots for your app to use for staging. This creates a copy of your app which you can publish to for testing and when you’re ready, swap this slot with the production slot. This […]

  • Fix HTML not working in Hugo

    By default, Hugo does not render HTML (and JavaScript). So you can’t use HTML tags in the markdown files. To enable this, change the following setting in config.yml: If your theme uses TOML or JSON, you can get instructions for these here. Shortcode to open links in new tab If HTML rendering is enabled in […]

  • Change the footer in WordPress admin

    To change the footer text in the WordPress admin area, add the following lines to your theme’s functions.php. To remove the version number on the right side of the footer, you need to remove the existing text and then add the new text.

  • Run multiple versions of PHP in XAMPP

    Download the required version of PHP from https://www.php.net/downloads.php. For PHP7+, you can download the Thread Safe version. For older PHP, try the Non Thread Safe version. Create another folder in C:\xampp for this version of PHP apart from the existing C:\xampp\php. E.g., C:\xampp\php74. Copy the downloaded version’s files into this folder Create php.ini in this […]

  • Redirect Subfolder to Subdomain using .htaccess

    Setup redirection after migrating a site from a subfolder to a subdomain. When a site in a subfolder is moved to a subdomain, .htaccess rules need to updated to redirect URLs. This can be done by adding the following lines to the .htaccess file in the root folder: This will redirect all calls to domain.com/subfolder/* […]

  • Overflow both sides in CSS

    Normally, when content or an image overflows outside a div, the overflowing content is shown on the right outside the “box”. If you want to position the content to the center, so that overflow is on both sides, you can use this class. This is useful to position an image such that the centre of […]

  • Make an inner div full width in CSS

    Make an inner div expand to the full-width of the page. When a div is inside another div, adding width: 100% will only stretch it to the width of its container. To make the stretch to the full width of the page (or viewport), use this:

  • Add custom post types to WordPress search

    Include custom post types in the search using WordPress hooks To include custom post types in the default search, we need to modify the search function using an action hook. Post types that we want to search through are added to the search query in an array. The array needs to include WordPress’s default post […]