how to add whatsapp option to social media buttons
-
First of all, I am not even close to be a programmer or a webmaster.
The theme offers the option to include social media icons in the header. I understand WhatsApp is not a social network however the messaging service offers an option so that you can publish a link, and if a visitor to the website is using a mobile device and touches that link the whatsapp app opens a chat window.
I was able to create the WhatsApp entry, it appears in the wordpress UI, also a WhatsApp icon shows in the header when you fill it.
To accomplish this I modified header.php by adding:
<?php if ( get_theme_mod( 'freebiescafe_social_media_whatsapp' ) ) { ?> <li> <a href="<?php echo esc_url( get_theme_mod( 'freebiescafe_social_whatsapp' ) ); ?>"><i class="fa fa-whatsapp"></i></a> </li> <?php } ?> </ul>
and adding to customizer.php:
$wp_customize->add_setting( 'freebiescafe_social_media_whatsapp', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'freebiescafe_sm_whatsapp', array( 'label' => __( 'WhatsApp Link', 'cafe-blog' ), 'section' => 'freebiescafe_social_media_section', 'settings' => 'freebiescafe_social_media_whatsapp', 'type' => 'url', ) ) );
Adding the whatsapp link
https://wp.me/number
apparently works without a glitch but when you click on the icon you get redirected tohttps://congregate-quota.000webhostapp.com
Obviously there is something wrong, any ideas on how to make the link work?
As i mentioned at the beginning I am not a programmer. These simple modifications to the mentioned files took hours of reading.- This topic was modified 6 years, 3 months ago by .
- This topic was modified 6 years, 3 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘how to add whatsapp option to social media buttons’ is closed to new replies.