Use html inside shortcode function


I know I’m bad with coding, but I tried whatever I could find on the internet, and I ended up with this, which is not giving an error, but also when using the shortcode [my_playlist] in a post, only a part is showing “Listen to the full score songs playlist frompostname”

Can you please tell me what am I doing wrong, how should I make the rest of the html after the_title(); display? thank you so much

// function that runs when shortcode is called
function wpb_playlist_shortcode() { 
// Things that you want to do. 
$string .= '<center>'  . _e(' Listen to the full score songs playlist from', 'wpml_theme') . '<strong>' . the_title();  ' </strong> 
<span class="playlist"><img class="middle" src="" /> YouTube</span> <br/> <span class="playlist2"><img class="middle" src="" /> Deezer</span> <br/><span class="playlist3"><img class="middle" src="" /> Spotify</span></center>'; 
// Output needs to be return
return $string;
// Register shortcode
add_shortcode('my_playlist', 'wpb_playlist_shortcode'); 

vyperlook 2 years 2022-01-30T16:43:42-05:00 0 Answers 0 views 0

Leave an answer