How to Create a WordPress Child Theme

60 seconds or less, that’s all that takes to create a WordPress child theme and I highly recommend that you do it before even thinking about making any code or style modifications to your active theme. There are two files that you can use inside a child theme to overwrite parent theme’s functionality or style: … Read more

How to add next and previous links to your WordPress site

In this article, we’ll add the next and previous links on a WordPress theme. First We declare the previous and next variables: Then to show them inside the post, add the following snippets to the theme’s single.php file: If you want to further customize the links and maybe even display post name inside the links, … Read more

How to fix curl error 60: SSL certificate problem: certificate has expired error

From September 30, 2021, WordPress websites that use Let’s Encrypt certificates are having issues with HTTP API requests. For example, here is an example that will cause this error: $res = wp_remote_get( ‘https://abcdef.com/’ ); if( is_wp_error( $res ) ){ echo $res->get_error_message(); } the error message: cURL error 60: SSL certificate problem: certificate has expired What causes this error? … Read more

How to display a random WordPress post inside a page

Here is a handy snippet that displays a random post, so each time a user refreshes the page a different post will appear. The snippet should be saved as a PHP template for pages and a page has to use it. Step 1. Create a new file random.php inside your active theme folder and put … Read more

How to use wp_delete_post to delete post or pages

wp_delete_post function allows us to permanently delete posts, pages, attachments. When a post is deleted, all the associated content will also be deleted, this includes the comments, custom fields, and category entries. Instructions Parameter PARAMETER TYPE DESCRIPTION DEFAULT REQUIRED $postid intiger article ID 0 no $force_delete boolean skip recycle bin and delete permanently false no … Read more