Skip to content

Instantly share code, notes, and snippets.

@kary4
Created June 28, 2018 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kary4/a1c3db284ccadd872ae4edfe9c3f7105 to your computer and use it in GitHub Desktop.
Save kary4/a1c3db284ccadd872ae4edfe9c3f7105 to your computer and use it in GitHub Desktop.
<script>
jQuery( document ).ready(function() {
jQuery('.post-meta').each(function(){
var thisTime = jQuery(this).find('.published').html();
var thisCat = jQuery(this).find('a[rel="category tag"]').html();
thisCat = thisCat.replace(/,/g,'');
var thisAuthor = jQuery(this).find('.author.vcard').html();
jQuery(this).find('.published').remove();
jQuery(this).find('a[rel="category tag"]').remove();
jQuery(this).find('.author.vcard').remove();
jQuery(this).wrapInner('<span class="comments"></span>');
var thisComments = jQuery(this).find('.comments').html();
var thisMeta = jQuery(this).html();
var thisMetaNew = 'Posted on ' + thisTime + 'by Stefanni in ' + thisAuthor + ' ' + thisCat + ' ' + thisComments;
thisMetaNew = thisMetaNew.replace(/por/g,' ');
thisMetaNew = thisMetaNew.replace(/ \| \| /g,' ');
jQuery(this).html(thisMetaNew);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment