Get the latest updates, in-depth tutorials, and exclusive resources on themes, templates, and code. Stay ahead with our expert insights—join our Telegram channel today!

How to Enable Realtime Post Views Counter in Plus UI v2.6

Learn how to enable the Realtime Post Views Counter in Plus UI v2.6 using Firebase to display live blog post views.

Fineshop Design has recently launched Plus UI v2.6, bringing exciting new features compared to its predecessor, Plus UI v2.5.1. One of the key additions is the Realtime Views Counter, which allows you to display real-time blog post views using Firebase Database.

Enable Realtime Post Views Counter in Plus UI v2.6
Display live post views on your blog with Plus UI v2.6 and Firebase.

If you want to enable this feature on your blog, follow these step-by-step instructions.

Important Notes:

  • This feature will not work on older versions of Plus UI.
  • Ensure that you have updated to Plus UI v2.6.

Requirements:

✅ Firebase Account
✅ Plus UI v2.6 Template

Steps to Enable Realtime Views Count

Step 1: Create a Firebase Project

  1. Go to Firebase Console.
  2. Click Add Project and set up your project.

Step 2: Create a Firebase Database

  1. In your Firebase Project, go to Build → Realtime Database.
  2. Click Create Database and choose your region.
  3. Set the database to test mode (you can update security rules later).

Step 3: Configure Database Rules

Paste the following rules in your Firebase Database Rules section.

For a Single Blog:

{
  "rules": {
    ".read": true,
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    }
  }
}

For Multiple Blogs:

Replace BlogID_0000000000000000000 with your actual blog IDs.

{
  "rules": {
    ".read": true,
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    },
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    },
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    }
  }
}

Step 4: Copy Your Database URL

  1. Navigate to Firebase Console → Realtime Database.
  2. Copy the Database URL (e.g., https://example-rtdb.firebaseio.com).

Step 5: Update Theme HTML

  1. Open Blogger → Theme → Edit HTML.
  2. Locate the following code:
   realViews: {
     databaseUrl: "",
     abbreviation: "false"
   }
  1. Paste your Database URL:
   realViews: {
     databaseUrl: "https://example-rtdb.firebaseio.com",
     abbreviation: "false"
   }
  1. Save Changes and refresh your blog.

Enabling Abbreviated Views Count

If you prefer displaying abbreviated numbers (e.g., 67.89K instead of 67894):

  1. Open Theme HTML Editor.
  2. Locate the code:
   realViews: {
     databaseUrl: "",
     abbreviation: "false"
   }
  1. Change false to true:
   realViews: {
     databaseUrl: "",
     abbreviation: "true"
   }
  1. Save Changes and refresh your blog.

Final Words

Congratulations! 🎉 You have successfully enabled the Realtime Post Views Counter in Plus UI v2.6. This feature will enhance your blog by displaying live post views to readers, increasing engagement and credibility.

Need Help?

If you encounter any issues:

  • Visit our Contact Page.
  • Reach us on Telegram (@itisuniqueofficial_channel).

Enjoy blogging with Plus UI! 🚀

My name is It Is Unique Official, and I write news articles on current threats and trending topics. I am based in Parbhani, Maharashtra, India.

Post a Comment

Please avoid spamming in the comment section; all comments are moderated by the admin for quality and relevance.