Guest User

Custom Order of Social Icons

a guest
Jul 27th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.53 KB | None | 0 0
  1. <?php
  2.  
  3. // =============================================================================
  4. // FUNCTIONS.PHP
  5. // -----------------------------------------------------------------------------
  6. // Overwrite or add your own custom functions to X in this file.
  7. // =============================================================================
  8.  
  9. // =============================================================================
  10. // TABLE OF CONTENTS
  11. // -----------------------------------------------------------------------------
  12. // 01. Enqueue Parent Stylesheet
  13. // 02. Additional Functions
  14. // =============================================================================
  15.  
  16. // Enqueue Parent Stylesheet
  17. // =============================================================================
  18.  
  19. add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
  20.  
  21.  
  22.  
  23. // Additional Functions
  24. // =============================================================================
  25.  
  26. function x_soliloquy_remove_license_functionality() {}
  27.  
  28. add_action('x_after_view_global__brand', function(){
  29.  
  30. echo '<div class="logobar-widget-area">';
  31. dynamic_sidebar( "logobar-sidebar" );
  32. echo '</div><style>.logobar-widget-area { float: right; }</style>';
  33.  
  34. });
  35.  
  36. register_sidebar( array(
  37. 'name' => __( 'Logobar Widget Placement' ),
  38. 'id' => "logobar-sidebar",
  39. 'description' => '',
  40. 'class' => '',
  41. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  42. 'after_widget' => "</div>",
  43. 'before_title' => '<h3 class="widgettitle">',
  44. 'after_title' => "</h3>"
  45. ) );
  46.  
  47.  
  48.  
  49. // Custom order of social icons
  50. // =============================================================================
  51. function x_social_global() {
  52.  
  53. $facebook = x_get_option( 'x_social_facebook' );
  54. $twitter = x_get_option( 'x_social_twitter' );
  55. $google_plus = x_get_option( 'x_social_googleplus' );
  56. $linkedin = x_get_option( 'x_social_linkedin' );
  57. $xing = x_get_option( 'x_social_xing' );
  58. $foursquare = x_get_option( 'x_social_foursquare' );
  59. $youtube = x_get_option( 'x_social_youtube' );
  60. $vimeo = x_get_option( 'x_social_vimeo' );
  61. $instagram = x_get_option( 'x_social_instagram' );
  62. $pinterest = x_get_option( 'x_social_pinterest' );
  63. $dribbble = x_get_option( 'x_social_dribbble' );
  64. $flickr = x_get_option( 'x_social_flickr' );
  65. $github = x_get_option( 'x_social_github' );
  66. $behance = x_get_option( 'x_social_behance' );
  67. $tumblr = x_get_option( 'x_social_tumblr' );
  68. $whatsapp = x_get_option( 'x_social_whatsapp' );
  69. $soundcloud = x_get_option( 'x_social_soundcloud' );
  70. $rss = x_get_option( 'x_social_rss' );
  71.  
  72. $output = '<div class="x-social-global">';
  73.  
  74. if ( $instagram ) : $output .= '<a href="' . $instagram . '" class="instagram" title="Instagram" target="_blank"><i class="x-icon-instagram" data-x-icon="&#xf16d;" aria-hidden="true"></i></a>'; endif;
  75.  
  76. if ( $facebook ) : $output .= '<a href="' . $facebook . '" class="facebook" title="Facebook" target="_blank"><i class="x-icon-facebook-square" data-x-icon="&#xf082;" aria-hidden="true"></i></a>'; endif;
  77. if ( $twitter ) : $output .= '<a href="' . $twitter . '" class="twitter" title="Twitter" target="_blank"><i class="x-icon-twitter-square" data-x-icon="&#xf081;" aria-hidden="true"></i></a>'; endif;
  78. if ( $google_plus ) : $output .= '<a href="' . $google_plus . '" class="google-plus" title="Google+" target="_blank"><i class="x-icon-google-plus-square" data-x-icon="&#xf0d4;" aria-hidden="true"></i></a>'; endif;
  79. if ( $linkedin ) : $output .= '<a href="' . $linkedin . '" class="linkedin" title="LinkedIn" target="_blank"><i class="x-icon-linkedin-square" data-x-icon="&#xf08c;" aria-hidden="true"></i></a>'; endif;
  80. if ( $xing ) : $output .= '<a href="' . $xing . '" class="xing" title="XING" target="_blank"><i class="x-icon-xing-square" data-x-icon="&#xf169;" aria-hidden="true"></i></a>'; endif;
  81. if ( $foursquare ) : $output .= '<a href="' . $foursquare . '" class="foursquare" title="Foursquare" target="_blank"><i class="x-icon-foursquare" data-x-icon="&#xf180;" aria-hidden="true"></i></a>'; endif;
  82. if ( $youtube ) : $output .= '<a href="' . $youtube . '" class="youtube" title="YouTube" target="_blank"><i class="x-icon-youtube-square" data-x-icon="&#xf166;" aria-hidden="true"></i></a>'; endif;
  83. if ( $vimeo ) : $output .= '<a href="' . $vimeo . '" class="vimeo" title="Vimeo" target="_blank"><i class="x-icon-vimeo-square" data-x-icon="&#xf194;" aria-hidden="true"></i></a>'; endif;
  84.  
  85. if ( $pinterest ) : $output .= '<a href="' . $pinterest . '" class="pinterest" title="Pinterest" target="_blank"><i class="x-icon-pinterest-square" data-x-icon="&#xf0d3;" aria-hidden="true"></i></a>'; endif;
  86. if ( $dribbble ) : $output .= '<a href="' . $dribbble . '" class="dribbble" title="Dribbble" target="_blank"><i class="x-icon-dribbble" data-x-icon="&#xf17d;" aria-hidden="true"></i></a>'; endif;
  87. if ( $flickr ) : $output .= '<a href="' . $flickr . '" class="flickr" title="Flickr" target="_blank"><i class="x-icon-flickr" data-x-icon="&#xf16e;" aria-hidden="true"></i></a>'; endif;
  88. if ( $github ) : $output .= '<a href="' . $github . '" class="github" title="GitHub" target="_blank"><i class="x-icon-github-square" data-x-icon="&#xf092;" aria-hidden="true"></i></a>'; endif;
  89. if ( $behance ) : $output .= '<a href="' . $behance . '" class="behance" title="Behance" target="_blank"><i class="x-icon-behance-square" data-x-icon="&#xf1b5;" aria-hidden="true"></i></a>'; endif;
  90. if ( $tumblr ) : $output .= '<a href="' . $tumblr . '" class="tumblr" title="Tumblr" target="_blank"><i class="x-icon-tumblr-square" data-x-icon="&#xf174;" aria-hidden="true"></i></a>'; endif;
  91. if ( $whatsapp ) : $output .= '<a href="' . $whatsapp . '" class="tumblr" title="Whatsapp" target="_blank"><i class="x-icon-whatsapp" data-x-icon="&#xf232;" aria-hidden="true"></i></a>'; endif;
  92. if ( $soundcloud ) : $output .= '<a href="' . $soundcloud . '" class="soundcloud" title="SoundCloud" target="_blank"><i class="x-icon-soundcloud" data-x-icon="&#xf1be;" aria-hidden="true"></i></a>'; endif;
  93. if ( $rss ) : $output .= '<a href="' . $rss . '" class="rss" title="RSS" target="_blank"><i class="x-icon-rss-square" data-x-icon="&#xf143;" aria-hidden="true"></i></a>'; endif;
  94.  
  95. $output .= '</div>';
  96.  
  97. echo $output;
  98.  
  99. }
  100. // =============================================================================
Advertisement
Add Comment
Please, Sign In to add comment