pop

Plus UI 2.6 Realtime Post Views Counter

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.

0 Response to "Plus UI 2.6 Realtime Post Views Counter"

Post a Comment

Article Top Ads

Central Ads Article 1

Middle Ads Article 2

Article Bottom Ads