Note that the_permalink_rss()
and the_excerpt_rss()
do echo the output, not return it.
With your current snippet, replace the_excerpt_rss()
with:
apply_filters( 'the_excerpt_rss', get_the_excerpt() );
and replace the_permalink_rss()
with:
esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );
You could also use:
<content:encoded><![CDATA[
<?php the_excerpt_rss(); ?>
<a href="https://wordpress.stackexchange.com/questions/245310/<?php the_permalink_rss(); ?>">
<?php esc_html_e( 'Read more', 'mydomain' );?>
</a>
<?php esc_html_e( 'at', 'mydomain' );?>
<?php the_permalink_rss(); ?>
?>]]></content:encoded>
where you strip the RSS excerpt through the the_excerpt_rss
filter or use the above approach to get the excerpt output to strip it.
You could also try using printf
with:
<content:encoded><![CDATA[%s <a href="https://wordpress.stackexchange.com/questions/245310/%s">%s</a> %s %s]]></content:encoded>
etc.