Category: PHP
How to Install and Configure Memcached with WordPress on Ubuntu and DDEV
In this blog post, I’ll guide you on how to install Memcached on Ubuntu and DDEV to boost your website’s speed. We’ll also explore the configuration process and its integration with WordPress using the Object Cache 4 Everyone plugin, simplifying the steps to achieve enhanced site performance. What’s Memcached? Memcached is a high-performance, distributed memory…
How to Use Bitbucket Pipelines for CI/CD in WordPress and Drupal Web Development
In the world of building websites, it’s important to work fast and without mistakes. Continuous Integration and Continuous Deployment (CI/CD) help make this happen by automating parts of our work. In this post, I’ll demonstrate how to leverage Bitbucket Pipelines for automating various tasks, such as testing and deploying projects built with Drupal and WordPress,…
How to Fix the ‘PHP Version Does Not Satisfy That Requirement’ Error in Composer for Drupal Projects
For those building Drupal websites, Composer is essential. It helps manage and add new website pieces, like modules and themes. But if you’ve ever felt lost about how Composer works, think of it as a helpful grocery shopper. Not sure about the analogy? Check out this article: “Understanding Composer: A Simple Analogy of Grocery Shopping…
How to Set Up Xdebug with DDEV in VSCode in 4 steps
How to Set Up Xdebug with DDEV in VSCode: In just four easy steps, enhance your coding and debugging experience in this popular editor, as detailed in this post. Xdebug is a debugging and profiling tool for PHP. It offers stack traces, variable inspection, and breakpoints, along with code coverage and performance profiling to optimize…
How to Remove Duplicates in Drupal Views with Taxonomy Relationships
When working with Drupal, one of the most powerful tools at our disposal is Views. It offers a flexible way to present content, especially when content is associated with taxonomies. However, sometimes we encounter an annoying issue: duplicates. I personally faced this challenge today. The Problem:I created a Drupal View named ‘resources’. In this view,…
Proxying Media Files in a Local WordPress Development Environment with DDEV
Proxying media files in a local WordPress development environment is an essential skill for developers who want to ensure that their local site reflects the content and functionality of the live production site. Downloading all the media files to your local environment might not be the best solution, especially if the production site has a…
How to Create and Use Drupal 8+ Services: A Detailed Guide with Practical Code
Drupal, the open-source content management system, has come a long way since its inception. With the release of Drupal 8, we saw a massive shift in the underlying architecture: the adoption of a more object-oriented programming approach using Symfony components. One notable component that was introduced in Drupal 8 is the service container, which has…
How to Efficiently Render HTML Markup in WordPress: A Practical Guide for Developers
Discover the power of template parts in WordPress and learn how to render HTML markup efficiently with our step-by-step tutorial. This comprehensive guide explores the benefits of using template parts, including modular code structure, reusability, and improved readability. Whether you’re a seasoned developer or just getting started with WordPress, this tutorial will provide you with…
What are the benefits of PHP 8.1 and the Commands to upgrade from an older version on Nginx?
PHP 8.1 is the latest version of the popular server-side scripting language, and it brings a host of new features and improvements that make it a compelling choice for developers. In this article, we’ll highlight some of the key benefits of upgrading to PHP 8.1.
How to add the logged-in user’s roles as classes in the body element in WordPress
To add the user roles to the body of your WordPress pages, you can use the body_class hook. This hook allows you to add custom classes to the <body> element of your pages. Example of body_class hook to add classes to the body element Here’s an example of how you can use this hook to…