How to use the wp_parse_url() and wp_parse_str() functions

wp_parse_url() #wp_parse_url() wp_parse_url() is wrapper function for PHP’s parse_url() function that handles consistency in the return values across PHP versions. Example 1: #Example 1: Let’s extract the scheme, host, and path from the URL by using the wp_parse_url(). The output of the above code is below: array (size=3) ‘scheme’ => string ‘https’ (length=5) ‘host’

Read More »

Understanding the WP CLI arguments

In a recent article, we learn about creating the first WP CLI Hello World program. If you read that article then you can skip some below steps. Now, We are going to understand the WP CLI arguments or $args parameter from the WP CLI command. First, we’ll create a simple plugin and then understand the

Read More »

Create a first WP CLI Hello World Program

We learn how to install the WP CLI. Now, Let’s create a simple WP CLI hello world program. We are going to create a new plugin that contains the WP CLI hello world program. Create Empty Plugin #Create Empty Plugin Create a new folder wordpress-examples into plugins directory /wp-content/plugins/ Create a file wordpress-examples.php and add

Read More »

Adding image sizes with add_image_size() in WordPress

Introduction #Introduction We can add custom image sizes with function add_image_size(). But, First, let’s discuss why we need custom images in WordPress? By default, WordPress provides 3 image sizes. Means, When we upload any image in WordPress media library then WordPress creates 3 image sizes for us. These image sizes are: Thumbnail (150×150) Medium (300×300)

Read More »
Highlight Publish And Draft Date Column With Strings
Code Snippets
Mahesh Waghmare

WordPress readable date format for post

Problem #Problem The first question raises in your mind is, what do you mean by WordPress readable date? Let me explain. While writing articles for my blog, I notice that the date format of the published and draft posts are not readable. With default date format I was few questions: How much time ago

Read More »

How to fix error: To perform the requested action WordPress needs to access your web server

Overview #Overview WordPress will prompt you for FTP credentials If it does not have permission to write the files it needs to. Whenever this happens we can see the error: To perform the requested action, WordPress needs to access your web server. Please enter your FTP information to continue. If you do not remember your

Read More »

How to avoid automatic redirection or canonical redirection in WordPress?

Overview #Overview WordPress redirects the incoming links to the proper URL based on the site url. Search engines consider the link and to be two different URLs when they both go to the same location. This SEO enhancement prevents penalties for duplicate content by redirecting all incoming links to one or the other.

Read More »

How to enable allow_url_fopen from the php.ini file?

Introduction #Introduction allow_url_fopen is a filesystem and streams configuration option. Which enables the URL-aware fopen() wrappers that enable accessing URL objects like files. If allow_url_fopen() is enabled then by default we can access remote files using the FTP or HTTP protocol. Also, extensions like zlib may register additional wrappers. Issue #Issue We could not use

Read More »

6 Years Complete in The WordPress

I got an achievement notification on my blog I have just completed the 6 years with WordPress. Note: This is a Quick Short Post.

Read More »

How to Fix the ERROR: the “PHPCompatibilityWP” coding standard is not installed.

How to Check PHPCompatibilityWP exist? #How to Check PHPCompatibilityWP exist? To check the PHPCompatibilityWP coding standard is installed on your system use command phpcs -i E.g. phpcs -i You can see the result like below: The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra and PHPCompatibility Maybe you

Read More »
Scroll to Top
%d bloggers like this: