rdusnr

Untitled

Mar 3rd, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.30 KB | None | 0 0
  1. <?php
  2. /***************************************************
  3. JS load
  4. ***************************************************/
  5.  
  6. add_action( 'wp_enqueue_scripts', 'sq_load_javascript_files' );
  7.  
  8. // Register some javascript files
  9. function sq_load_javascript_files()
  10. {
  11. //header - modernizr.foundation
  12. wp_register_script( 'modernizr', get_template_directory_uri() . '/assets/scripts/modernizr.foundation.js' );
  13.  
  14. //footer
  15. wp_register_script( 'foundation', get_template_directory_uri() . '/assets/scripts/foundation.min.js', array('jquery'),SQUEEN_THEME_VERSION, true );
  16. wp_register_script( 'jquery-tweet','//platform.twitter.com/widgets.js', array(), '' , true );
  17. wp_register_script( 'scripts', get_template_directory_uri() . '/assets/scripts/scripts.js', array('jquery'), SQUEEN_THEME_VERSION , true );
  18. //mediaelement - audio video
  19. wp_register_script( 'mediaelement', get_template_directory_uri() . '/assets/scripts/plugins/mediaelement/build/mediaelement-and-player.min.js', array('jquery'), SQUEEN_THEME_VERSION , true );
  20. //autocomplete - jquery ui
  21. wp_register_script( 'jquery-ui-autocomplete', get_template_directory_uri() . '/assets/scripts/plugins/jquery-ui-1.10.3.custom.min.js', array('jquery'), '1.10.3' , true );
  22. // Custom JS effects, tweaks and inits
  23. wp_register_script( 'app', get_template_directory_uri() . '/assets/scripts/app.js', array('jquery','scripts'), SQUEEN_THEME_VERSION , true );
  24.  
  25. //enque them
  26. wp_enqueue_script('modernizr');
  27. wp_enqueue_script('foundation');
  28. wp_enqueue_script('scripts');
  29. wp_enqueue_script('app');
  30.  
  31. $obj_array = array(
  32. 'blank_img' => get_template_directory_uri()."/assets/images/blank.png",
  33. 'ajaxurl' => get_bloginfo('url').'/wp-admin/admin-ajax.php',
  34. 'mainColor' => sq_option('bp_header_secondary_color'),
  35. 'bpMatchBg' => sq_option('bp_match_bg_color', ''),
  36. 'bpMatchFg' => sq_option('bp_match_fg_color', ''),
  37. 'tosAlert' => apply_filters('kleo_fb_tos_alert',__("You must agree with the terms and conditions.",'kleo_framework')),
  38. 'loadingmessage' => '<i class="icon icon-refresh icon-spin"></i> '.__('Sending info, please wait...', 'kleo_framework'),
  39. );
  40. if (function_exists( 'bp_is_active' )) {
  41. $obj_array['totalMembers'] = bp_get_total_member_count();
  42. }
  43.  
  44. $obj_array = apply_filters('kleo_sript_localize_array',$obj_array);
  45.  
  46. wp_localize_script( 'app', 'kleoFramework', $obj_array );
  47.  
  48. $foundation_array = array(
  49. 'back' => __("Back", 'kleo_framework')
  50. );
  51. wp_localize_script( 'foundation', 'foundTranslated', $foundation_array );
  52. }
  53.  
  54.  
  55. /***************************************************
  56. * Adds JavaScript to pages with the comment form
  57. * to support sites with threaded comments (when in use).
  58. ***************************************************/
  59. function sweetdate_comment_script()
  60. {
  61. global $wp_styles;
  62.  
  63. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
  64. wp_enqueue_script( 'comment-reply' );
  65.  
  66. }
  67. add_action( 'wp_enqueue_scripts', 'sweetdate_comment_script' );
  68.  
  69.  
  70. /***************************************************
  71. CSS load
  72. ***************************************************/
  73. add_action( 'wp_enqueue_scripts', 'sq_load_css_files' );
  74.  
  75. function sq_load_css_files()
  76. {
  77.  
  78. // Register the style like this for a theme:
  79. wp_register_style( 'foundation', get_template_directory_uri() . '/assets/styles/foundation-nonresponsive.min.css', array(), SQUEEN_THEME_VERSION, 'all' );
  80. wp_register_style( 'foundation-responsive', get_template_directory_uri() . '/assets/styles/responsive.css', array(), SQUEEN_THEME_VERSION, 'all' );
  81.  
  82. //Plugins
  83. wp_register_style( 'sq-font-awesome', get_template_directory_uri() . '/assets/styles/font-awesome.min.css', array(), SQUEEN_THEME_VERSION, 'all' );
  84. wp_register_style( 'prettyPhoto', get_template_directory_uri() . '/assets/styles/prettyPhoto.css', array(), SQUEEN_THEME_VERSION, 'all' );
  85. //Mediaelement
  86. wp_register_style( 'mediaelement', get_template_directory_uri() . '/assets/scripts/plugins/mediaelement/build/mediaelementplayer.css', array(), SQUEEN_THEME_VERSION, 'all' );
  87. //Main Stylesheet
  88. wp_register_style( 'app', get_stylesheet_directory_uri() . '/style.css', array(), SQUEEN_THEME_VERSION, 'all' );
  89. wp_register_style( 'kleo-rtl', get_template_directory_uri() . '/rtl.css', array(), SQUEEN_THEME_VERSION, 'all' );
  90.  
  91. //enque them
  92. wp_enqueue_style( 'foundation' );
  93. wp_enqueue_style( 'sq-font-awesome' );
  94. wp_enqueue_style( 'prettyPhoto' );
  95.  
  96. //enque buddypress styles
  97. if (function_exists( 'bp_is_active' )) {
  98. wp_enqueue_style( 'bp-default-main' );
  99. }
  100.  
  101. //main stylesheet
  102. wp_enqueue_style( 'app' );
  103.  
  104. //enable/disable responsive
  105. if (sq_option('responsive_design') == 1) {
  106. wp_enqueue_style( 'foundation-responsive' );
  107. }
  108.  
  109. //enqueue child theme style only if activated
  110. if (is_child_theme()) {
  111. if (is_rtl()) {
  112. wp_enqueue_style( 'kleo-rtl' );
  113. }
  114. }
  115. }
  116. /* -----------------------------------------------------------------------------
  117. * END sq_load_css_files()
  118. */
  119.  
  120.  
  121. //render custom css resulted from theme options
  122. add_action('wp_head', 'kleo_custom_css');
  123. function kleo_custom_css()
  124. {
  125. global $kleo_sweetdate;
  126. echo $kleo_sweetdate->render_css();
  127. }
  128.  
  129. /***************************************************
  130. Custom frontend style
  131. ***************************************************/
  132.  
  133. //header background and styles
  134. $kleo_sweetdate->add_bg_css('header_background','.header-bg');
  135. $kleo_sweetdate->add_css('#header, #header .form-header .lead, #header label {color:'.sq_option('header_font_color').';} #header a:not(.button), div#main .widgets-container.sidebar_location .form-search a:not(.button), .form-search.custom input[type="text"],.form-search.custom input[type="password"], .form-search.custom select {color:'.sq_option('header_primary_color').';} #header a:not(.button):hover,#header a:not(.button):focus{color:'.sq_option('header_secondary_color').';}');
  136.  
  137. //top menu bar
  138. $kleo_sweetdate->add_css('.top-bar ul > li:not(.name):hover, .top-bar ul > li:not(.name).active, .top-bar ul > li:not(.name):focus { background: '.sq_option('menu_primary_color').';}#header .top-bar ul > li:hover:not(.name) a {color:'.sq_option('menu_color_enabled', '#fff').'}; .top-bar ul > li:not(.name):hover a, .top-bar ul > li:not(.name).active a, .top-bar ul > li:not(.name):focus a { color: '.sq_option('header_font_color').'; }.top-bar ul > li.has-dropdown .dropdown:before { border-color: transparent transparent '.sq_option('menu_primary_color').' transparent; }.top-bar ul > li.has-dropdown .dropdown li a {color: '.sq_option('header_font_color').';background: '.sq_option('menu_primary_color').';}.top-bar ul > li.has-dropdown .dropdown li a:hover,.top-bar ul > li.has-dropdown .dropdown li a:focus { background: '.sq_option('menu_secondary_color').';}.top-bar ul > li.has-dropdown .dropdown li.has-dropdown .dropdown:before {border-color: transparent '.sq_option('menu_primary_color').' transparent transparent;}');
  139.  
  140. $kleo_sweetdate->add_css('.lt-ie9 .top-bar section > ul > li a:hover, .lt-ie9 .top-bar section > ul > li a:focus { color: '.sq_option('header_font_color').'; }'.
  141. '.lt-ie9 .top-bar section > ul > li:hover, .lt-ie9 .top-bar section > ul > li:focus { background: '.sq_option('menu_primary_color').'; }'.
  142. '.lt-ie9 .top-bar section > ul > li.active { background: '.sq_option('menu_primary_color').'; color: '.sq_option('header_font_color').'; }');
  143.  
  144. //breadcrumb
  145. $kleo_sweetdate->add_bg_css('breadcrumb_background','#breadcrumbs-wrapp');
  146. $kleo_sweetdate->add_css('#breadcrumbs-wrapp, ul.breadcrumbs li:before {color:'.sq_option('breadcrumb_font_color').';} #breadcrumbs-wrapp a{color:'.sq_option('breadcrumb_primary_color').';} #breadcrumbs-wrapp a:hover,#breadcrumbs-wrapp a:focus{color:'.sq_option('breadcrumb_secondary_color').';}');
  147.  
  148. //body background
  149. $kleo_sweetdate->add_bg_css('body_background','.kleo-page');
  150. $kleo_sweetdate->add_css('div#main {color:'.sq_option('body_font_color').';}a:not(.button),div#main a:not(.button), #header .form-footer a:not(.button){color:'.sq_option('body_primary_color').';} div#main a:not(.button):hover, a:not(.button):hover,a:not(.button):focus,div#main a:not(.button):focus{color:'.sq_option('body_secondary_color').';}');
  151. //sidebar
  152. $kleo_sweetdate->add_css('div#main .widgets-container.sidebar_location {color:'.sq_option('sidebar_font_color').';} div#main .widgets-container.sidebar_location a:not(.button){color:'.sq_option('sidebar_primary_color').';} div#main .widgets-container.sidebar_location a:not(.button):hover,div#main a:not(.button):focus{color:'.sq_option('sidebar_secondary_color').';}');
  153.  
  154.  
  155. //footer background and colors
  156. $kleo_sweetdate->add_bg_css('footer_background','#footer');
  157. $kleo_sweetdate->add_css('#footer, #footer .footer-social-icons a:not(.button), #footer h5{color:'.sq_option('footer_font_color').';} #footer a:not(.button){color:'.sq_option('footer_primary_color').';} #footer a:not(.button):hover,#footer a:not(.button):focus{color:'.sq_option('footer_secondary_color').';}');
  158.  
  159.  
  160. //boxed background
  161. if (sq_option('site_style','wide-style') == 'boxed-style') :
  162. $kleo_sweetdate->add_bg_css('boxed_background','body');
  163. endif;
  164.  
  165. //Headings
  166. if(sq_option('heading')) {
  167. $kleo_sweetdate->add_typography_css('heading');
  168. }
  169.  
  170. //other primary/secondary colored elements
  171. $kleo_sweetdate->add_css('.form-search, .form-header, div.alert-box, div.pagination span.current {background:'.sq_option('button_bg_color').'}');
  172. $kleo_sweetdate->add_css('.top-links, .top-links a, .circular-progress-item input, .ajax_search_image .icon{color: '.sq_option('button_bg_color').';}');
  173. $kleo_sweetdate->add_css('.form-search .notch {border-top: 10px solid '.sq_option('button_bg_color').';}' );
  174. $kleo_sweetdate->add_css('.form-search.custom div.custom.dropdown a.current, .form-search.custom input[type="text"],.form-search.custom input[type="password"], .form-search.custom select {background-color: '.sq_option('button_bg_color_hover').'; }.form-search.custom div.custom.dropdown a.selector, .form-search.custom div.custom.dropdown a.current, .form-search.custom select { border: solid 1px '.sq_option('button_bg_color_hover').'; }');
  175. $kleo_sweetdate->add_css('.form-search.custom input[type="text"],.form-search.custom input[type="password"] {border: 1px solid '.sq_option('button_bg_color').' }');
  176. $kleo_sweetdate->add_css('.form-header, div.alert-box {color:'.sq_option('button_text_color').'}');
  177. //mediaelement
  178. $kleo_sweetdate->add_css('.mejs-controls .mejs-time-rail .mejs-time-loaded{background-color: '.sq_option('button_bg_color_hover').'; }');
  179.  
  180. //form transparency
  181. $main_color_rgb = hexToRGB(sq_option('button_bg_color_hover', '#1FA8D1'));
  182. $kleo_sweetdate->add_css('.form-search {border-left: 10px solid rgba('.$main_color_rgb['r'].', '.$main_color_rgb['g'].', '.$main_color_rgb['b'].', 0.3); border-right: 10px solid rgba('.$main_color_rgb['r'].', '.$main_color_rgb['g'].', '.$main_color_rgb['b'].', 0.3);}');
  183. $kleo_sweetdate->add_css('.form-header {border-left: 10px solid rgba('.$main_color_rgb['r'].', '.$main_color_rgb['g'].', '.$main_color_rgb['b'].', 0.3); border-top: 10px solid rgba('.$main_color_rgb['r'].', '.$main_color_rgb['g'].', '.$main_color_rgb['b'].', 0.3); border-right: 10px solid rgba('.$main_color_rgb['r'].', '.$main_color_rgb['g'].', '.$main_color_rgb['b'].', 0.3);}');
  184.  
  185. //tabs pill and callout
  186. $kleo_sweetdate->add_css('.tabs.pill.custom dd.active a, .tabs.pill.custom li.active a, div.item-list-tabs ul li a span, #profile .pmpro_label {background: '.sq_option('button_bg_color').'; color: '.sq_option('button_text_color').';}');
  187. $kleo_sweetdate->add_css('.tabs.pill.custom dd.active a:after {border-top: 10px solid '.sq_option('button_bg_color').'}');
  188. $kleo_sweetdate->add_css('.tabs.info dd.active a, .tabs.info li.active a, #object-nav ul li.current a, #object-nav ul li.selected a, .tabs.info dd.active, .tabs.info li.active, #object-nav ul li.selected, #object-nav ul li.current {border-bottom: 2px solid '.sq_option('button_bg_color').';} .tabs.info dd.active a:after, #object-nav ul li.current a:after, #object-nav ul li.selected a:after {border-top:5px solid '.sq_option('button_bg_color').';}');
  189. $kleo_sweetdate->add_css('div.item-list-tabs li#members-all.selected, div.item-list-tabs li#members-personal.selected, .section-members .item-options .selected {border-bottom: 3px solid '.sq_option('button_bg_color').';} div.item-list-tabs li#members-all.selected:after, div.item-list-tabs li#members-personal.selected:after, .section-members .item-options .selected:after {border-top: 5px solid '.sq_option('button_bg_color').'}');
  190.  
  191. //Primary Buttons
  192. $kleo_sweetdate->add_css('.button, ul.sub-nav li.current a, .item-list-tabs ul.sub-nav li.selected a, #subnav ul li.current a, .wpcf7-submit, #rtmedia-add-media-button-post-update, #rt_media_comment_submit, .rtmedia-container input[type="submit"] { border: 1px solid '.sq_option('button_bg_color').'; background: '.sq_option('button_bg_color').'; color: '.sq_option('button_text_color').'; }');
  193. $kleo_sweetdate->add_css('.button:hover, .button:focus, .form-search .button, .form-search .button:hover, .form-search .button:focus, .wpcf7-submit:focus, .wpcf7-submit:hover, #rtmedia-add-media-button-post-update:hover, #rt_media_comment_submit:hover, .rtmedia-container input[type="submit"]:hover { color: '.sq_option('button_text_color_hover').'; background-color: '.sq_option('button_bg_color_hover').'; border: 1px solid '.sq_option('button_bg_color_hover').'; }');
  194.  
  195. //Secondary Buttons
  196. $kleo_sweetdate->add_css('.button.secondary,.button.dropdown.split.secondary > a, #messages_search_submit, #rtmedia-whts-new-upload-button, #rtMedia-upload-button, #rtmedia_create_new_album,#rtmedia-nav-item-albums-li a,#rtmedia-nav-item-photo-profile-1-li a,#rtmedia-nav-item-video-profile-1-li a,#rtmedia-nav-item-music-profile-1-li a,.bp-member-dir-buttons div.generic-button a.add,.bp-member-dir-buttons div.generic-button a.remove { background-color: '.sq_option('button_secondary_bg_color').'; color: '.sq_option('button_secondary_text_color').'; border: 1px solid '.sq_option('button_secondary_bg_color').'; }');
  197. $kleo_sweetdate->add_css('.button.secondary:hover, .button.secondary:focus, .button.dropdown.split.secondary > a:hover, .button.dropdown.split.secondary > a:focus, #messages_search_submit:hover, #messages_search_submit:focus, #rtmedia-whts-new-upload-button:hover, #rtMedia-upload-button:hover, #rtmedia_create_new_album:hover,#rtmedia-nav-item-albums-li a:hover,#rtmedia-nav-item-photo-profile-1-li a:hover,#rtmedia-nav-item-video-profile-1-li a:hover,#rtmedia-nav-item-music-profile-1-li a:hover,.bp-member-dir-buttons div.generic-button a.add:hover,.bp-member-dir-buttons div.generic-button a.remove:hover { background-color: '.sq_option('button_secondary_bg_color_hover').'; border: 1px solid '.sq_option('button_secondary_bg_color_hover').'; color: '.sq_option('button_secondary_text_color_hover').'; }');
  198.  
  199. $kleo_sweetdate->add_css('.btn-profile .button.dropdown > ul, .button.dropdown.split.secondary > span {background: '.sq_option('button_secondary_bg_color').';}'.
  200. '.button.dropdown.split.secondary > span:hover, .button.dropdown.split.secondary > span:focus { background-color: '.sq_option('button_secondary_bg_color_hover').'; color: '.sq_option('button_secondary_text_color_hover').';}'.
  201. '#header .btn-profile a:not(.button) {color: '.sq_option('button_secondary_text_color').';}'.
  202. '#header .btn-profile .button.dropdown > ul li:hover a:not(.button),'.
  203. '#header .btn-profile .button.dropdown > ul li:focus a:not(.button) {background-color: '.sq_option('button_secondary_bg_color_hover').'; color:'.sq_option('button_secondary_text_color_hover').';}');
  204.  
  205. //Bordered Button
  206. $kleo_sweetdate->add_css('.button.bordered { background-color: #fff; border: 1px solid '.sq_option('button_secondary_bg_color').'; color: '.sq_option('button_secondary_text_color').'; }');
  207. $kleo_sweetdate->add_css('.button.bordered:hover,.button.bordered:focus { background-color: '.sq_option('button_secondary_bg_color_hover').'; border: 1px solid '.sq_option('button_secondary_bg_color_hover').'; color: '.sq_option('button_secondary_text_color_hover').'; }');
  208.  
  209. //Buddypress header background
  210. $bp_bg= sq_option('bp_header_background');
  211. $kleo_sweetdate->add_bg_css('bp_header_background','div#profile');
  212. $kleo_sweetdate->add_css('#profile, #profile h2, #profile span {color:'.sq_option('bp_header_font_color').';} #profile .cite a, #profile .regulartab a, #profile .btn-carousel a {color:'.sq_option('bp_header_primary_color').';} #profile .cite a:hover,#profile .cite a:focus, #profile .regulartab a:hover, #profile .regulartab a:focus, .callout .bp-profile-details:before{color:'.sq_option('bp_header_secondary_color').';}');
  213. $kleo_sweetdate->add_css('#profile .tabs.pill.custom dd.active a, #profile .pmpro_label {background: '.sq_option('bp_header_secondary_color').' }');
  214. $kleo_sweetdate->add_css('#profile:after {border-color:'.$bp_bg['color'].' transparent transparent transparent;}');
  215. //transparent items
  216. if (sq_option('bp_items_transparency') != '1')
  217. {
  218. $kleo_sweetdate->add_css('#item-header-avatar img, .mySlider img {border-color: rgba(255,255,255,'.sq_option('bp_items_transparency').') !important;}');
  219. $kleo_sweetdate->add_css('#profile .generic-button a, .tabs.pill.custom dd:not(.active) a, #profile .callout, .regulartab dt, .regulartab dd {background: rgba(255,255,255,'.sq_option('bp_items_transparency').'); color: '.sq_option('bp_header_font_color').';}');
  220. $kleo_sweetdate->add_css('#profile hr {border-color: rgba(255,255,255,'.sq_option('bp_items_transparency').');}');
  221. }
  222.  
  223. $kleo_sweetdate->add_css('.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta button, .rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta button, .rtmedia-item-actions input[type=submit] {border: 1px solid '.sq_option('button_bg_color').'; background: '.sq_option('button_bg_color').'; color: '.sq_option('button_text_color').'; }');
  224. $kleo_sweetdate->add_css('.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta button:hover, .rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta button:hover, .rtmedia-item-actions input[type=submit]:hover { color: '.sq_option('button_text_color_hover').'; background-color: '.sq_option('button_bg_color_hover').'; border: 1px solid '.sq_option('button_bg_color_hover').'; }');
  225.  
  226. //Woocommerce
  227. if (class_exists('woocommerce')):
  228. $kleo_sweetdate->add_css('.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce-page .widget_price_filter .ui-slider .ui-slider-range, .woocommerce span.onsale, .woocommerce-page span.onsale{background:'.sq_option('button_bg_color').';} .woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce-page .widget_price_filter .ui-slider .ui-slider-handle {border: 1px solid '.sq_option('button_bg_color').';background:'.sq_option('button_bg_color_hover').'}');
  229. $kleo_sweetdate->add_css('.woocommerce .widget_layered_nav_filters ul li a, .woocommerce-page .widget_layered_nav_filters ul li a { border: 1px solid '.sq_option('button_bg_color').'; background-color: '.sq_option('button_bg_color').'; color: '.sq_option('button_text_color').'; }');
  230. $kleo_sweetdate->add_css('.woocommerce div.product .woocommerce-tabs ul.tabs li.active:after, .woocommerce-page div.product .woocommerce-tabs ul.tabs li.active:after, .woocommerce #content div.product .woocommerce-tabs ul.tabs li.active:after, .woocommerce-page #content div.product .woocommerce-tabs ul.tabs li.active:after {border-top:5px solid '.sq_option('button_bg_color').'}.woocommerce #main ul.products li a.view_details_button:not(.button),.woocommerce ul.products li .add_to_cart_button:before,.woocommerce ul.products li .product_type_grouped:before,.woocommerce ul.products li .add_to_cart_button.added:before,.woocommerce ul.products li .add_to_cart_button.loading:before,.woocommerce ul.products li .product_type_external:before,.woocommerce ul.products li .product_type_variable:before, .woocommerce ul.products li .add_to_cart_button.loading,.woocommerce ul.products li .add_to_cart_button,.woocommerce ul.products li .product_type_grouped,.woocommerce ul.products li .view_details_button,.woocommerce ul.products li .product_type_external,.woocommerce ul.products li .product_type_variable{color:'.sq_option('button_bg_color').'}');
  231. $kleo_sweetdate->add_css('.woocommerce ul.products li .add_to_cart_button:hover:before, .woocommerce ul.products li .product_type_grouped:hover:before, .woocommerce ul.products li .view_details_button:hover:before, .woocommerce ul.products li .product_type_external:hover:before, .woocommerce ul.products li .product_type_variable:hover:before {color: '.sq_option('button_text_color_hover').';}');
  232. $kleo_sweetdate->add_css('.woocommerce ul.products li .add_to_cart_button:hover, .woocommerce ul.products li .product_type_grouped:hover, .woocommerce ul.products li .view_details_button:hover, .woocommerce ul.products li .product_type_external:hover, .woocommerce ul.products li .product_type_variable:hover{color: '.sq_option('button_text_color_hover').';background-color: '.sq_option('button_bg_color_hover').'}');
  233. endif;
  234.  
  235. //Squared avatars
  236. if (sq_option('squared_images', 0) == 1)
  237. {
  238. $kleo_sweetdate->add_css('.avatar,.attachment-shop_thumbnail,.carousel-profiles li,.carousel-profiles img,.buddypress.widgets ul.item-list .item-avatar,.buddypress.widgets .avatar-block .item-avatar,#bbpress-forums div.bbp-forum-author .bbp-author-avatar,#bbpress-forums div.bbp-topic-author .bbp-author-avatar,#bbpress-forums div.bbp-reply-author .bbp-author-avatar, .search-item .avatar img { border-radius: 3px !important; }');
  239. }
  240.  
  241. //mobile
  242. if (sq_option('responsive_design') == 1) {
  243. $kleo_sweetdate->add_css('@media only screen and (max-width: 940px) {.top-bar ul > li:not(.name):hover, .top-bar ul > li:not(.name).active, .top-bar ul > li:not(.name):focus { background: '.sq_option('menu_secondary_color').'; }.top-bar { background: '.sq_option('menu_primary_color').'; }.top-bar > ul .name h1 a { background: '.sq_option('menu_secondary_color').'; }.top-bar ul > li.has-dropdown.moved > .dropdown li a:hover { background: '.sq_option('menu_secondary_color').'; display: block; }.top-bar ul > li.has-dropdown .dropdown li.has-dropdown > a li a:hover, .top-bar ul > li.toggle-topbar { background: '.sq_option('menu_secondary_color').'; }}');
  244. }
  245. /* -----------------------------------------------------------------------------
  246. * END Front end style
  247. */
  248.  
  249.  
  250. /**
  251. * Retina js logo
  252. * Load high resolution logo image is we are on a retina display
  253. */
  254.  
  255. if(sq_option('logo_retina') != '')
  256. {
  257. add_action('wp_footer', 'kleo_retina_logo');
  258. }
  259.  
  260. function kleo_retina_logo()
  261. {
  262. ?>
  263. <script type="text/javascript">
  264. jQuery(document).ready(function(){
  265. if (window.devicePixelRatio > 1) {
  266. var image = jQuery("#logo_img");
  267. imageName = '<?php echo sq_option('logo_retina');?>';
  268. //rename image
  269. image.attr('src', imageName);
  270. }
  271. });
  272. </script>
  273. <?php
  274. }
  275.  
  276.  
  277. /***************************************************
  278. * TOP TOOLBAR - ADMIN BAR
  279. * Enable or disable the bar, depending of the theme option setting
  280. ***************************************************/
  281. if (sq_option('admin_bar', 1) == '0'):
  282. remove_action('wp_footer','wp_admin_bar_render',1000);
  283. add_filter('show_admin_bar', '__return_false');
  284. endif;
  285.  
  286. /***************************************************
  287. * Customize wp-login.php
  288. ***************************************************/
  289. function custom_login_css() {
  290. global $kleo_sweetdate;
  291. echo '<style>';
  292.  
  293. echo $kleo_sweetdate->get_bg_css('header_background', 'body.login');
  294.  
  295. echo "\n";
  296. echo '.login h1 a { background-image: url("'.sq_option('logo',get_template_directory_uri().'/assets/images/logo.png').'"); background-size: contain;width: 326px; min-height: 80px;}';
  297. echo '#login {padding: 20px 0 0;}';
  298. echo '.login #nav a, .login #backtoblog a {color:'.sq_option('header_primary_color').'!important;text-shadow:none;}';
  299.  
  300. echo '</style>';
  301. }
  302. add_action('login_head', 'custom_login_css');
  303.  
  304. function kleo_new_wp_login_url() { return home_url(); }
  305. add_filter('login_headerurl', 'kleo_new_wp_login_url');
  306.  
  307. function kleo_new_wp_login_title() { return get_option('blogname'); }
  308. add_filter('login_headertitle', 'kleo_new_wp_login_title');
  309. ?>
Advertisement
Add Comment
Please, Sign In to add comment