Lengthy story short, I am utilizing a buggy WordPress template and we are too much into development to alter. Great news is the fact that we simply have one item left to cope with and also the relaxation I have had the opportunity to compromise away at with my beginner PHP abilities and some help from a buddy.

The home page from the template grabs all posts and produces a thumbnail. What I wish to do is have individuals links visit the corresponding page.

I simply need to then add code any posts page that alter the URL after WP's output

<li><a href='localhost/brian/vhs_or_beta' title='VHS or Beta'>VHS or Beta</a></li>
<li><a href='localhost/brian/the_ettes' title='The Ettes'>The Ettes</a></li>

becomes

<li><a href='localhost/brian/vhs-or-beta' title='VHS or Beta'>VHS or Beta</a></li>
<li><a href='localhost/brian/the-ettes' title='The Ettes'>The Ettes</a></li>

by altering "_" to "-"

Simply to be obvious, I still want the page to attract while using latest posts however i would like them to connect to their corresponding page. I understand it's repetitive but with regard to clearness I have used exactly the same names but I have used "_" to point publish, and "-" to point page.

I believed today would be also a great day to understand PHP regex but you will find only 4 links and it is not altering in the near future.

My real question is maybe it's a better idea to get this done having a separate PHP script instead of attempt to hack Wordpress....in either case I am from my depth however i a minimum of wish to start trying in the best place.

I am convinced that the simplest way will be a small PHP script that will simple search 4 explicit Web addresses showing up in <a href> and altering them for 4 specific options.

Can anybody produce some guidance here?

You can test something similar to

<li><a href='<? echo preg_replace('/_/','-',$url); ?>' title='<? echo $title; ?>'><? echo $title; ?></a></li>

For more information see PHP preg_replace function