The site is built off Wordpress and I'm getting the pages title using Wordpress function:
Code: Select all
wp_title("", false, "")Code: Select all
<?php echo ereg_replace(" ", "-", strtolower(wp_title("", false, ""))); ?>Moderator: General Moderators
Code: Select all
wp_title("", false, "")Code: Select all
<?php echo ereg_replace(" ", "-", strtolower(wp_title("", false, ""))); ?>Warning: ereg_* functions are deprecated as of PHP 5.3 and removed as of PHP 6.WithHisStripes wrote:Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients
The site is built off Wordpress and I'm getting the pages title using Wordpress function:and I'm trying to reformat it's title to all lowercase and replace spaces with dashes. It's working, except that it's adding two dashes to the beginning of the title and I'm not sure why. Can someone help?Code: Select all
wp_title("", false, "")Code: Select all
<?php echo ereg_replace(" ", "-", strtolower(wp_title("", false, ""))); ?>
Code: Select all
ereg_replace(" ", "-", trim(strtolower(wp_title("", false, ""))));
No problemWithHisStripes wrote:Awesome, that was it. Yeah I though trim() might do it but I've never used that before today. Thank you!