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!
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