Advertisement
MrPauloeN

Social Icons functionality

Sep 13th, 2020
1,025
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1.     /*
  2.      * Social Icons functionality
  3.      *
  4.      * Adds icon `width` and `height` properties inline
  5.      *
  6.      * @since The Bootstrap Blog 0.1
  7.      */
  8.  
  9.     $icon_dimensions = get_theme_mod ( 'icon_dimensions', 32 );
  10.     $icon_dimensions_css = '.icon {width:' . $icon_dimensions .'px;height:' . $icon_dimensions .'px;}';
  11.     wp_add_inline_style( 'the-bootstrap-blog', esc_attr ( $icon_dimensions_css ) );
  12.  
  13.  
  14.     if ( get_theme_mod( 'social_icons', true ) ) {
  15.  
  16.     $class = 'd-inline';
  17.     $gt = 'icon icon-github';
  18.     $tw = 'icon icon-twitter';
  19.     $fb = 'icon icon-facebook';
  20.  
  21.     $icon_github = '.icon-github {background: url("' . get_template_directory_uri() . '/images/social-github.svg");}';
  22.     $icon_twitter = '.icon-twitter {background: url("' . get_template_directory_uri() . '/images/social-twitter.svg");}';
  23.     $icon_facebook = '.icon-facebook {background: url("' . get_template_directory_uri() . '/images/social-facebook.svg");}';
  24.  
  25.     wp_add_inline_style( 'the-bootstrap-blog', $icon_github . $icon_twitter . $icon_facebook );
  26.  
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement