The code i’m tryng to add is this but didn’t work
add_filter( 'the_content', 'my_the_content_filter', 20 );
/**
* Add a icon to the beginning of every post page.
*
* @uses is_single()
*/
function my_the_content_filter( $content ) {
if ( is_single() )
// Add image to the beginning of each page
$content = sprintf(
'<a href='<?php the_permalink() ?>'
rel='bookmark' title='<?php the_title(); ?>'><img src='https://www.mysite.com/dir/<?php $category = get_the_category();
$firstCategory = $category[0]->cat_name; echo $firstCategory;?>/<?php the_title() ?>/cover/0001.jpg'
rel='bookmark' title='<?php the_title(); ?>'>
</img></a>',
get_bloginfo( 'stylesheet_directory' ),
$content
);
// Returns the content.
return $content;
}