looking for a solution to my problem.
searching this place and google for an answer but can’t gain much ground.
basically I want to remove “Issue 119 – ” from a title.
so far I got the “Issue 119″ to be removed but the ” – ” is persistent sadly
can anyone help me. would love it if I could amend the $cut variable line
$grissueno is from the custom field in my wordpress post = 119 string.
the_title presents the string “Issue 119 – Editorial: Troubled on every side” (example title)
<?php
$cut = "Issue " . $grissueno; //joining the word issue and dynamic number together
$title = the_title('','',false ); //telling wordpress to let php use the title string
$trim = str_replace($cut, "", $title); //cutting out the Issue 119
echo ltrim($trim, " - "); //trying to remove the dash but failing
?>
thanks for any help
Change
$cut = "Issue " . $grissueno;to$cut = "Issue " . $grissueno . " - ";and forget aboutltrim().