Categories
Uncategorized

How To Replace A Word In WordPress Posts

In the previous post, you created your very first WordPress plugin. Now let’s make it do something! How about changing occurrence of a particular word in posts/pages with something else? For instance, let’s replace pluto with pluto (not a planet). It can be achieved by adding the code below to the plugin file you created […]

Categories
Uncategorized

How To Create A WordPress Plugin In 10 Minutes

There are plenty of similar posts available all over the internet so I’ll try to keep this short and to the point. Local Developer Environment To create a WordPress plugin, first you’ll want to setup a WP developer environment. There are many options but I recommend using VVV (Varying Vagrant Vagrants). The installation is quite […]

Categories
Uncategorized

Tags VS Categories In WordPress

I’ve always been confused with tags and categories in WordPress. I know what they are but I always found myself conflicted between what to use to organize my content in the best possible way. I finally figured that I can leave categories alone for now and just move my focus completely on tagging my posts. […]

Categories
Uncategorized

Change The Excerpt Length Of Your WordPress Posts

This is fairly easy to do with the help of a filter called excerpt_length. This piece of code can be added to the functions.php file of your theme OR it can be added to your site via a plugin called Code Snippets. What does it do? In simple words, it creates a function that accepts […]

Categories
Uncategorized

Fixing Jetpack Connection Issues

Hey there! If you’re using (or want to use) Jetpack on your self-hosted WordPress site and if you’re having trouble connecting Jetpack to WordPress.com then this post is for you! Note: This post was originally written on July 13, 2017 and moved here (to thecuriousengineer.com) from my old blog on 7 September 2020. I work […]

Categories
Uncategorized

Store And Restore WooCommerce Cart Data

I was working on a problem where one of my ideas was to store the current cart data away temporarily, use the cart for my requirement, empty the cart and then finally restore the cart data which we stored away in temporary variable before. To do this, first get the cart content as follows: Then […]

Categories
Uncategorized

The Perfect WordPress Theme For Regular Bloggers

Today I found a really good theme for this blog. I have been on a hunt for a long time and I always used to go back to the default themes (Twenty-Fifteen to Twenty-Twenty). Today I finally found what I was looking for! I stumbled upon this wpbeginner blog post listing out a bunch a […]

Categories
Uncategorized

Block External WP Requests

Adding this to wp-config.php file will block WP from making external HTTP requests: This will only allow certain requests: That’s all in today’s post!

Categories
Uncategorized

Localizing Scripts In WordPress

The title of this post translates to “passing data from PHP files to JavaScript files in WordPress development environment”. This can be done by using a function called wp_localize_script in WordPress. Let’s say you have a JS file called test.js located at assets/js/tests.js and some PHP file located in the root directory of your project. […]

Categories
Uncategorized

XDebug + VVV + Visual Studio Code Setup For WordPress Development

This post explains how you can get xDebug to work with VVV and Visual Studio Code. There are essentially three main steps to get it to work: Install VVV and enable xDebug. Install the xDebug browser extension (available for Firefox and Chrome as far as I know). Add the correct config in Visual Studio Code […]