Found solution here, to use in_the_loop()
(but read comment below my answer too):
add_filter( 'the_content', 'custom_content' );
function custom_content( $content ) {
if ( in_the_loop() ) {
// ....
}
return $content;
}
Found solution here, to use in_the_loop()
(but read comment below my answer too):
add_filter( 'the_content', 'custom_content' );
function custom_content( $content ) {
if ( in_the_loop() ) {
// ....
}
return $content;
}