Jump to content

sandydandy89

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by sandydandy89

  1. I'm using php to generate duplicate pages with established custom fields that change for each page. So if the city/state fields were Sacramento, CA- then it would generate the url to be- www.mysite.com/my-subject-sacramento-ca. However, some pages have cities that are multiple words, like San Diego. So, when that link is generated, it links to www.mysite.com/my-subject-san diego-ca. It puts a space instead of a dash after Cape. Anyone know how to add to the statement and make it so that for cities with multiple words in the name, it adds a "-" in between in the url, not just a space?? Code below. Thanks! <li><a href="<?php bloginfo ('url') ; ?>/my-subject-<?php echo $citylower; ?>-<?php echo $statelower; ?>">My Subject <?php the_field('city_town'); ?>, <?php the_field('state_abr'); ?></a></li>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.