I needed to create a filter to print the name and email of users within the posts ( the_content
) they created.
The problem is that it is showing in the posts and also in the pages, I wanted to show only in POSTS, I tried it and it did not work:
function my_content($content) {
$content .= "<b>Nome do comprador:</b> " . usp_get_meta(false, 'usp-author') . "<br />";
$content .= "<b>Email do comprador:</b> " . usp_get_meta(false, 'usp-email');
return $content;
}
if (!is_page_template('page.php'))
remove_filter('the_content','my_content');
else
add_filter('the_content','my_content');
It shows right on the posts, but it's printing on the pages too (Buyer Name: and Buyer Email :). How do I remove these impressions from the pages?