Hello,
I’m using shortcodes to display RSS feed in a page and several blog posts
I want to use hooks and filters to modify the output, but only if it’s in a post. The output in the page should not be modified.
I tried to use the following but it did not work
<?php
if ( is_single() && ! is_page() ) {
add_filter( ‘srr_mod_item_html’, ‘my_srr_modifier’, 10, 3 );
function my_srr_modifier( $html, $feed_url, $feed_item ){
$html[ ‘title’ ] = $html[ ‘title’ ] . ‘ extra text’;
return $html;
}
}
?>
Any help is appreciated.
Thanks