Skip to content

Instantly share code, notes, and snippets.

@jeremychurch
jeremychurch / gist:78c40a13a52368495784
Last active August 29, 2015 14:05
Maintain social button counts for WordPress posts
<!-- If you switch to https, you lose the count that appears next to Twitter and Facebook buttons.
Here's a snippet to maintain previous counts for WordPress posts published before implementing https. -->
<?php
// Change the date to the day you switched to https
// Insert the following within the WordPress theme file single.php
$url_change_date = strtotime("8/16/2014");
$post_date = strtotime(get_the_date());
$sharing_url = get_permalink();
body {
padding: 200px 0;
background: #cbcdc0;
font: 14px/150% Arial, Helvetica, sans-serif;
color: #555;
}
.table_container {
display: table;
margin: 0 auto;
}
body {
padding: 200px 0;
background: #cbcdc0;
font: 14px/150% Arial, Helvetica, sans-serif;
color: #555;
}
.table_container {
display: table;
margin: 0 auto;
}