Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.22 KB | None | 0 0
  1. functions.php
  2.  
  3. /**
  4.  * @package WordPress
  5.  * @subpackage Kleo
  6.  * @author SeventhQueen <themesupport@seventhqueen.com>
  7.  * @since Kleo 1.0
  8.  */
  9.  
  10. /**
  11.  * Kleo Child Theme Functions
  12.  * Add custom code below
  13. */
  14.  
  15. remove_action( 'wp_head', 'feed_links_extra', 3 );
  16. remove_action( 'wp_head', 'feed_links', 2 );
  17. remove_action( 'wp_head', 'rsd_link' );
  18. remove_action( 'wp_head', 'wlwmanifest_link' );
  19. remove_action( 'wp_head', 'index_rel_link' );
  20. remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
  21. remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
  22. remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
  23. remove_action( 'wp_head', 'wp_generator' );
  24.  
  25. /**
  26.  * add_image_size( 'wysija-newsletters-max', '600', '9999', array( "1", "") );
  27.  * add_image_size( 'rt_media_thumbnail', '150', '150', array( "1", "") );
  28.  * add_image_size( 'rt_media_activity_image', '320', '240', array( "1", "") );
  29.  * add_image_size( 'rt_media_single_image', '800', '0', false );
  30.  * add_image_size( 'rt_media_featured_image', '100', '100', array( "1", "") );
  31.  * add_image_size( 'shop_thumbnail', '180', '180', array( "1", "") );
  32.  * add_image_size( 'shop_catalog', '300', '300', array( "1", "") );
  33.  * add_image_size( 'shop_single', '600', '600', array( "1", "") );
  34.  * add_image_size( 'post-thumbnail', '672', '9999', false );
  35.  * add_image_size( 'kleo-full-width', '1038', '9999', false );
  36. */
  37.  
  38. //Remove query strings from static resources
  39.  
  40. function _remove_script_version( $src ){
  41.  
  42. $getMyUrl = site_url();
  43.  
  44.  
  45. $check = strpos($src, $getMyUrl);
  46.  
  47. if ($check !== false) {
  48.     $parts = explode( '?', $src );  
  49.     return $parts[0];
  50.     }else{
  51.  
  52.         return $src;
  53.     }
  54.  
  55. }
  56.  
  57. add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
  58. add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
  59.  
  60.  
  61. /**
  62.  * Disable the emoji's
  63.  */
  64. function disable_emojis() {
  65.     remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  66.     remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  67.     remove_action( 'wp_print_styles', 'print_emoji_styles' );
  68.     remove_action( 'admin_print_styles', 'print_emoji_styles' );   
  69.     remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  70.     remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 
  71.     remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  72.     add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
  73. }
  74. add_action( 'init', 'disable_emojis' );
  75.  
  76. /**
  77.  * Filter function used to remove the tinymce emoji plugin.
  78.  *
  79.  * @param    array  $plugins  
  80.  * @return   array             Difference betwen the two arrays
  81.  */
  82. function disable_emojis_tinymce( $plugins ) {
  83.     if ( is_array( $plugins ) ) {
  84.         return array_diff( $plugins, array( 'wpemoji' ) );
  85.     } else {
  86.         return array();
  87.     }
  88. }
  89.  
  90. ////////////////////////////////////////////////////////////////////////
  91. // BuddyPress Profile URL Integration //////////////////////////////////
  92. ////////////////////////////////////////////////////////////////////////
  93. add_filter('wpdiscuz_profile_url', 'wpdiscuz_bp_profile_url', 10, 2);
  94. function wpdiscuz_bp_profile_url($profile_url, $user) {
  95.     if ($user) {
  96.         if (class_exists('BuddyPress')) {
  97.             $profile_url = bp_core_get_user_domain($user->ID);
  98.         }
  99.     }
  100.     return $profile_url;
  101. }
  102.  
  103. ////////////////////////////////////////////////////////////////////////
  104. // Icon-vkontakte //////////////////////////////////
  105. ////////////////////////////////////////////////////////////////////////
  106. function kleo_extra_social_icons( $icons ){
  107.     $icons .= '<li><a target="_blank" href="https://vk.com/pitstop.business_GO" rel="nofollow"><i class="icon-vkontakte"></i><div class="ts-text">Vkontakte</div></a></li>';
  108.     return $icons;
  109. }
  110. add_filter( 'kleo_get_social_profiles', 'kleo_extra_social_icons' );
  111.  
  112. /////////////////////////////////////////////////////
  113. //ADD FONT AWESOME CDN WITH HTML https://fontawesomecdn.com///////////////////////////////////
  114. ////////////////////////////////////////////////////////////////////////
  115. function enqueue_our_required_stylesheets(){
  116.     wp_enqueue_style('font-awesome', 'https://opensource.keycdn.com/fontawesome/4.5.0/font-awesome.min.css');
  117. }
  118. add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement