If I understand your question well, your result shows your <hr>
in text form.
When you’re using esc_html__( string $text, string $domain = 'default' )
, the returned output is escaped, it means :
"
is replaced with"
&
is replaced with&
<
is replaced with<
>
is replaced with>
So your <hr>
are returning as text, not as html markups.
To fix that, you can simply move your <hr>
outside of your esc_html__()
:
<?php printf(
'<hr>'.esc_html__( 'Thoughts about '. get_the_title(), 'rainbowcats' ).'<hr>';
); ?>
Furthermore, I don’t understand what you are trying to achieve with '<span>' . get_post_meta($post->ID, 'usp_title',true) . '</span>'
as an argument of printf(format,arg)
, you should have called your arg with %s
in your first parameter. But keep in mind to keep it outside esc_html__()
!
For more information, see : https://www.w3schools.com/php/func_string_printf.asp