Stay tuned for the new Free Subscribe

Plus UI 2.6 Realtime Post Views Counter

Plus UI 2.6.1 & Plus UI 2.6.2 Realtime Post Views Counter
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
plus-ui-realtime-views

Realtime Views Counter has been added in Plus UI 2.6.1 & Plus UI 2.6.2, which shows the Realtime views of your Blog Posts with the help of Firebase Database.

To enable it on your Blog, follow these simple steps:

Step 1: create a project in Firebase

plus-ui-realtime-views

Type your project name

plus-ui-realtime-views

Click on Continue

plus-ui-realtime-views

Select Default account for firebase and click on Create project

plus-ui-realtime-views

Step 2: Create Database for your Project.

Click on Build section then open Realtime database

plus-ui-realtime-views

Click on Create Database

plus-ui-realtime-views

Click on Next

plus-ui-realtime-views

Click on Enable

plus-ui-realtime-views

Step 3: Open rules section and paste the following code

plus-ui-realtime-views

For 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"
      }
    }
  }
}

If you want to add more than one blog to your database, use the following rules:

For Multiple Blogs:

{
  "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: get your Blog ID

Go to posts then you will find your blog id in the top

plus-ui-realtime-views

Copy your blog id and replace it in the database rules then click on publish

plus-ui-realtime-views

Step 5: Now copy the Database URL.

plus-ui-realtime-views

Step 6: Go to Theme then Edit HTML.

plus-ui-realtime-views

Step 7: Find the following codes:

realViews: {
  databaseUrl: "",
  abbreviation: "false"
}

Paste your Database URL, it will look something like following

plus-ui-realtime-views

Step 8: Save Changes and refresh your Blog Page.

Now you can enjoy with the Realtime post view and all the features.

Tutorial video

If you encounter any problem, do not hesitate to contact us

Copyright: @hani2up

About the Author

I'm From Tunisia, My birthday date is 02/05/2000, Generally i like learning. I'm a beginner in programming and designing. I want to share with you what i tried and learned, so that you may benefit. You can find us by typing: @hani2up

1 comment

  1. Mukhamad Azis T.
    This comment has been removed by the author.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Site is Blocked
Sorry! This site is not available in your country.