Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ADD TO BOTTOM OF FUNCTIONS.PHP
- // Show sticky app links for Apple and Google Play Stores
- add_action( 'wp_footer', 'show_google_apple_app_link_cbf',100 );
- function show_google_apple_app_link_cbf() {
- if(is_front_page() || is_home())return;
- $apple_link = get_field('app_store_link');
- $apple_image = get_field('app_store_image');
- $google_link = get_field('google_store_link');
- $google_image = get_field('google_store_image');
- if($apple_image){
- $apple_image = $apple_image['url'];
- }else{
- $apple_image = wp_get_attachment_image_src(5177);
- $apple_image = ($apple_image)? $apple_image[0] : '';
- }
- if($google_image){
- $google_image = $google_image['url'];
- }else{
- $google_image = wp_get_attachment_image_src(5190);
- $google_image = ($google_image)? $google_image[0] : '';
- }
- //
- if($apple_link){
- ?>
- <div id="apple-sticky-button">
- <a href="<?php echo $apple_link; ?>" target="_blank">
- <img src="<?php echo $apple_image; ?>" alt="Apple">
- </a>
- </div>
- <?php
- }
- //
- if($google_link){
- ?>
- <div id="google-sticky-button">
- <a href="<?php echo $google_link; ?>">
- <img src="<?php echo $google_image; ?>" alt="Google">
- </a>
- </div>
- <?php
- }
- }
- // ADD TO CHILD THEME EDITOR STYLE.CSS
- /*----- [ STICKY BUTTONS FOR APPLE GOOGLE PLAY STORES ] -----*/
- #apple-sticky-button {
- position: fixed;
- right: -169px!important;
- /* top: 392px; */
- bottom: 236px;
- width: 200px!important;
- height: 25px!important;
- z-index: 99999;
- }
- #google-sticky-button {
- position: fixed;
- right: -170px!important;
- /* top: 510px; */
- bottom: 120px;
- width: 200px!important;
- height: 25px!important;
- z-index: 99999;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement