Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter deisrtty

    (@deisrtty)

    Help would be very appreciated.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    This isn’t possible, but if you want to change the HTML structure used around the phone number, then you have to change the template code for the location where you want to use the phone number.

    This filter is used to modify the search results template. The ‘More Info’ section on that page contains links to the other filters that allow you to change other templates.

    What exactly do you want to do?

    Thread Starter deisrtty

    (@deisrtty)

    Thanks for your reply.

    What I want to do is add google tag manager code to each number, so each number field would be made up of code like this, unique to each store:

    <p><span id="1" onClick="doOnClick('1', '085 46966798');">Show Number</span></p>

    Is this possible in any way?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    You can add whatever HTML you want to the results template with this filter, or to the more info template with this filter.

    The fax code would look like this, but not 100% sure it will work. I remember another user having a problem with the Google tag manager working with the store locator.

    $more_info_template .= '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . '</strong>:<span id="1" onClick="doOnClick('1', '<%= fax %>');">Show Number</span></span>' . "\r\n";

    You can just test it by copying the this code, place it in the functions.php inside your theme folder, and change the fax line to the one above.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code stripping on phone field’ is closed to new replies.