output.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <?php
  2. /**
  3. * This file adds the required CSS for the Customizer to the Captivating Theme.
  4. *
  5. * @package Captivating
  6. * @subpackage Customizations
  7. * @link http://restored316designs.com/themes
  8. * @author Lauren Gaige // Restored 316 LLC
  9. * @copyright Copyright (c) 2015, Restored 316 LLC, Released 08/09/2017
  10. * @license GPL-2.0+
  11. */
  12. add_action( 'wp_enqueue_scripts', 'captivating_css' );
  13. /**
  14. * Checks the settings for the link color color, primary color, and header
  15. * If any of these value are set the appropriate CSS is output
  16. *
  17. * @since 1.0.0
  18. */
  19. function captivating_css() {
  20. $handle = defined( 'CHILD_THEME_NAME' ) && CHILD_THEME_NAME ? sanitize_title_with_dashes( CHILD_THEME_NAME ) : 'child-theme';
  21. $color_text = get_theme_mod( 'captivating_text_color', captivating_customizer_get_default_text_color() );
  22. $color_links = get_theme_mod( 'captivating_links_color', captivating_customizer_get_default_links_color() );
  23. $color_linkshover = get_theme_mod( 'captivating_linkshover_color', captivating_customizer_get_default_linkshover_color() );
  24. $color_button = get_theme_mod( 'captivating_button_color', captivating_customizer_get_default_button_color() );
  25. $color_buttonborder = get_theme_mod( 'captivating_buttonborder_color', captivating_customizer_get_default_buttonborder_color() );
  26. $color_buttontext = get_theme_mod( 'captivating_buttontext_color', captivating_customizer_get_default_buttontext_color() );
  27. $color_buttonhover = get_theme_mod( 'captivating_buttonhover_color', captivating_customizer_get_default_buttonhover_color() );
  28. $color_buttonhoverborder = get_theme_mod( 'captivating_buttonhoverborder_color', captivating_customizer_get_default_buttonhoverborder_color() );
  29. $color_buttonhovertext = get_theme_mod( 'captivating_buttonhovertext_color', captivating_customizer_get_default_buttonhovertext_color() );
  30. $color_announcement = get_theme_mod( 'captivating_announcement_color', captivating_customizer_get_default_announcement_color() );
  31. $color_announcementtext = get_theme_mod( 'captivating_announcementtext_color', captivating_customizer_get_default_announcementtext_color() );
  32. $color_featured = get_theme_mod( 'captivating_featured_color', captivating_customizer_get_default_featured_color() );
  33. $color_newsletter = get_theme_mod( 'captivating_newsletter_color', captivating_customizer_get_default_newsletter_color() );
  34. $color_newslettertext = get_theme_mod( 'captivating_newslettertext_color', captivating_customizer_get_default_newslettertext_color() );
  35. $color_cta = get_theme_mod( 'captivating_cta_color', captivating_customizer_get_default_cta_color() );
  36. $color_ctatext = get_theme_mod( 'captivating_ctatext_color', captivating_customizer_get_default_ctatext_color() );
  37. $color_footer = get_theme_mod( 'captivating_footer_color', captivating_customizer_get_default_footer_color() );
  38. $color_footertext = get_theme_mod( 'captivating_footertext_color', captivating_customizer_get_default_footertext_color() );
  39. $color_readmorelink = get_theme_mod( 'captivating_readmorelink_color', captivating_customizer_get_default_readmorelink_color() );
  40. $color_widgettitle1 = get_theme_mod( 'captivating_widgettitle1_color', captivating_customizer_get_default_widgettitle1_color() );
  41. $color_widgettitle2 = get_theme_mod( 'captivating_widgettitle2_color', captivating_customizer_get_default_widgettitle2_color() );
  42. $color_widgettitle3 = get_theme_mod( 'captivating_widgettitle3_color', captivating_customizer_get_default_widgettitle3_color() );
  43. $color_sidebarwidgettitle1 = get_theme_mod( 'captivating_sidebarwidgettitle1_color', captivating_customizer_get_default_sidebarwidgettitle1_color() );
  44. $color_sidebarwidgettitle2 = get_theme_mod( 'captivating_sidebarwidgettitle2_color', captivating_customizer_get_default_sidebarwidgettitle2_color() );
  45. $color_sidebarwidgettitle3 = get_theme_mod( 'captivating_sidebarwidgettitle3_color', captivating_customizer_get_default_sidebarwidgettitle3_color() );
  46. $color_morecategory1 = get_theme_mod( 'captivating_morecategory1_color', captivating_customizer_get_default_morecategory1_color() );
  47. $color_morecategory2 = get_theme_mod( 'captivating_morecategory2_color', captivating_customizer_get_default_morecategory2_color() );
  48. $color_morecategory3 = get_theme_mod( 'captivating_morecategory3_color', captivating_customizer_get_default_morecategory3_color() );
  49. $css = '';
  50. $css .= ( captivating_customizer_get_default_text_color() !== $color_text ) ? sprintf( '
  51. body,
  52. .entry-title a,
  53. .sidebar .widget-title a,
  54. .widget-title,
  55. h1, h2, h3, h4, h5, h6,
  56. .site-title a,
  57. .site-title a:hover,
  58. .genesis-nav-menu a {
  59. color: %1$s;
  60. }
  61. .slick-arrow {
  62. color: %1$s !important;
  63. }
  64. *::-moz-placeholder {
  65. color: %1$s;
  66. }
  67. ', $color_text ) : '';
  68. $css .= ( captivating_customizer_get_default_links_color() !== $color_links ) ? sprintf( '
  69. a,
  70. .entry-title a:hover,
  71. .genesis-nav-menu a:hover,
  72. .genesis-nav-menu .current-menu-item > a,
  73. .single-post .entry-content h1, .page .entry-content h1,
  74. .single-post article h3, .page article h3,
  75. .single-post article h4, .page article h4,
  76. .archive-pagination li a,
  77. .woocommerce .product-title:hover {
  78. color: %1$s;
  79. }
  80. .archive-pagination .active a,
  81. .archive-pagination li a:hover,
  82. a.wprm-jump-to-recipe-shortcode {
  83. border-color: %1$s;
  84. }
  85. .woocommerce .woocommerce-message,
  86. .woocommerce .woocommerce-info {
  87. border-top-color: %1$s !important;
  88. }
  89. .woocommerce .woocommerce-message::before,
  90. .woocommerce .woocommerce-info::before,
  91. .woocommerce div.product p.price,
  92. .woocommerce div.product span.price,
  93. .woocommerce ul.products li.product .price,
  94. .woocommerce form .form-row .required,
  95. .ninja-forms-req-symbol,
  96. .nf-error-msg,
  97. .slick-arrow:hover {
  98. color: %1$s !important;
  99. }
  100. .woocommerce .site-inner #respond input#submit,
  101. .woocommerce .site-inner a.button,
  102. .woocommerce .site-inner button.button,
  103. .woocommerce .site-inner input.button {
  104. color: %1$s !important;
  105. }
  106. .woocommerce .site-inner #respond input#submit,
  107. .woocommerce .site-inner a.button,
  108. .woocommerce .site-inner button.button,
  109. .woocommerce .site-inner input.button {
  110. border-color: %1$s !important;
  111. }
  112. ', $color_links ) : '';
  113. $css .= ( captivating_customizer_get_default_linkshover_color() !== $color_linkshover ) ? sprintf( '
  114. a:hover {
  115. color: %1$s;
  116. }
  117. .woocommerce #respond input#submit:hover,
  118. .woocommerce a.button:hover,
  119. .woocommerce button.button:hover,
  120. .woocommerce input.button:hover {
  121. color: %1$s !important;
  122. }
  123. .woocommerce #respond input#submit:hover,
  124. .woocommerce a.button:hover,
  125. .woocommerce button.button:hover,
  126. .woocommerce input.button:hover {
  127. border-color: %1$s !important;
  128. }
  129. a.wprm-jump-to-recipe-shortcode:hover {
  130. border-color: %1$s;
  131. }
  132. ', $color_linkshover ) : '';
  133. $css .= ( captivating_customizer_get_default_button_color() !== $color_button ) ? sprintf( '
  134. button, input[type="button"],
  135. input[type="reset"],
  136. input[type="submit"], .button,
  137. .site-wide-cta .enews-widget input[type="submit"],
  138. .announcement-widget .enews-widget input[type="submit"],
  139. div.ck_form .ck_subscribe_button,
  140. .woocommerce .announcement-widget .button {
  141. background-color: %1$s;
  142. }
  143. ', $color_button ) : '';
  144. $css .= ( captivating_customizer_get_default_buttonborder_color() !== $color_buttonborder ) ? sprintf( '
  145. button, input[type="button"],
  146. input[type="reset"],
  147. input[type="submit"], .button,
  148. .site-wide-cta .enews-widget input[type="submit"],
  149. .announcement-widget .enews-widget input[type="submit"],
  150. div.ck_form .ck_subscribe_button,
  151. .woocommerce .announcement-widget .button {
  152. border-color: %1$s;
  153. }
  154. ', $color_buttonborder ) : '';
  155. $css .= ( captivating_customizer_get_default_buttontext_color() !== $color_buttontext ) ? sprintf( '
  156. button, input[type="button"],
  157. input[type="reset"],
  158. input[type="submit"], .button,
  159. .site-wide-cta .enews-widget input[type="submit"],
  160. .announcement-widget .enews-widget input[type="submit"],
  161. div.ck_form .ck_subscribe_button,
  162. .woocommerce .announcement-widget .button {
  163. color: %1$s;
  164. }
  165. ', $color_buttontext ) : '';
  166. $css .= ( captivating_customizer_get_default_buttonhover_color() !== $color_buttonhover ) ? sprintf( '
  167. button, input[type="button"]:hover,
  168. input[type="reset"]:hover,
  169. input[type="submit"]:hover,
  170. .button:hover,
  171. .site-wide-cta .enews-widget input[type="submit"]:hover,
  172. .announcement-widget .enews-widget input[type="submit"]:hover,
  173. .woocommerce .announcement-widget .button:hover {
  174. background-color: %1$s;
  175. }
  176. .woocommerce span.onsale {
  177. background-color: %1$s !important;
  178. }
  179. .nc_socialPanel.swp_d_fullColor .googlePlus,
  180. body .nc_socialPanel.swp_o_fullColor:hover .googlePlus,
  181. html body .nc_socialPanel.swp_i_fullColor .googlePlus:hover,
  182. .nc_socialPanel.swp_d_fullColor .twitter, body .nc_socialPanel.swp_o_fullColor:hover .twitter, html body .nc_socialPanel.swp_i_fullColor .twitter:hover,
  183. .nc_socialPanel.swp_d_fullColor .swp_fb, body .nc_socialPanel.swp_o_fullColor:hover .swp_fb, html body .nc_socialPanel.swp_i_fullColor .swp_fb:hover,
  184. .nc_socialPanel.swp_d_fullColor .linkedIn, body .nc_socialPanel.swp_o_fullColor:hover .linkedIn, html body .nc_socialPanel.swp_i_fullColor .linkedIn:hover,
  185. .nc_socialPanel.swp_d_fullColor .nc_pinterest, body .nc_socialPanel.swp_o_fullColor:hover .nc_pinterest, html body .nc_socialPanel.swp_i_fullColor .nc_pinterest:hover,
  186. .nc_socialPanel.swp_d_fullColor .swp_stumbleupon, body .nc_socialPanel.swp_o_fullColor:hover .swp_stumbleupon, html body .nc_socialPanel.swp_i_fullColor .swp_stumbleupon:hover{
  187. background-color: %1$s !important;
  188. }
  189. ', $color_buttonhover ) : '';
  190. $css .= ( captivating_customizer_get_default_buttonhoverborder_color() !== $color_buttonhoverborder ) ? sprintf( '
  191. button, input[type="button"]:hover,
  192. input[type="reset"]:hover,
  193. input[type="submit"]:hover,
  194. .button:hover,
  195. .site-wide-cta .enews-widget input[type="submit"]:hover,
  196. .announcement-widget .enews-widget input[type="submit"]:hover,
  197. .woocommerce .announcement-widget .button:hover {
  198. border-color: %1$s;
  199. }
  200. ', $color_buttonhoverborder ) : '';
  201. $css .= ( captivating_customizer_get_default_buttonhovertext_color() !== $color_buttonhovertext ) ? sprintf( '
  202. button, input[type="button"]:hover,
  203. input[type="reset"]:hover,
  204. input[type="submit"]:hover,
  205. .button:hover,
  206. .site-wide-cta .enews-widget input[type="submit"]:hover,
  207. .announcement-widget .enews-widget input[type="submit"]:hover,
  208. .woocommerce .announcement-widget .button:hover {
  209. color: %1$s;
  210. }
  211. ', $color_buttonhovertext ) : '';
  212. $css .= ( captivating_customizer_get_default_announcement_color() !== $color_announcement ) ? sprintf( '
  213. .announcement-widget {
  214. background-color: %1$s;
  215. }
  216. ', $color_announcement ) : '';
  217. $css .= ( captivating_customizer_get_default_announcementtext_color() !== $color_announcementtext ) ? sprintf( '
  218. .announcement-widget {
  219. color: %1$s;
  220. }
  221. ', $color_announcementtext ) : '';
  222. $css .= ( captivating_customizer_get_default_featured_color() !== $color_featured ) ? sprintf( '
  223. .home-featured,
  224. .above-blog-content {
  225. background-color: %1$s !important;
  226. }
  227. ', $color_featured ) : '';
  228. $css .= ( captivating_customizer_get_default_newsletter_color() !== $color_newsletter ) ? sprintf( '
  229. .sidebar .enews-widget,
  230. .category-index .widget_categories,
  231. div.ck_form,
  232. .author-box {
  233. background-color: %1$s;
  234. }
  235. ', $color_newsletter ) : '';
  236. $css .= ( captivating_customizer_get_default_newslettertext_color() !== $color_newslettertext ) ? sprintf( '
  237. .sidebar .enews-widget,
  238. .category-index .widget_categories,
  239. div.ck_form,
  240. .category-index .widget_categories .widget-title,
  241. .category-index ul li a,
  242. .sidebar-primary .enews-widget .widgettitle,
  243. div.ck_form_content h3, div.ck_label,
  244. .author-box {
  245. color: %1$s;
  246. }
  247. ', $color_newslettertext ) : '';
  248. $css .= ( captivating_customizer_get_default_cta_color() !== $color_cta ) ? sprintf( '
  249. .site-wide-cta {
  250. background-color: %1$s;
  251. }
  252. ', $color_cta ) : '';
  253. $css .= ( captivating_customizer_get_default_ctatext_color() !== $color_ctatext ) ? sprintf( '
  254. .site-wide-cta p {
  255. color: %1$s;
  256. }
  257. ', $color_ctatext ) : '';
  258. $css .= ( captivating_customizer_get_default_footer_color() !== $color_footer ) ? sprintf( '
  259. .site-footer,
  260. .genesis-nav-menu .sub-menu {
  261. background-color: %1$s;
  262. }
  263. .genesis-nav-menu .sub-menu::after {
  264. border-bottom-color: %1$s;
  265. }
  266. ', $color_footer ) : '';
  267. $css .= ( captivating_customizer_get_default_footertext_color() !== $color_footertext ) ? sprintf( '
  268. .site-footer,
  269. .site-footer a,
  270. .genesis-nav-menu .sub-menu a {
  271. color: %1$s;
  272. }
  273. ', $color_footertext ) : '';
  274. $css .= ( captivating_customizer_get_default_readmorelink_color() !== $color_readmorelink ) ? sprintf( '
  275. a.more-link {
  276. color: %1$s;
  277. border-color: %1$s;
  278. }
  279. ', $color_readmorelink ) : '';
  280. $css .= ( captivating_customizer_get_default_widgettitle1_color() !== $color_widgettitle1 ) ? sprintf( '
  281. .front-page .content .widget-title {
  282. border-color: %1$s !important;
  283. }
  284. .category-index .widget-title {
  285. border-color: %1$s;
  286. }
  287. ', $color_widgettitle1 ) : '';
  288. $css .= ( captivating_customizer_get_default_widgettitle2_color() !== $color_widgettitle2 ) ? sprintf( '
  289. .front-page .content .widget:nth-of-type(3n+2) .widget-title {
  290. border-color: %1$s !important;
  291. }
  292. .category-index .widget:nth-of-type(3n+2) .widget-title {
  293. border-color: %1$s;
  294. }
  295. ', $color_widgettitle2 ) : '';
  296. $css .= ( captivating_customizer_get_default_widgettitle3_color() !== $color_widgettitle3 ) ? sprintf( '
  297. .front-page .content .widget:nth-of-type(3n+3) .widget-title {
  298. border-color: %1$s !important;
  299. }
  300. .category-index .widget:nth-of-type(3n+3) .widget-title {
  301. border-color: %1$s;
  302. }
  303. ', $color_widgettitle3 ) : '';
  304. $css .= ( captivating_customizer_get_default_sidebarwidgettitle1_color() !== $color_sidebarwidgettitle1 ) ? sprintf( '
  305. .sidebar-primary .widgettitle::after {
  306. background: %1$s;
  307. }
  308. ', $color_sidebarwidgettitle1 ) : '';
  309. $css .= ( captivating_customizer_get_default_sidebarwidgettitle2_color() !== $color_sidebarwidgettitle2 ) ? sprintf( '
  310. .sidebar-primary .widget:nth-of-type(3n+2) .widgettitle::after,
  311. .wprm-recipe-print {
  312. background: %1$s;
  313. }
  314. ', $color_sidebarwidgettitle2 ) : '';
  315. $css .= ( captivating_customizer_get_default_sidebarwidgettitle3_color() !== $color_sidebarwidgettitle3 ) ? sprintf( '
  316. .sidebar-primary .widget:nth-of-type(3n+3) .widgettitle::after,
  317. .wprm-recipe-print:hover {
  318. background: %1$s;
  319. }
  320. ', $color_sidebarwidgettitle3 ) : '';
  321. $css .= ( captivating_customizer_get_default_morecategory1_color() !== $color_morecategory1 ) ? sprintf( '
  322. .more-from-category a,
  323. .posts-link a {
  324. color: %1$s;
  325. border-color: %1$s;
  326. }
  327. ', $color_morecategory1 ) : '';
  328. $css .= ( captivating_customizer_get_default_morecategory2_color() !== $color_morecategory2 ) ? sprintf( '
  329. .content .widget:nth-of-type(3n+2) .more-from-category a,
  330. .content .widget:nth-of-type(3n+2) .posts-link a {
  331. color: %1$s;
  332. border-color: %1$s;
  333. }
  334. ', $color_morecategory2 ) : '';
  335. $css .= ( captivating_customizer_get_default_morecategory3_color() !== $color_morecategory3 ) ? sprintf( '
  336. .content .widget:nth-of-type(3n+3) .more-from-category a,
  337. .content .widget:nth-of-type(3n+3) .posts-link a {
  338. color: %1$s;
  339. border-color: %1$s;
  340. }
  341. ', $color_morecategory3 ) : '';
  342. if( $css ){
  343. wp_add_inline_style( $handle, $css );
  344. }
  345. }