Category: WordPress


How to close the Elementor accordion by default?

The first item of Elementor accordions is opened by default. You’ll see how to close it even if you have many accordions on the same page. How to close the Elementor accordion? Copy and paste the following code to your page (see next section if you don’t know how to paste code). This plain/vanilla Javascript does not require any dependencies. It makes the Elementor accordion close both on mobile and large devices. How can you paste the code to your page? Drag & drop an HTML widget on top of the accordion and paste the code (as shown in the […]

Read More →

9+ Elementor PRO header templates [free download]

To use these header templates, you need a premium version of Elementor. After you download a header template, log in to your WordPress website, navigate to “Templates » Theme Builder » Header.” If you do not have an existing header then click “Add New” otherwise, edit the existing header. Either way, add a new template from the widget panel, go to the tab “My Templates” and upload the template that you have downloaded from here. And then insert the template to the header. That’s all! Therefore, if you still have any issues, feel free to reach out to me.

Read More →

How to create Back to Top button in Elementor PRO [without plugin]

Elementor back to top button

You can create a “Back to Top” button on the Elementor website in a few different ways. But in this post, I will show you the easiest way that will not require any additional plugins. Also, I will give you the downloadable JSON files, so you can import them on your website and create the Back to Top button in 1 minute. Elementor itself also has a helpful post about creating a back-to-top button but it does not tell you how to do it in action. I found a few videos (Youtube) when I needed this help but most of […]

Read More →

How to fix error establishing database connection [WordPress]

How to fix error establishing a database connection in WordPress

Error establishing database connection may happen due to two different reasons. I will walk you through the process to fix the issue on a priority basis. 1. Error establishing database connection for corrupted database If you had a working website in the past and if you see the ‘Error establishing database connection’ very recently or if you see the error after activating a plugin, then your database has been corrupted. Now you have to repair the database. Don’t be afraid, it’s very easy. And it will not break anything on your site if anything goes wrong. Follow the steps with […]

Read More →

How to Add Page-Slug to WordPress Body Class?

Add page slug to body

Sometimes you may need to add specific class names to the HTML body tag. WordPress has a “body_class” function that outputs the class names to the body element. In this post, I will show you different use cases of the ‘body_class’ and you’ll know the following: How to add page slug to the body class Go to your WordPress theme folder and open the “functions.php” file. Copy and paste the following code, and save the file. Go to your website & open any page, and now you’ll see the page slug to the HTML body tag. For example- if you […]

Read More →

How to Display Author Bio in WordPress Single Post (Without Plugin)

Author Bio

Do you want to display the author’s biography in every single post? In this post, I will show you how to display the author bio in every single post. The biography section will contain the photo of the author, his/her name, description, and profile link. See the top image as a reference. Navigate to your WordPress theme, and open the ‘single.php’ and paste the following code where you want to display the post author’s biography. Don’t worry, I will explain the code later: Once you save the file, you’ll see the post author’s biography. As I said earlier, it will […]

Read More →

How to Display All Authors on Your WordPress Website (without plugin)

List of authors with profile picture, name and link

Do you want to display all the authors on your WordPress website? In this post, I will show you how to display the list of authors on your website. Also, I will show you two types of author lists. The first layout will contain authors’ profile pictures, names, and profile links. And the second layout will contain the name (clickable) of the authors with post count. Let’s get started. Display all authors with profile photo, name & URL: First of all, I will give you the code and then explain. Copy & paste the following code where you want to […]

Read More →

What to do when you’re unable to reset your password (WordPress)?

Due to an SMTP issue, your WordPress website may not send password reset emails or even it may stop sending any emails. At this moment, you won’t be able to fix the issue because you have to log in to the admin dashboard. Anyways, if you forgot your username & password, and if you do not receive the password reset email, this post will walk you through the process to gain full access to your website. In some cases, people complain that their password is not working and WordPress does not send any password reset links. This could be an […]

Read More →

How to Display Related Posts in WordPress (Without Plugin)

Related posts in WordPress

In this post, I will show you how to display related posts on the WordPress website. This is a developer-level article. Don’t worry, you don’t have to be a guru, but you have to know how to edit theme/template files. Assuming, you want to display the related posts below the single post. In your theme folder, look for a file called “single.php.” This is the file that is responsible for displaying all the single posts on your WordPress website. Open this file and look for a PHP code like this: And paste the following code where the section ends (the_content), […]

Read More →

How to Add Pagination in WordPress Theme?

Follow the steps to add pagination to the WordPress website: Step 1: Navigate to your theme folder & open the “index.php” or any other archive template where you want to add the pagination. Step 2: Write the following code at the bottom of the template file: It’s not mandatory to write the code within a <nav> tag but it’s a good practice for SEO (search engine optimization) reasons. And it will also help you to write custom styles. You can even give it a CSS class or ID. Only the (above) single line of PHP code will enable pagination in […]

Read More →
up arrow