Try adding this to your functions.php
add_filter( 'sanitize_title', 'dashes_to_underscore' );
function dashes_to_underscore( $title ){
return str_replace( '-', '_', $title );
}
Ref: http://stackoverflow.com/questions/1728300/how-do-i-use-underscore-in-a-wordpress-permalink
I think i need to change my Function.php again after i upgrade to newer versions. Right? Is there any permanent solutions?
Only if you update/change theme. Updating WordPress does not affect your functions.php.
Not working 🙁 Getting that line at the top of Header
Can you provide more detail? Getting what line?
Something I should have mentioned is that block of code only convert hyphens to underscores for new posts/pages. To convert existing ones, you’ll need to run the following SQL in phpmyadmin:
UPDATE wp_posts SET post_name = replace(post_name, '-', '_');
Make sure to backup your database before running it just in case something goes wrong.
See this website. I’m testing this here: http://cidoc.info/
Where did you place it? It should be inside functions.php anywhere between the first and last line (between <?php and ?>).
If it’s in the right place then it shouldn’t display as text unless you’ve printed/echoed it.
Yah It’s working Now. Thanks for your help 🙂