Split titles by the ” – ” in WordPress
i’ve already solved it, i had to change the $title = get_the_title(); to $title = get_post()->post_title; in the end it looks like that: <?php $title = get_post()->post_title; // Get the title string $parts = explode(‘ – ‘, str_replace(‘–’, ‘-‘, $title)); // Replace em dash with en dash and split the title $artist = trim($parts[0]); // … Read more