Wordpress, remove everything before a specific character
<p>I need to remove everything before a specific character in Wordpress Title</p>

<p>I already tried different codes i found here but i couldnt get it working
i need something like this</p>

<pre><code>echo strstr(get_the_title(),"-",true);
</code></pre>

<p>or</p>

<pre><code>echo $str = 'get_the_title()';
$str = substr($str, 0, strpos($str, '-'));
</code></pre>

<p>The first code just outputs the normal Title</p>

<p>On the second im not sure how i can run a php code instead of normal characters.</p>

<p>Update:</p>

<p>I got it working now thanks to harryg &amp; jrod</p>

<pre><code>$str = get_the_title(); //This would be your post title (get_the_title)
$char =  " - "; //Define the separator
$strpos = strpos($str, $char); //Find out where it occurs
$str = substr($str, $strpos+strlen($char)); //Extract the substring after the separator
echo $str;
</code></pre>

<p>for some reason wordpress conversates my hpyhen to a en-dash so i added it</p>

<pre><code>remove_filter( 'the_title', 'wptexturize' );
</code></pre>

<p>to my funtions.php and it worked. Maybe it helps someone in the future. Thanks for all answers!</p>
