Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1351547

    I used to be able to have different phone numbers on different pges by using the following code:

    function add_custom_script(){
    ?>
    <script type=”text/javascript”>
    (function($){
    function change_topinfo() {
    $(“.page-id-12131 .phone-info span”).text(‘CALL NOW: 01604 946 543’);
    $(“.page-id-28924 .phone-info span”).text(‘CALL NOW: 01604 267 522’);
    }
    change_topinfo();
    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_script’);

    This has stopped working and i would like to be able to continue using this feature…. Help!

    #1351767

    Hey spygames,
    Thank you for your patience, I believe the Header Phone Number changed from a “span” tag to a “div”, so try this script:

    function add_custom_script(){
    ?>
    <script>
    (function($){
    function change_topinfo() {
    $('.page-id-12131 .phone-info div').text('CALL NOW: 01604 946 543');
    $('.page-id-28924 .phone-info div').text('CALL NOW: 01604 267 522');
    }
    change_topinfo();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.