I am trying to do something but I have problem...
I wont show the list of my post, but from all titles I want remove text after last "-" (dash)
My list of posts:
- My experience - this boy - first day - meet
- My love - i do not know - second day
- My first time - auuu - third time
I would like to return this:
- My experience - this boy - first day
- My love - i do not know
- My first time
I tried this:
<?php $stringx = get_the_title(); echo preg_replace('/-[^-]*$/', '', $stringx); ?>
But this return whole text... with the dashes....
also I tried this:
Somone could help me how to output titles of post withoust text after last '-'?