Sparkling Popular Posts Widget

Hello Colorlib,

First off all I’d like to thank you to provide newbie like me with your great WP Themes for free.
I’m using your Sparkling Theme for my small dentistry website where I try to help people to find some easy to read article about dental issues.

I have 20 posts and I’m using Sparkling Popular Posts Widget to show 7 links as shown in this page
https://www.dottox.com/gingivitis-treatments-home-remedies-symptoms-gum-disease/

If I right understood, Sparkling Popular Posts Widget, by default, displays the most recent post on top of the list and then all other posts based on their popularity.

In this moment my Sparkling Popular Posts Widget is displaying the following links

1 - Gingivitis (this is the most recent post)
2 - Dental implants
3 - Single tooth implant
4 - bone graft augmentation
5 - Dentures
6 - Wisdom teeth
7 - Mini dental implants

I think that widget is retrieving data from a specific WP table and field.

MY QUESTION: Please can you tell me the table name and the field name where WP stores those data so I can manually change their values in order to create my own “most popular posts” using Sparkling Popular Posts Widget to display my own custom list ?

Thank you in advance for your support and for any answer you will write :slight_smile:
Cordially
Roberto

Hi Roberto,

The widget is located in this file:

sparkling\inc\widgets\class-sparkling-popular-posts.php

It uses the wordpress query i.e. WP_Query to pull the posts from the wp_posts table in the database.
You can see the query being done from line 50 to 57 of that files.

Hope you can work it from there.

Thank you for your answer,

unfortunately, I discovered that the Sparkling Popular Posts Widget doesn’t show the real “Popular posts” listed by number of views but it orders and shows posts based on the date each post has been published (starting from the most old going to the most recent within the limit set in the widget itself).

HI

If you want to manually order posts on the widgets you have to a. find third-party plugins or b. you need a deep understanding of programming in php and in other languages, this is not only about to change one thing in the table or in query.
Also, i can suggest one relatively easy thing, you can manually create markup of the widget, this is the output code of current widget, you need to arrange list items in this code:

<div class="rpwe-block ">
   <ul class="rpwe-ul">
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/dental-abscess-tooth-infection-treatment-home-remedy-symptoms/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/dental-abscess-infection-posterior-teeth-100x70.jpg" alt="Dental abscess or tooth infection: treatment, home remedy, symptoms and causes"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/dental-abscess-tooth-infection-treatment-home-remedy-symptoms/" title="Permalink to Dental abscess or tooth infection: treatment, home remedy, symptoms and causes" rel="bookmark">Dental abscess or tooth infection: treatment, home remedy, symptoms and causes</a></h3>
      </li>
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/gum-boil-treatment-remedies-adults-children-pregnant-women-gum-abscess/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/pregnant-woman-with-gum-boil-100x70.jpg" alt="Gum boil treatment and remedies complete guide for adults, children and pregnant women gum abscess"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/gum-boil-treatment-remedies-adults-children-pregnant-women-gum-abscess/" title="Permalink to Gum boil treatment and remedies complete guide for adults, children and pregnant women gum abscess" rel="bookmark">Gum boil treatment and remedies complete guide for adults, children and pregnant women gum abscess</a></h3>
      </li>
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/denture-reline-cost-procedure-hard-soft-relines/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/denture-reline-procedure-100x70.jpg" alt="Denture reline: cost and procedure for hard and soft relines"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/denture-reline-cost-procedure-hard-soft-relines/" title="Permalink to Denture reline: cost and procedure for hard and soft relines" rel="bookmark">Denture reline: cost and procedure for hard and soft relines</a></h3>
      </li>
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/flexible-partial-dentures-nylon-cost-advantages/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/flexible-partial-dentures-front-teeth-100x70.jpg" alt="Flexible partial dentures or nylon denture: cost, problems and advantages"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/flexible-partial-dentures-nylon-cost-advantages/" title="Permalink to Flexible partial dentures or nylon denture: cost, problems and advantages" rel="bookmark">Flexible partial dentures or nylon denture: cost, problems and advantages</a></h3>
      </li>
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/wisdom-teeth-removal-cost-pain/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/young-guy-wisdom-tooth-pain-100x70.jpg" alt="Wisdom teeth: removal, cost, remedies, pain, recovery & complications"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/wisdom-teeth-removal-cost-pain/" title="Permalink to Wisdom teeth: removal, cost, remedies, pain, recovery & complications" rel="bookmark">Wisdom teeth: removal, cost, remedies, pain, recovery & complications</a></h3>
      </li>
      <li class="rpwe-li rpwe-clearfix">
         <a class="rpwe-img" href="https://www.dottox.com/dentures-cost-types-false-teeth/" rel="bookmark"><img class="rpwe-alignleft rpwe-thumb" src="https://www.dottox.com/wp-content/uploads/6-different-dentures-types-100x70.jpg" alt="Dentures: cost, full and partial, insurance and benefits of false teeth"></a>
         <h3 class="rpwe-title"><a href="https://www.dottox.com/dentures-cost-types-false-teeth/" title="Permalink to Dentures: cost, full and partial, insurance and benefits of false teeth" rel="bookmark">Dentures: cost, full and partial, insurance and benefits of false teeth</a></h3>
      </li>
   </ul>
</div>