Support

Account

Home Forums Front-end Issues Remove 'http://' from text fields Reply To: Remove 'http://' from text fields

  • Hi, mine was:

    <?php if( get_field('personal_website_or_blog_url') ): ?>
    <a href="http://<?php $site = get_field('personal_website_or_blog_url');
    $site = str_replace(array('http://', 'https://'), '', $site);
    $site = rtrim($site, '/');
    echo $site;?>" data-avia-related-tooltip="view website" target="_blank">
    <i class="fa fa-television" title="Personal Website" aria-hidden="true"></i></a>
    <?php endif; ?> 
    

    … obviously my field was ‘personal_website_or_blog_url’ so you would need to change that out for yours.