So I got it semi-working by sticking the following functions in functions.php:
//Remove #'s on Instagram Posts
function remove_hashtags_str($string){
return str_replace('#', '',
preg_replace('/(?:#[\w-]+\s*)+$/', '', $string));
}
add_filter('the_title', 'remove_hashtags_str');
//Remove @'s on Instagram Posts
function remove_usernames($string){
return preg_replace('/@(?=[\w-]+)/', '',
preg_replace('/(?:@[\w-]+\s*)+$/', '', $string));
}
add_filter('the_title', 'remove_usernames');
My problem now is that anytime there is an apostrophe such as ‘, it’s trying to use ' but it’s actually turning it into &039.
So I now have sentences like the following:
I think it’s mine becomes: I think it&039;s mine.
Any help? Thanks