I have a widget that shows all the post names. All the post names are "Chapter ## - Title"
I would like the php in the widget to remove the "Chapter 1 -" or "Chapter 12 -" for example so that just the part after the Chapter is left....
|
I have a widget that shows all the post names. All the post names are "Chapter ## - Title" I would like the php in the widget to remove the "Chapter 1 -" or "Chapter 12 -" for example so that just the part after the Chapter is left.... |
|||
|
|
This is a new query loop that I use that shows the latest ten post titles/permalinks in the category mycategoryname and strips the first 15 characters from all of the titles.
If you need to select which posts to strip either 8 or 10 characters, you'd have to select them by some sort of criterea and alternate that character number. |
|||
|
|
|
You can use php strpos function with substr function go get just the part you want for example:
this will look for " - " inside the string and return all chars after it. Updatesimply change your code to this:
|
|||||||||||
|