-
AuthorPosts
-
October 28, 2017 at 10:29 pm #870031
Hi,
I used the logo position to add our phone number, check http://www.splinter.care
Is it possible to add some code so that on a iPhone clicking on the logo makes the iPhone call this number?Thanks for helping!
Best regards
SylviaOctober 30, 2017 at 6:54 am #870358Hey sniper-x,
Please add following code to Functions.php file in Appearance > Editor
add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link) { $link = "tel:0401786376"; return $link; }
Adjust the number to whatever you need.
Best regards,
Jordan ShannonOctober 30, 2017 at 10:02 am #870393Hi Jordan,
I work with a child theme and if I add your code the website doesn’t work. Below my functions.php child theme code.
Can you help me out?
Best regards
Sylvia——
<?php
/*logo per pagina wijzigen*/
add_filter(‘avf_logo’,’av_change_logo’);
function av_change_logo($logo)
{
if( is_page(3364) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3385) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3403) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3416) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3626) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3813) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png”;
}if( is_page(3542) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummercyaan.png”;
}if( is_page(3695) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummercyaan.png”;
}if( is_page(3568) ) {
$logo = “https://splinter.care/wp-content/uploads/2017/09/Telefoonnummercyaan.png”;
}
return $logo;add_filter(‘avf_logo_link’,’av_change_logo_link’);
function av_change_logo_link($link)
{
$link = “tel:0031850657349”;
return $link;
}
/*
* Add your own functions here. You can also copy some of the theme functions into this file.
* WordPress will use those functions instead of the original functions then.
*/October 30, 2017 at 10:24 am #870398first of all – you can simplify a bit this by using arrays:
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if ( is_page( array( 3364, 3385, 3403, 3416, 3626, 3813 ) ) ) { $logo = "https://splinter.care/wp-content/uploads/2017/09/Telefoonnummermagenta.png"; } elseif ( is_page( array( 3542, 3568, 3695 ) ) ) { $logo = "https://splinter.care/wp-content/uploads/2017/09/Telefoonnummercyaan.png"; } return $logo; } add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link) { $link = "tel:0031850657349"; return $link; }
i do not see a fault on your code – even the if, if, if must work. (only the double marks – but this is due to boardsoft and not using the code tag)
October 30, 2017 at 10:29 am #870399ah – you have forgotton one closing curly bracket after return logo. !
on if clauses you can have nice things like:
if ( is_singular( 'event' ) || is_search( ) || is_category( ) || is_page( ) && !is_page(1307) || is_singular( 'portfolio' ) ) {
the
||
marks the or and the!
. means not- This reply was modified 7 years ago by Guenni007.
October 30, 2017 at 10:39 am #870402Sometimes it’s a simple solution :-)
Thanks for checking!!
It works
Best regards
SylviaOctober 31, 2017 at 5:10 am #870722Hi,
I’m glad you were able to get this corrected. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘make iphone call number by clicking on a image’ is closed to new replies.