• Welcome to the all-new Kolakube support, the official place to get help for Marketers Delight, XFtoWP, CryptoWP, and other WordPress products! Please login with your account details to access private support forums.

Stream 'like count' Doesn't Reset

Ray

Well-known member
Staff member
Md
Messages
431
Reaction score
213
Location
Los Angeles
Website
micra.media
I re-installed The Stream dropin, but the like-count is still where it was when I deleted it. Is there a way to reset the like count to zero? I have zero posts and 136 likes.
 

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,703
Reaction score
1,901
Even when you have nothing to say, it is still rated brilliantly. :cool:

But in all seriousness, likes are not undone by MD when a post is deleted and this would be a good enhancement to make to avoid this issue in the future.

This will be easy to undo in the database, and I will report back here with an easy to run function that will reset the likes count to zero.
 
  • Like
Reactions: Ray
Comment

Ray

Well-known member
Staff member
Md
Messages
431
Reaction score
213
Location
Los Angeles
Website
micra.media
Even when you have nothing to say, it is still rated brilliantly. :cool:

But in all seriousness, likes are not undone by MD when a post is deleted and this would be a good enhancement to make to avoid this issue in the future.

This will be easy to undo in the database, and I will report back here with an easy to run function that will reset the likes count to zero.
sounds good. Thanks
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,703
Reaction score
1,901
Ok, as promised a true hack—how to directly change the total share count total!

Paste the following into your child theme functions.php (WP admin > Appearance > Theme Editor), reload the page once, then delete. This code only needs to be run once to easily update the value in your database.

PHP:
function run_custom_script() {
    $option = md_setting();
    $option['share']['stream_likes'] = 603;
    update_option( 'marketers_delight', $option );
}
add_action( 'init', 'run_custom_script' );

Set the like count to where it needs to be. I just used this on Kolakube to update the stream likes count from the old site to the new site.

Of course, this is primitive and the Stream should learn how to do this on its own... but here's a fun workaround for now. :D
 
  • Like
Reactions: Ray
Comment

Ray

Well-known member
Staff member
Md
Messages
431
Reaction score
213
Location
Los Angeles
Website
micra.media
I needed to remove line 5 because I was getting an error, but once I did that...everything worked like a charm. Thank you sir. I am officially sitting on a pathetic 9 likes for my 19 posts...exactly how its supposed to be.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,703
Reaction score
1,901
Hmm... remove line 5, eh? That would be even more disastrous so I wonder if the error was something else?

Either way glad to see you get your hands dirty with this code snippet. :p
 
Comment
Top