customize.php 161 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987
  1. <?php
  2. /**
  3. * Theme Customizer.
  4. *
  5. * @package Pen
  6. */
  7. if ( ! defined( 'ABSPATH' ) ) {
  8. exit;
  9. }
  10. if ( ! function_exists( 'pen_customize_color' ) ) {
  11. /**
  12. * Adds color options.
  13. *
  14. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  15. *
  16. * @since Pen 1.0.0
  17. * @return void
  18. */
  19. function pen_customize_color( &$wp_customize ) {
  20. $preset = esc_html( pen_preset_get( 'color' ) );
  21. $panel = 'pen_panel_colors';
  22. $wp_customize->add_panel(
  23. $panel,
  24. array(
  25. 'title' => __( 'Colors', 'pen' ),
  26. 'priority' => 1,
  27. )
  28. );
  29. $wp_customize->get_section( 'colors' )->title = __( 'General', 'pen' );
  30. $wp_customize->get_section( 'colors' )->priority = 1;
  31. $wp_customize->get_section( 'colors' )->panel = 'pen_colors';
  32. /**
  33. * General.
  34. */
  35. $section = 'pen_section_colors_general';
  36. $wp_customize->add_section(
  37. $section,
  38. array(
  39. 'title' => __( 'General', 'pen' ),
  40. 'panel' => $panel,
  41. )
  42. );
  43. $setting_id = "pen_color_shadow[$preset]";
  44. $label = __( 'Shadows', 'pen' );
  45. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  46. $setting_id = "pen_color_site_shadow_display[$preset]";
  47. $label = __( 'Shadow display', 'pen' );
  48. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  49. $setting_id = "pen_color_site_background[$preset]";
  50. $label = __( 'Site background color', 'pen' );
  51. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  52. $setting_id = "pen_color_site_background_effect[$preset]";
  53. $label = __( 'Site background effect', 'pen' );
  54. $choices = array(
  55. 'none' => __( 'None', 'pen' ),
  56. 'trianglify' => __( 'Trianglify', 'pen' ),
  57. 'shards' => __( 'Shards', 'pen' ),
  58. );
  59. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  60. $setting_id = "pen_color_text[$preset]";
  61. $label = __( 'Text', 'pen' );
  62. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  63. $setting_id = "pen_color_link[$preset]";
  64. $label = __( 'Links color', 'pen' );
  65. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  66. $setting_id = "pen_color_link_hover[$preset]";
  67. $label = __( 'Links (hover)', 'pen' );
  68. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  69. $setting_id = "pen_color_button_background_primary[$preset]";
  70. $label = __( 'Buttons background (top)', 'pen' );
  71. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  72. $setting_id = "pen_color_button_background_secondary[$preset]";
  73. $label = __( 'Buttons background (bottom)', 'pen' );
  74. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  75. $setting_id = "pen_color_button_text[$preset]";
  76. $label = __( 'Buttons text', 'pen' );
  77. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  78. $setting_id = "pen_color_button_border[$preset]";
  79. $label = __( 'Buttons border', 'pen' );
  80. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  81. /**
  82. * Header.
  83. */
  84. $section = 'pen_section_colors_header';
  85. $wp_customize->add_section(
  86. $section,
  87. array(
  88. 'title' => __( 'Header', 'pen' ),
  89. 'panel' => $panel,
  90. 'description_hidden' => true,
  91. )
  92. );
  93. $setting_id = "pen_color_header_background_primary[$preset]";
  94. $label = __( 'Background (primary)', 'pen' );
  95. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  96. $setting_id = "pen_color_header_background_secondary[$preset]";
  97. $label = __( 'Background (secondary)', 'pen' );
  98. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  99. $setting_id = "pen_color_header_background_angle[$preset]";
  100. $label = __( 'Angle', 'pen' );
  101. $choices = array(
  102. 'to right' => __( 'Horizontal', 'pen' ),
  103. '125deg' => __( 'Diagonal', 'pen' ),
  104. 'to bottom' => __( 'Vertical', 'pen' ),
  105. );
  106. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  107. $setting_id = "pen_color_header_text_shadow[$preset]";
  108. $label = __( 'Text shadow color', 'pen' );
  109. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  110. $setting_id = "pen_color_header_text_shadow_display[$preset]";
  111. $label = __( 'Text shadow', 'pen' );
  112. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  113. $setting_id = "pen_color_header_sitetitle[$preset]";
  114. $label = __( 'Site title color', 'pen' );
  115. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  116. $setting_id = "pen_color_header_sitetitle_hover[$preset]";
  117. $label = __( 'Site title (hover)', 'pen' );
  118. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  119. $setting_id = "pen_color_header_sitedescription[$preset]";
  120. $label = __( 'Site description color', 'pen' );
  121. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  122. $setting_id = "pen_color_header_sitedescription_hover[$preset]";
  123. $label = __( 'Site description (hover)', 'pen' );
  124. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  125. $setting_id = "pen_color_header_phone[$preset]";
  126. $label = __( 'Phone color', 'pen' );
  127. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  128. $setting_id = "pen_color_header_phone_hover[$preset]";
  129. $label = __( 'Phone (hover)', 'pen' );
  130. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  131. $setting_id = "pen_color_header_link[$preset]";
  132. $label = __( 'Links color', 'pen' );
  133. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  134. $setting_id = "pen_color_header_link_hover[$preset]";
  135. $label = __( 'Links (hover)', 'pen' );
  136. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  137. $setting_id = "pen_color_header_text[$preset]";
  138. $label = __( 'Text color', 'pen' );
  139. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  140. $setting_id = "pen_color_header_field_background_primary[$preset]";
  141. $label = __( 'Form fields background (top)', 'pen' );
  142. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  143. $setting_id = "pen_color_header_field_background_secondary[$preset]";
  144. $label = __( 'Form fields background (bottom)', 'pen' );
  145. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  146. $setting_id = "pen_color_header_field_text[$preset]";
  147. $label = __( 'Form fields text color', 'pen' );
  148. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  149. $setting_id = "pen_color_header_search_background_primary[$preset]";
  150. $label = __( 'Search button (top)', 'pen' );
  151. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  152. $setting_id = "pen_color_header_search_background_secondary[$preset]";
  153. $label = __( 'Search button (bottom)', 'pen' );
  154. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  155. $setting_id = "pen_color_header_search_text[$preset]";
  156. $label = __( 'Search button text', 'pen' );
  157. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  158. /**
  159. * Navigation colors.
  160. */
  161. $section = 'pen_section_colors_navigation';
  162. $wp_customize->add_section(
  163. $section,
  164. array(
  165. 'title' => __( 'Navigation', 'pen' ),
  166. 'panel' => $panel,
  167. )
  168. );
  169. $setting_id = "pen_color_navigation_background_primary[$preset]";
  170. $label = __( 'Background (primary)', 'pen' );
  171. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  172. $setting_id = "pen_color_navigation_background_secondary[$preset]";
  173. $label = __( 'Background (secondary)', 'pen' );
  174. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  175. $setting_id = "pen_color_navigation_background_angle[$preset]";
  176. $label = __( 'Angle', 'pen' );
  177. $choices = array(
  178. 'to right' => __( 'Horizontal', 'pen' ),
  179. '125deg' => __( 'Diagonal', 'pen' ),
  180. 'to bottom' => __( 'Vertical', 'pen' ),
  181. );
  182. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  183. $setting_id = "pen_color_navigation_background_submenu_primary[$preset]";
  184. $label = __( 'Sub-menu background (primary)', 'pen' );
  185. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  186. $setting_id = "pen_color_navigation_background_submenu_secondary[$preset]";
  187. $label = __( 'Sub-menu background (secondary)', 'pen' );
  188. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  189. $setting_id = "pen_color_navigation_background_submenu_angle[$preset]";
  190. $label = __( 'Angle', 'pen' );
  191. $choices = array(
  192. 'to right' => __( 'Horizontal', 'pen' ),
  193. '125deg' => __( 'Diagonal', 'pen' ),
  194. 'to bottom' => __( 'Vertical', 'pen' ),
  195. );
  196. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  197. $setting_id = "pen_color_navigation_text_shadow[$preset]";
  198. $label = __( 'Text shadow color', 'pen' );
  199. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  200. $setting_id = "pen_color_navigation_text_shadow_display[$preset]";
  201. $label = __( 'Text shadow', 'pen' );
  202. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  203. $setting_id = "pen_color_navigation_link[$preset]";
  204. $label = __( 'Links color', 'pen' );
  205. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  206. $setting_id = "pen_color_navigation_link_hover[$preset]";
  207. $label = __( 'Links (hover)', 'pen' );
  208. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  209. $setting_id = "pen_color_navigation_link_submenu[$preset]";
  210. $label = __( 'Submenu links color', 'pen' );
  211. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  212. $setting_id = "pen_color_navigation_link_hover_submenu[$preset]";
  213. $label = __( 'Submenu links (hover)', 'pen' );
  214. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  215. $setting_id = "pen_color_navigation_text_shadow_submenu[$preset]";
  216. $label = __( 'Text shadow (submenus)', 'pen' );
  217. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  218. $setting_id = "pen_color_navigation_text_shadow_display_submenu[$preset]";
  219. $label = __( 'Text shadow (submenus)', 'pen' );
  220. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  221. /**
  222. * Search.
  223. */
  224. $section = 'pen_section_colors_search';
  225. $wp_customize->add_section(
  226. $section,
  227. array(
  228. 'title' => __( 'Search Bar', 'pen' ),
  229. 'panel' => $panel,
  230. 'description' => __( 'Please make sure you have the search box added to the top of the content area through Customize &rarr; Header &rarr; Search, otherwise changes that you will make in this section cannot be previewed live like the rest of the settings.', 'pen' ),
  231. )
  232. );
  233. $setting_id = "pen_color_search_background_primary[$preset]";
  234. $label = __( 'Background (primary)', 'pen' );
  235. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  236. $setting_id = "pen_color_search_background_secondary[$preset]";
  237. $label = __( 'Background (secondary)', 'pen' );
  238. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  239. $setting_id = "pen_color_search_background_angle[$preset]";
  240. $label = __( 'Angle', 'pen' );
  241. $choices = array(
  242. 'to right' => __( 'Horizontal', 'pen' ),
  243. '125deg' => __( 'Diagonal', 'pen' ),
  244. 'to bottom' => __( 'Vertical', 'pen' ),
  245. );
  246. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  247. $setting_id = "pen_color_search_field_background_primary[$preset]";
  248. $label = __( 'Search fields background (top)', 'pen' );
  249. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  250. $setting_id = "pen_color_search_field_background_secondary[$preset]";
  251. $label = __( 'Search fields background (bottom)', 'pen' );
  252. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  253. $setting_id = "pen_color_search_field_text[$preset]";
  254. $label = __( 'Form fields text color', 'pen' );
  255. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  256. $setting_id = "pen_color_search_button_background_primary[$preset]";
  257. $label = __( 'Search button (top)', 'pen' );
  258. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  259. $setting_id = "pen_color_search_button_background_secondary[$preset]";
  260. $label = __( 'Search button (bottom)', 'pen' );
  261. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  262. $setting_id = "pen_color_search_button_text[$preset]";
  263. $label = __( 'Search button text', 'pen' );
  264. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  265. $setting_id = "pen_color_search_text[$preset]";
  266. $label = __( 'Text color', 'pen' );
  267. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  268. $setting_id = "pen_color_search_link[$preset]";
  269. $label = __( 'Links color', 'pen' );
  270. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  271. $setting_id = "pen_color_search_link_hover[$preset]";
  272. $label = __( 'Links (hover)', 'pen' );
  273. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  274. $setting_id = "pen_color_search_text_shadow[$preset]";
  275. $label = __( 'Text shadow color', 'pen' );
  276. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  277. $setting_id = "pen_color_search_text_shadow_display[$preset]";
  278. $label = __( 'Text shadow', 'pen' );
  279. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  280. /**
  281. * Content.
  282. */
  283. $section = 'pen_section_colors_content';
  284. $wp_customize->add_section(
  285. $section,
  286. array(
  287. 'title' => __( 'Posts & pages', 'pen' ),
  288. 'panel' => $panel,
  289. )
  290. );
  291. $setting_id = "pen_color_content_title_background_primary[$preset]";
  292. $label = __( 'Post title background (primary)', 'pen' );
  293. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  294. $setting_id = "pen_color_content_title_background_secondary[$preset]";
  295. $label = __( 'Post title background (secondary)', 'pen' );
  296. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  297. $setting_id = "pen_color_content_title_background_angle[$preset]";
  298. $label = __( 'Angle', 'pen' );
  299. $choices = array(
  300. 'to right' => __( 'Horizontal', 'pen' ),
  301. '125deg' => __( 'Diagonal', 'pen' ),
  302. 'to bottom' => __( 'Vertical', 'pen' ),
  303. );
  304. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  305. $setting_id = "pen_color_content_title_text[$preset]";
  306. $label = __( 'Post title text color', 'pen' );
  307. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  308. $setting_id = "pen_color_content_title_text_shadow[$preset]";
  309. $label = __( 'Post title text shadow color', 'pen' );
  310. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  311. $setting_id = "pen_color_content_title_text_shadow_display[$preset]";
  312. $label = __( 'Post title text shadow', 'pen' );
  313. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  314. $setting_id = "pen_color_content_title_link[$preset]";
  315. $label = __( 'Post title link color', 'pen' );
  316. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  317. $setting_id = "pen_color_content_title_link_hover[$preset]";
  318. $label = __( 'Post title link (hover)', 'pen' );
  319. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  320. $setting_id = "pen_color_content_background_primary[$preset]";
  321. $label = __( 'Background color', 'pen' );
  322. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  323. $setting_id = "pen_color_content_thumbnail_frame[$preset]";
  324. $label = __( 'Featured image frame (Full content)', 'pen' );
  325. $description = __( 'Make sure the thumbnail frame is enabled in Customize &rarr; Content &rarr; Full content view.', 'pen' );
  326. $choices = array(
  327. '#ffffff' => __( 'Light', 'pen' ),
  328. '#000000' => __( 'Dark', 'pen' ),
  329. );
  330. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label, $description );
  331. $setting_id = "pen_color_content_text[$preset]";
  332. $label = __( 'Text color', 'pen' );
  333. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  334. $setting_id = "pen_color_content_link[$preset]";
  335. $label = __( 'Links', 'pen' );
  336. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  337. $setting_id = "pen_color_content_link_hover[$preset]";
  338. $label = __( 'Links (hover)', 'pen' );
  339. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  340. $setting_id = "pen_color_content_field_background_primary[$preset]";
  341. $label = __( 'Form fields background (top)', 'pen' );
  342. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  343. $setting_id = "pen_color_content_field_background_secondary[$preset]";
  344. $label = __( 'Form fields background (bottom)', 'pen' );
  345. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  346. $setting_id = "pen_color_content_field_text[$preset]";
  347. $label = __( 'Form fields text color', 'pen' );
  348. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  349. /**
  350. * Lists.
  351. */
  352. $section = 'pen_section_colors_list';
  353. $wp_customize->add_section(
  354. $section,
  355. array(
  356. 'title' => __( 'List views', 'pen' ),
  357. 'panel' => $panel,
  358. )
  359. );
  360. $setting_id = "pen_color_list_thumbnail_frame[$preset]";
  361. $label = __( 'Featured image frame (plain list)', 'pen' );
  362. $description = __( 'Make sure the thumbnail frame is enabled in Customize &rarr; Content &rarr; List Views.', 'pen' );
  363. $choices = array(
  364. '#ffffff' => __( 'Light', 'pen' ),
  365. '#000000' => __( 'Dark', 'pen' ),
  366. );
  367. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label, $description );
  368. $setting_id = "pen_color_list_thumbnail_background_primary[$preset]";
  369. $label = __( 'Thumbnails background (primary)', 'pen' );
  370. $description = __( 'Only for the jQuery Masonry layouts.', 'pen' );
  371. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  372. $setting_id = "pen_color_list_thumbnail_background_secondary[$preset]";
  373. $label = __( 'Thumbnails background (secondary)', 'pen' );
  374. $description = __( 'Only for the jQuery Masonry layouts.', 'pen' );
  375. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  376. /**
  377. * Bottom.
  378. */
  379. $section = 'pen_section_colors_bottom';
  380. $wp_customize->add_section(
  381. $section,
  382. array(
  383. 'title' => __( 'Bottom', 'pen' ),
  384. 'panel' => $panel,
  385. )
  386. );
  387. $setting_id = "pen_color_bottom_background_transparent[$preset]";
  388. $label = __( 'Transparent background', 'pen' );
  389. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  390. $setting_id = "pen_color_bottom_background_primary[$preset]";
  391. $label = __( 'Background (primary)', 'pen' );
  392. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  393. $setting_id = "pen_color_bottom_background_secondary[$preset]";
  394. $label = __( 'Background (secondary)', 'pen' );
  395. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  396. $setting_id = "pen_color_bottom_background_angle[$preset]";
  397. $label = __( 'Angle', 'pen' );
  398. $choices = array(
  399. 'to right' => __( 'Horizontal', 'pen' ),
  400. '125deg' => __( 'Diagonal', 'pen' ),
  401. 'to bottom' => __( 'Vertical', 'pen' ),
  402. );
  403. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  404. $setting_id = "pen_color_bottom_text[$preset]";
  405. $label = __( 'Text color', 'pen' );
  406. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  407. $setting_id = "pen_color_bottom_link[$preset]";
  408. $label = __( 'Links color', 'pen' );
  409. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  410. $setting_id = "pen_color_bottom_link_hover[$preset]";
  411. $label = __( 'Links (hover)', 'pen' );
  412. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  413. $setting_id = "pen_color_bottom_text_shadow[$preset]";
  414. $label = __( 'Text shadow color', 'pen' );
  415. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  416. $setting_id = "pen_color_bottom_text_shadow_display[$preset]";
  417. $label = __( 'Text shadow', 'pen' );
  418. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  419. $setting_id = "pen_color_bottom_headings[$preset]";
  420. $label = __( 'Headings color', 'pen' );
  421. $description = __( 'Only applies to widgets with no color scheme.', 'pen' );
  422. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label, $description );
  423. $setting_id = "pen_color_bottom_headings_text_shadow[$preset]";
  424. $label = __( 'Headings shadow color', 'pen' );
  425. $description = __( 'Only applies to widgets with no color scheme.', 'pen' );
  426. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label, $description );
  427. $setting_id = "pen_color_bottom_headings_text_shadow_display[$preset]";
  428. $label = __( 'Headings shadow', 'pen' );
  429. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  430. $setting_id = "pen_color_bottom_field_background_primary[$preset]";
  431. $label = __( 'Form fields background (top)', 'pen' );
  432. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  433. $setting_id = "pen_color_bottom_field_background_secondary[$preset]";
  434. $label = __( 'Form fields background (bottom)', 'pen' );
  435. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  436. $setting_id = "pen_color_bottom_field_text[$preset]";
  437. $label = __( 'Form fields text color', 'pen' );
  438. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  439. /**
  440. * Footer.
  441. */
  442. $section = 'pen_section_colors_footer';
  443. $wp_customize->add_section(
  444. $section,
  445. array(
  446. 'title' => __( 'Footer', 'pen' ),
  447. 'panel' => $panel,
  448. )
  449. );
  450. $setting_id = "pen_color_footer_background_transparent[$preset]";
  451. $label = __( 'Transparent background', 'pen' );
  452. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  453. $setting_id = "pen_color_footer_background_primary[$preset]";
  454. $label = __( 'Background (primary)', 'pen' );
  455. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  456. $setting_id = "pen_color_footer_background_secondary[$preset]";
  457. $label = __( 'Background (secondary)', 'pen' );
  458. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  459. $setting_id = "pen_color_footer_background_angle[$preset]";
  460. $label = __( 'Angle', 'pen' );
  461. $choices = array(
  462. 'to right' => __( 'Horizontal', 'pen' ),
  463. '125deg' => __( 'Diagonal', 'pen' ),
  464. 'to bottom' => __( 'Vertical', 'pen' ),
  465. );
  466. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  467. $setting_id = "pen_color_footer_text[$preset]";
  468. $label = __( 'Text color', 'pen' );
  469. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  470. $setting_id = "pen_color_footer_link[$preset]";
  471. $label = __( 'Links color', 'pen' );
  472. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  473. $setting_id = "pen_color_footer_link_hover[$preset]";
  474. $label = __( 'Links (hover)', 'pen' );
  475. pen_control_color( $wp_customize, $setting_id, $section, 'refresh', $label );
  476. $setting_id = "pen_color_footer_text_shadow[$preset]";
  477. $label = __( 'Text shadow color', 'pen' );
  478. pen_control_color( $wp_customize, $setting_id, $section, 'postMessage', $label );
  479. $setting_id = "pen_color_footer_text_shadow_display[$preset]";
  480. $label = __( 'Text shadow', 'pen' );
  481. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  482. }
  483. }
  484. if ( ! function_exists( 'pen_customize_typography' ) ) {
  485. /**
  486. * Adds typography options.
  487. *
  488. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  489. *
  490. * @since Pen 1.0.0
  491. * @return void
  492. */
  493. function pen_customize_typography( &$wp_customize ) {
  494. $preset = 'preset_1';
  495. $preset_font = esc_html( pen_preset_get( 'font_family' ) );
  496. $list_fonts = array_merge(
  497. array(
  498. 'default' => __( 'Default', 'pen' ),
  499. ),
  500. pen_fonts_all()
  501. );
  502. $list_sizes = array(
  503. '0.5em' => __( 'Very Small', 'pen' ),
  504. '0.75em' => __( 'Small', 'pen' ),
  505. 'default' => __( 'Default', 'pen' ),
  506. '2em' => __( 'Large', 'pen' ),
  507. '3em' => __( 'Very Large', 'pen' ),
  508. );
  509. $panel = 'pen_panel_typography';
  510. $wp_customize->add_panel(
  511. $panel,
  512. array(
  513. 'title' => __( 'Typography', 'pen' ),
  514. 'priority' => 2,
  515. )
  516. );
  517. /**
  518. * General.
  519. */
  520. $section = 'pen_section_typography_general';
  521. $wp_customize->add_section(
  522. $section,
  523. array(
  524. 'title' => __( 'General', 'pen' ),
  525. 'panel' => $panel,
  526. )
  527. );
  528. $setting_id = "pen_font_family_site[$preset_font]";
  529. $label = __( 'Base font', 'pen' );
  530. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  531. $setting_id = "pen_font_family_headings[$preset_font]";
  532. $label = __( 'Headings font', 'pen' );
  533. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  534. $setting_id = "pen_font_family_title_list[$preset_font]";
  535. $label = __( 'Content title font (In lists)', 'pen' );
  536. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  537. $setting_id = "pen_font_size_title_list[$preset]";
  538. $label = __( 'Content title font size (In lists)', 'pen' );
  539. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  540. $setting_id = "pen_font_family_title_content[$preset_font]";
  541. $label = __( 'Content title font (Full content)', 'pen' );
  542. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  543. $setting_id = "pen_font_size_title_content[$preset]";
  544. $label = __( 'Content title font size (Full content)', 'pen' );
  545. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  546. $setting_id = "pen_font_family_forms[$preset_font]";
  547. $label = __( 'Forms font', 'pen' );
  548. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  549. $setting_id = "pen_font_family_buttons[$preset_font]";
  550. $label = __( 'Buttons font', 'pen' );
  551. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  552. /**
  553. * Header.
  554. */
  555. $section = 'pen_section_typography_header';
  556. $wp_customize->add_section(
  557. $section,
  558. array(
  559. 'title' => __( 'Header', 'pen' ),
  560. 'panel' => $panel,
  561. )
  562. );
  563. $setting_id = "pen_font_family_sitetitle[$preset_font]";
  564. $label = __( 'Site title font', 'pen' );
  565. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  566. $setting_id = "pen_font_size_sitetitle[$preset]";
  567. $label = __( 'Site title font size', 'pen' );
  568. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  569. $setting_id = "pen_font_resize_sitetitle[$preset]";
  570. $label = __( 'Site title font resize', 'pen' );
  571. $description = __( 'Font size enhancement on small screens', 'pen' );
  572. $choices = array(
  573. 'none' => __( 'Disabled', 'pen' ),
  574. 'dynamic' => __( 'Dynamic', 'pen' ),
  575. 'resize' => __( 'Shrink to fit', 'pen' ),
  576. );
  577. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label, $description );
  578. $setting_id = "pen_font_family_sitedescription[$preset_font]";
  579. $label = __( 'Site description font', 'pen' );
  580. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  581. $setting_id = "pen_font_size_sitedescription[$preset]";
  582. $label = __( 'Site description font size', 'pen' );
  583. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  584. $setting_id = "pen_font_size_social_header[$preset]";
  585. $label = __( 'Social links font size', 'pen' );
  586. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  587. $setting_id = "pen_font_family_phone_header[$preset_font]";
  588. $label = __( 'Phone font', 'pen' );
  589. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  590. $setting_id = "pen_font_size_phone_header[$preset]";
  591. $label = __( 'Phone font size', 'pen' );
  592. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  593. /**
  594. * Footer fonts.
  595. */
  596. $section = 'pen_section_typography_footer';
  597. $wp_customize->add_section(
  598. $section,
  599. array(
  600. 'title' => __( 'Footer', 'pen' ),
  601. 'panel' => $panel,
  602. )
  603. );
  604. $setting_id = "pen_font_family_phone_footer[$preset_font]";
  605. $label = __( 'Phone font', 'pen' );
  606. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  607. $setting_id = "pen_font_size_phone_footer[$preset]";
  608. $label = __( 'Phone font size', 'pen' );
  609. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  610. /**
  611. * Navigation font.
  612. */
  613. $section = 'pen_section_typography_navigation';
  614. $wp_customize->add_section(
  615. $section,
  616. array(
  617. 'title' => __( 'Navigation', 'pen' ),
  618. 'panel' => $panel,
  619. )
  620. );
  621. $setting_id = "pen_font_family_navigation[$preset_font]";
  622. $label = __( 'Navigation font (parents)', 'pen' );
  623. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  624. $setting_id = "pen_font_size_navigation[$preset]";
  625. $label = __( 'Navigation font size', 'pen' );
  626. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  627. $setting_id = "pen_font_family_navigation_submenu[$preset_font]";
  628. $label = __( 'Navigation font (sub-menus)', 'pen' );
  629. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  630. /**
  631. * Sidebars.
  632. */
  633. $section = 'pen_section_typography_sidebars';
  634. $wp_customize->add_section(
  635. $section,
  636. array(
  637. 'title' => __( 'Sidebars', 'pen' ),
  638. 'panel' => $panel,
  639. )
  640. );
  641. $setting_id = "pen_font_family_widget_title_top[$preset_font]";
  642. $label = __( 'Top: Widget title font', 'pen' );
  643. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  644. $setting_id = "pen_font_size_widget_title_top[$preset]";
  645. $label = __( 'Top: Widget title font size', 'pen' );
  646. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  647. $setting_id = "pen_font_family_widget_title_left[$preset_font]";
  648. $label = __( 'Left: Widget title font', 'pen' );
  649. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  650. $setting_id = "pen_font_size_widget_title_left[$preset]";
  651. $label = __( 'Left: Widget title font size', 'pen' );
  652. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  653. $setting_id = "pen_font_family_widget_title_right[$preset_font]";
  654. $label = __( 'Right: Widget title font', 'pen' );
  655. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  656. $setting_id = "pen_font_size_widget_title_right[$preset]";
  657. $label = __( 'Right: Widget title font size', 'pen' );
  658. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  659. $setting_id = "pen_font_family_widget_title_bottom[$preset_font]";
  660. $label = __( 'Bottom: Widget title font', 'pen' );
  661. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_fonts, $label );
  662. $setting_id = "pen_font_size_widget_title_bottom[$preset]";
  663. $label = __( 'Bottom: Widget title font size', 'pen' );
  664. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $list_sizes, $label );
  665. }
  666. }
  667. if ( ! function_exists( 'pen_customize_header' ) ) {
  668. /**
  669. * Adds header options.
  670. *
  671. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  672. *
  673. * @since Pen 1.0.0
  674. * @return void
  675. */
  676. function pen_customize_header( &$wp_customize ) {
  677. $preset = 'preset_1';
  678. $panel = 'pen_panel_header';
  679. $wp_customize->add_panel(
  680. $panel,
  681. array(
  682. 'title' => __( 'Header', 'pen' ),
  683. 'priority' => 3,
  684. )
  685. );
  686. /*
  687. * Layout.
  688. */
  689. $section = 'pen_section_header_general';
  690. $wp_customize->add_section(
  691. $section,
  692. array(
  693. 'title' => __( 'General', 'pen' ),
  694. 'panel' => $panel,
  695. )
  696. );
  697. $setting_id = "pen_header_sticky[$preset]";
  698. $label = __( 'Sticky header', 'pen' );
  699. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  700. $setting_id = "pen_header_sitetitle_display[$preset]";
  701. $label = __( 'Display the site title', 'pen' );
  702. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  703. $setting_id = "pen_header_sitetitle_animation_reveal[$preset]";
  704. $label = __( 'Site title animation', 'pen' );
  705. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  706. $setting_id = "pen_header_sitedescription_display[$preset]";
  707. $label = __( 'Display the site description', 'pen' );
  708. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  709. $setting_id = "pen_header_sitedescription_animation_reveal[$preset]";
  710. $label = __( 'Site description animation', 'pen' );
  711. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  712. $setting_id = "pen_header_alignment[$preset]";
  713. $label = __( 'Header alignment', 'pen' );
  714. $choices = array(
  715. 'left' => __( 'Left', 'pen' ),
  716. 'center' => __( 'Center', 'pen' ),
  717. 'right' => __( 'Right', 'pen' ),
  718. );
  719. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  720. /*
  721. * Search.
  722. */
  723. $section = 'pen_section_header_search';
  724. $wp_customize->add_section(
  725. $section,
  726. array(
  727. 'title' => __( 'Search', 'pen' ),
  728. 'panel' => $panel,
  729. )
  730. );
  731. $setting_id = "pen_search_display[$preset]";
  732. $label = __( 'Display the search box', 'pen' );
  733. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  734. $setting_id = "pen_search_location[$preset]";
  735. $label = __( 'Search box location', 'pen' );
  736. $choices = array(
  737. 'header' => __( 'Header', 'pen' ),
  738. 'content' => __( 'Content area', 'pen' ),
  739. );
  740. pen_control_radio( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  741. /*
  742. * Navigation.
  743. */
  744. $section = 'pen_section_header_navigation';
  745. $wp_customize->add_section(
  746. $section,
  747. array(
  748. 'title' => __( 'Navigation', 'pen' ),
  749. 'panel' => $panel,
  750. )
  751. );
  752. $setting_id = "pen_navigation_display[$preset]";
  753. $label = __( 'Display the main navigation menu', 'pen' );
  754. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  755. $setting_id = "pen_navigation_mobile_display[$preset]";
  756. $label = __( 'Display the mobile navigation menu', 'pen' );
  757. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  758. $setting_id = "pen_navigation_animation_reveal[$preset]";
  759. $label = __( 'Animation on page load', 'pen' );
  760. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  761. $setting_id = "pen_navigation_separator[$preset]";
  762. $label = __( 'Menu separator', 'pen' );
  763. $choices = array(
  764. 0 => __( 'None', 'pen' ),
  765. );
  766. for ( $i = 1; $i <= 10; $i++ ) {
  767. /* Translators: %d the style number. */
  768. $choices[ $i ] = sprintf( __( 'Style %d', 'pen' ), $i );
  769. }
  770. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  771. $setting_id = "pen_navigation_separator_submenu[$preset]";
  772. $label = __( 'Sub-menu separator', 'pen' );
  773. $choices = array(
  774. 0 => __( 'None', 'pen' ),
  775. );
  776. for ( $i = 1; $i <= 10; $i++ ) {
  777. /* Translators: %d the style number. */
  778. $choices[ $i ] = sprintf( __( 'Style %d', 'pen' ), $i );
  779. }
  780. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  781. $setting_id = "pen_navigation_hover[$preset]";
  782. $label = __( 'Hover style', 'pen' );
  783. $choices = array(
  784. 0 => __( 'None', 'pen' ),
  785. );
  786. for ( $i = 1; $i <= 10; $i++ ) {
  787. /* Translators: %d the style number. */
  788. $choices[ $i ] = sprintf( __( 'Style %d', 'pen' ), $i );
  789. }
  790. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  791. $setting_id = "pen_navigation_arrows[$preset]";
  792. $label = __( 'Dropdown arrows', 'pen' );
  793. $choices = array(
  794. 0 => __( 'None', 'pen' ),
  795. );
  796. for ( $i = 1; $i <= 10; $i++ ) {
  797. /* Translators: %d the style number. */
  798. $choices[ $i ] = sprintf( __( 'Style %d', 'pen' ), $i );
  799. }
  800. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  801. $setting_id = "pen_navigation_easing[$preset]";
  802. $label = __( 'Dropdown animation', 'pen' );
  803. $choices = array(
  804. '' => __( 'None', 'pen' ),
  805. 'easeInBack' => 'easeInBack',
  806. 'easeInBounce' => 'easeInBounce',
  807. 'easeInCirc' => 'easeInCirc',
  808. 'easeInCubic' => 'easeInCubic',
  809. 'easeInElastic' => 'easeInElastic',
  810. 'easeInExpo' => 'easeInExpo',
  811. 'easeInQuad' => 'easeInQuad',
  812. 'easeInQuart' => 'easeInQuart',
  813. 'easeInQuint' => 'easeInQuint',
  814. 'easeInSine' => 'easeInSine',
  815. 'swing' => 'swing',
  816. );
  817. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  818. $setting_id = "pen_navigation_animation_speed[$preset]";
  819. $label = __( 'Dropdown animation speed', 'pen' );
  820. $choices = array(
  821. 2000 => __( 'Very Slow', 'pen' ),
  822. 1000 => __( 'Slow', 'pen' ),
  823. 500 => __( 'Normal', 'pen' ),
  824. 250 => __( 'Fast', 'pen' ),
  825. 100 => __( 'Very Fast', 'pen' ),
  826. );
  827. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  828. $setting_id = "pen_navigation_alignment[$preset]";
  829. $label = __( 'Navigation alignment', 'pen' );
  830. $choices = array(
  831. 'left' => __( 'Left', 'pen' ),
  832. 'center' => __( 'Center', 'pen' ),
  833. 'right' => __( 'Right', 'pen' ),
  834. );
  835. pen_control_radio( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  836. }
  837. }
  838. if ( ! function_exists( 'pen_customize_content_list' ) ) {
  839. /**
  840. * Adds "Content list" options.
  841. *
  842. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  843. *
  844. * @since Pen 1.0.0
  845. * @return void
  846. */
  847. function pen_customize_content_list( &$wp_customize ) {
  848. $preset = 'preset_1';
  849. $panel = 'pen_panel_content';
  850. $wp_customize->add_panel(
  851. $panel,
  852. array(
  853. 'title' => __( 'Content', 'pen' ),
  854. 'priority' => 4,
  855. )
  856. );
  857. $section = 'pen_section_list';
  858. $wp_customize->add_section(
  859. $section,
  860. array(
  861. 'title' => __( 'List Views', 'pen' ),
  862. 'panel' => $panel,
  863. 'description' => __( 'The following options apply to both "Plain list" and "jQuery Masonry" layouts.', 'pen' ),
  864. )
  865. );
  866. $setting_id = "pen_list_type[$preset]";
  867. $label = __( 'Layout', 'pen' );
  868. $choices = array(
  869. 'masonry' => __( 'jQuery Masonry', 'pen' ),
  870. 'plain' => __( 'Plain list', 'pen' ),
  871. );
  872. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  873. $setting_id = "pen_list_masonry_columns[$preset]";
  874. $label = __( 'jQuery Masonry: Columns', 'pen' );
  875. $description = __( 'Maximum number of columns', 'pen' );
  876. $choices = array(
  877. '2' => __( 'Two', 'pen' ),
  878. '3' => __( 'Three', 'pen' ),
  879. '4' => __( 'Four', 'pen' ),
  880. '5' => __( 'Five', 'pen' ),
  881. );
  882. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label, $description );
  883. $setting_id = "pen_list_masonry_thumbnail_effect[$preset]";
  884. $label = __( 'jQuery Masonry: Thumbnails effect', 'pen' );
  885. $choices = array(
  886. 'none' => __( 'None', 'pen' ),
  887. 'zoom_in' => __( 'Zoom in', 'pen' ),
  888. 'zoom_out' => __( 'Zoom out', 'pen' ),
  889. );
  890. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  891. $setting_id = "pen_list_masonry_thumbnail_style[$preset]";
  892. $label = __( 'jQuery Masonry: Thumbnails style', 'pen' );
  893. $choices = array(
  894. 0 => __( 'None', 'pen' ),
  895. );
  896. for ( $i = 1; $i <= 25; $i++ ) {
  897. /* Translators: %d the style number. */
  898. $choices[ $i ] = sprintf( __( 'Style %d', 'pen' ), $i );
  899. }
  900. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  901. $setting_id = "pen_list_animation_reveal[$preset]";
  902. $label = __( 'Content list animation', 'pen' );
  903. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  904. $setting_id = "pen_list_effect[$preset]";
  905. $label = __( 'Content list effect', 'pen' );
  906. $description = __( 'This may not work in conjunction with some of the animations in the "Content list animation" above.', 'pen' );
  907. $choices = array(
  908. 'none' => __( 'None', 'pen' ),
  909. 'enlarge' => __( 'Enlarge', 'pen' ),
  910. 'fade' => __( 'Fade', 'pen' ),
  911. 'enlarge_fade' => __( 'Enlarge + Fade', 'pen' ),
  912. );
  913. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label, $description );
  914. $setting_id = "pen_list_header_display[$preset]";
  915. $label = __( 'Display post header', 'pen' );
  916. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  917. $setting_id = "pen_list_post_header_alignment[$preset]";
  918. $label = __( 'Center-align post header', 'pen' );
  919. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  920. $setting_id = "pen_list_title_alignment[$preset]";
  921. $label = __( 'Center-align post titles', 'pen' );
  922. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  923. $setting_id = "pen_list_excerpt[$preset]";
  924. $label = __( 'Display excerpt', 'pen' );
  925. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  926. $setting_id = "pen_list_footer_display[$preset]";
  927. $label = __( 'Display post footer', 'pen' );
  928. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  929. $setting_id = "pen_list_title_display[$preset]";
  930. $label = __( 'Display post titles', 'pen' );
  931. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  932. $setting_id = "pen_list_author_location[$preset]";
  933. $label = __( 'Post author location', 'pen' );
  934. $choices = array(
  935. 'header' => __( 'Post header', 'pen' ),
  936. 'footer' => __( 'Post footer', 'pen' ),
  937. );
  938. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  939. $setting_id = "pen_list_author_display[$preset]";
  940. $label = __( 'Display post authors', 'pen' );
  941. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  942. $setting_id = "pen_list_author_animation_reveal[$preset]";
  943. $label = __( 'Author profile animation', 'pen' );
  944. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  945. $setting_id = "pen_list_date_location[$preset]";
  946. $label = __( 'Post date location', 'pen' );
  947. $choices = array(
  948. 'header' => __( 'Post header', 'pen' ),
  949. 'footer' => __( 'Post footer', 'pen' ),
  950. );
  951. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  952. $setting_id = "pen_list_date_display[$preset]";
  953. $label = __( 'Display post date', 'pen' );
  954. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  955. $setting_id = "pen_list_category_location[$preset]";
  956. $label = __( 'Post categories location', 'pen' );
  957. $choices = array(
  958. 'header' => __( 'Post header', 'pen' ),
  959. 'footer' => __( 'Post footer', 'pen' ),
  960. );
  961. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  962. $setting_id = "pen_list_category_display[$preset]";
  963. $label = __( 'Display post categories', 'pen' );
  964. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  965. $setting_id = "pen_list_category_only_first[$preset]";
  966. $label = __( 'Display the first category only', 'pen' );
  967. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  968. $setting_id = "pen_list_thumbnail_display[$preset]";
  969. $label = __( 'Display post thumbnails', 'pen' );
  970. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  971. $setting_id = "pen_list_thumbnail_animation_reveal[$preset]";
  972. $label = __( 'Thumbnails animation', 'pen' );
  973. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  974. $setting_id = "pen_list_thumbnail_rotate[$preset]";
  975. $label = __( 'Post thumbnail rotate', 'pen' );
  976. $description = __( 'Does not apply to the jQuery Masonry layout.', 'pen' );
  977. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  978. $setting_id = "pen_list_thumbnail_frame[$preset]";
  979. $label = __( 'Post thumbnail frame', 'pen' );
  980. $description = __( 'Does not apply to the jQuery Masonry layout.', 'pen' );
  981. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  982. $setting_id = "pen_list_thumbnail_alignment[$preset]";
  983. $label = __( 'Post thumbnail alignment', 'pen' );
  984. $description = __( 'Does not apply to the jQuery Masonry layout.', 'pen' );
  985. $choices = array(
  986. 'left' => __( 'Left', 'pen' ),
  987. 'center' => __( 'Center', 'pen' ),
  988. 'right' => __( 'Right', 'pen' ),
  989. );
  990. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label, $description );
  991. $setting_id = "pen_list_thumbnail_resize[$preset]";
  992. $label = __( 'Post thumbnail size', 'pen' );
  993. $description = __( 'Does not apply to the jQuery Masonry layout.', 'pen' );
  994. $thumbnail_sizes = array(
  995. 'none' => __( 'None', 'pen' ),
  996. );
  997. foreach ( get_intermediate_image_sizes() as $size ) { /* phpcs:ignore */
  998. $thumbnail_sizes[ $size ] = ucfirst( $size );
  999. }
  1000. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $thumbnail_sizes, $label, $description );
  1001. $setting_id = "pen_list_summary_display[$preset]";
  1002. $label = __( 'Display post summaries', 'pen' );
  1003. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1004. $setting_id = "pen_list_profile_display[$preset]";
  1005. $label = __( 'Display author profile', 'pen' );
  1006. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1007. $setting_id = "pen_list_tags_display[$preset]";
  1008. $label = __( 'Footer: Display post tags', 'pen' );
  1009. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1010. $setting_id = "pen_list_button_comment_display[$preset]";
  1011. $label = __( 'Footer: Display post comment buttons', 'pen' );
  1012. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1013. $setting_id = "pen_list_button_edit_display[$preset]";
  1014. $label = __( 'Footer: Display post edit buttons', 'pen' );
  1015. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1016. $setting_id = "pen_list_pager_animation_reveal[$preset]";
  1017. $label = __( 'Pagination buttons animation', 'pen' );
  1018. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1019. }
  1020. }
  1021. if ( ! function_exists( 'pen_customize_content_full' ) ) {
  1022. /**
  1023. * Adds "Full content" options.
  1024. *
  1025. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1026. *
  1027. * @since Pen 1.0.2
  1028. * @return void
  1029. */
  1030. function pen_customize_content_full( &$wp_customize ) {
  1031. $preset = 'preset_1';
  1032. $panel = 'pen_panel_content';
  1033. $section = 'pen_section_content';
  1034. $wp_customize->add_section(
  1035. $section,
  1036. array(
  1037. 'title' => __( 'Full Content Views', 'pen' ),
  1038. 'description' => __( 'You can override these settings for individual contents through Posts (or Pages) &rarr; Edit &rarr; Pen Options.', 'pen' ),
  1039. 'panel' => $panel,
  1040. )
  1041. );
  1042. $setting_id = "pen_content_animation_reveal[$preset]";
  1043. $label = __( 'Content area animation', 'pen' );
  1044. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1045. $setting_id = "pen_content_header_display[$preset]";
  1046. $label = __( 'Display post header', 'pen' );
  1047. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1048. $setting_id = "pen_content_header_alignment[$preset]";
  1049. $label = __( 'Center-align post header', 'pen' );
  1050. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1051. $setting_id = "pen_content_footer_display[$preset]";
  1052. $label = __( 'Display post footer', 'pen' );
  1053. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1054. $setting_id = "pen_content_title_alignment[$preset]";
  1055. $label = __( 'Center-align post titles', 'pen' );
  1056. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1057. $setting_id = "pen_content_title_display[$preset]";
  1058. $label = __( 'Display post title', 'pen' );
  1059. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1060. $setting_id = "pen_content_author_location[$preset]";
  1061. $label = __( 'Post author location', 'pen' );
  1062. $choices = array(
  1063. 'header' => __( 'Post header', 'pen' ),
  1064. 'footer' => __( 'Post footer', 'pen' ),
  1065. );
  1066. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1067. $setting_id = "pen_content_author_display[$preset]";
  1068. $label = __( 'Display post author', 'pen' );
  1069. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1070. $setting_id = "pen_content_author_animation_reveal[$preset]";
  1071. $label = __( 'Author profile animation', 'pen' );
  1072. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1073. $setting_id = "pen_content_date_location[$preset]";
  1074. $label = __( 'Post date location', 'pen' );
  1075. $choices = array(
  1076. 'header' => __( 'Post header', 'pen' ),
  1077. 'footer' => __( 'Post footer', 'pen' ),
  1078. );
  1079. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1080. $setting_id = "pen_content_date_display[$preset]";
  1081. $label = __( 'Display post date', 'pen' );
  1082. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1083. $setting_id = "pen_content_category_location[$preset]";
  1084. $label = __( 'Post categories location', 'pen' );
  1085. $choices = array(
  1086. 'header' => __( 'Post header', 'pen' ),
  1087. 'footer' => __( 'Post footer', 'pen' ),
  1088. );
  1089. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1090. $setting_id = "pen_content_category_display[$preset]";
  1091. $label = __( 'Display post category', 'pen' );
  1092. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1093. $setting_id = "pen_content_category_only_first[$preset]";
  1094. $label = __( 'Display the first category only', 'pen' );
  1095. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1096. $setting_id = "pen_content_thumbnail_display[$preset]";
  1097. $label = __( 'Display post thumbnail', 'pen' );
  1098. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1099. $setting_id = "pen_content_thumbnail_animation_reveal[$preset]";
  1100. $label = __( 'Thumbnails animation', 'pen' );
  1101. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1102. $setting_id = "pen_content_thumbnail_alignment[$preset]";
  1103. $label = __( 'Post thumbnail alignment', 'pen' );
  1104. $choices = array(
  1105. 'left' => __( 'Left', 'pen' ),
  1106. 'center' => __( 'Center', 'pen' ),
  1107. 'right' => __( 'Right', 'pen' ),
  1108. );
  1109. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1110. $setting_id = "pen_content_thumbnail_resize[$preset]";
  1111. $label = __( 'Post thumbnail size', 'pen' );
  1112. $thumbnail_sizes = array(
  1113. 'none' => __( 'None', 'pen' ),
  1114. );
  1115. foreach ( get_intermediate_image_sizes() as $size ) { /* phpcs:ignore */
  1116. $thumbnail_sizes[ $size ] = ucfirst( $size );
  1117. }
  1118. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $thumbnail_sizes, $label );
  1119. $setting_id = "pen_content_thumbnail_rotate[$preset]";
  1120. $label = __( 'Post thumbnail rotate', 'pen' );
  1121. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1122. $setting_id = "pen_content_thumbnail_frame[$preset]";
  1123. $label = __( 'Post thumbnail framed', 'pen' );
  1124. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1125. $setting_id = "pen_content_tags_display[$preset]";
  1126. $label = __( 'Display post tags', 'pen' );
  1127. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1128. $setting_id = "pen_content_share_location[$preset]";
  1129. $label = __( 'Share buttons location', 'pen' );
  1130. $choices = array(
  1131. 'header' => __( 'Post header', 'pen' ),
  1132. 'content' => __( 'Post content', 'pen' ),
  1133. 'footer' => __( 'Post footer', 'pen' ),
  1134. );
  1135. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1136. $setting_id = "pen_content_share_display[$preset]";
  1137. $label = __( 'Display share buttons', 'pen' );
  1138. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1139. $setting_id = "pen_content_profile_display[$preset]";
  1140. $label = __( 'Display author profile', 'pen' );
  1141. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1142. $setting_id = "pen_comments_animation_reveal[$preset]";
  1143. $label = __( 'Comments animation', 'pen' );
  1144. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1145. $setting_id = "pen_content_pager_animation_reveal[$preset]";
  1146. $label = __( 'Pagination animation', 'pen' );
  1147. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1148. }
  1149. }
  1150. if ( ! function_exists( 'pen_customize_site_layout' ) ) {
  1151. /**
  1152. * Adds "Site layout" options.
  1153. *
  1154. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1155. *
  1156. * @since Pen 1.0.0
  1157. * @return void
  1158. */
  1159. function pen_customize_site_layout( &$wp_customize ) {
  1160. $preset = 'preset_1';
  1161. $panel = 'pen_panel_content';
  1162. $section = 'pen_section_layout';
  1163. $wp_customize->add_section(
  1164. $section,
  1165. array(
  1166. 'title' => __( 'Site layout', 'pen' ),
  1167. 'panel' => $panel,
  1168. )
  1169. );
  1170. $setting_id = "pen_site_width[$preset]";
  1171. $label = __( 'Site layout', 'pen' );
  1172. $choices = array(
  1173. 'standard' => __( 'Standard', 'pen' ),
  1174. 'wide' => __( 'Wide', 'pen' ),
  1175. 'boxed' => __( 'Boxed', 'pen' ),
  1176. );
  1177. pen_control_radio( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  1178. $setting_id = "pen_container_position[$preset]";
  1179. $label = __( 'Content area alignment', 'pen' );
  1180. $choices = array(
  1181. 'left' => __( 'Left', 'pen' ),
  1182. 'center' => __( 'Center', 'pen' ),
  1183. 'right' => __( 'Right', 'pen' ),
  1184. );
  1185. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  1186. $setting_id = "pen_round_corners[$preset]";
  1187. $label = __( 'Round corners', 'pen' );
  1188. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1189. }
  1190. }
  1191. if ( ! function_exists( 'pen_customize_front' ) ) {
  1192. /**
  1193. * "Front page" options.
  1194. *
  1195. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1196. *
  1197. * @since Pen 1.0.2
  1198. * @return void
  1199. */
  1200. function pen_customize_front( &$wp_customize ) {
  1201. $preset = 'preset_1';
  1202. $panel = 'pen_panel_front';
  1203. $wp_customize->add_panel(
  1204. $panel,
  1205. array(
  1206. 'title' => __( 'Front Page', 'pen' ),
  1207. 'priority' => 5,
  1208. )
  1209. );
  1210. $wp_customize->get_section( 'static_front_page' )->panel = $panel;
  1211. $wp_customize->get_section( 'static_front_page' )->title = __( 'Front Page Content', 'pen' );
  1212. $section = 'pen_section_front_sidebars';
  1213. $wp_customize->add_section(
  1214. $section,
  1215. array(
  1216. 'title' => __( 'Front page sidebars', 'pen' ),
  1217. 'description' => __( 'You may also use some plugins such as the "Widget Visibility" or "Conditional Logic".', 'pen' ),
  1218. 'panel' => $panel,
  1219. )
  1220. );
  1221. $setting_id = "pen_front_sidebar_header_primary_display[$preset]";
  1222. $label = sprintf(
  1223. /* Translators: %s: a widget are name. */
  1224. __( 'Hide the "%s" widget area', 'pen' ),
  1225. __( 'Header - Primary', 'pen' )
  1226. );
  1227. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1228. $setting_id = "pen_front_sidebar_header_secondary_display[$preset]";
  1229. $label = sprintf(
  1230. /* Translators: %s: a widget are name. */
  1231. __( 'Hide the "%s" widget area', 'pen' ),
  1232. __( 'Header - Secondary', 'pen' )
  1233. );
  1234. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1235. $setting_id = "pen_front_sidebar_search_top_display[$preset]";
  1236. $label = sprintf(
  1237. /* Translators: %s: a widget are name. */
  1238. __( 'Hide the "%s" widget area', 'pen' ),
  1239. __( 'Search - Top', 'pen' )
  1240. );
  1241. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1242. $setting_id = "pen_front_sidebar_search_left_display[$preset]";
  1243. $label = sprintf(
  1244. /* Translators: %s: a widget are name. */
  1245. __( 'Hide the "%s" widget area', 'pen' ),
  1246. __( 'Search - Left', 'pen' )
  1247. );
  1248. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1249. $setting_id = "pen_front_sidebar_search_right_display[$preset]";
  1250. $label = sprintf(
  1251. /* Translators: %s: a widget are name. */
  1252. __( 'Hide the "%s" widget area', 'pen' ),
  1253. __( 'Search - Right', 'pen' )
  1254. );
  1255. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1256. $setting_id = "pen_front_sidebar_search_bottom_display[$preset]";
  1257. $label = sprintf(
  1258. /* Translators: %s: a widget are name. */
  1259. __( 'Hide the "%s" widget area', 'pen' ),
  1260. __( 'Search - Bottom', 'pen' )
  1261. );
  1262. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1263. $setting_id = "pen_front_sidebar_top_display[$preset]";
  1264. $label = sprintf(
  1265. /* Translators: %s: a widget are name. */
  1266. __( 'Hide the "%s" widget area', 'pen' ),
  1267. __( 'Top', 'pen' )
  1268. );
  1269. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1270. $setting_id = "pen_front_sidebar_left_display[$preset]";
  1271. $label = sprintf(
  1272. /* Translators: %s: a widget are name. */
  1273. __( 'Hide the "%s" widget area', 'pen' ),
  1274. __( 'Left', 'pen' )
  1275. );
  1276. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1277. $setting_id = "pen_front_sidebar_right_display[$preset]";
  1278. $label = sprintf(
  1279. /* Translators: %s: a widget are name. */
  1280. __( 'Hide the "%s" widget area', 'pen' ),
  1281. __( 'Right', 'pen' )
  1282. );
  1283. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1284. $setting_id = "pen_front_sidebar_content_top_display[$preset]";
  1285. $label = sprintf(
  1286. /* Translators: %s: a widget are name. */
  1287. __( 'Hide the "%s" widget area', 'pen' ),
  1288. __( 'Content - Top', 'pen' )
  1289. );
  1290. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1291. $setting_id = "pen_front_sidebar_content_bottom_display[$preset]";
  1292. $label = sprintf(
  1293. /* Translators: %s: a widget are name. */
  1294. __( 'Hide the "%s" widget area', 'pen' ),
  1295. __( 'Content - Bottom', 'pen' )
  1296. );
  1297. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1298. $setting_id = "pen_front_sidebar_bottom_display[$preset]";
  1299. $label = sprintf(
  1300. /* Translators: %s: a widget are name. */
  1301. __( 'Hide the "%s" widget area', 'pen' ),
  1302. __( 'Bottom', 'pen' )
  1303. );
  1304. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1305. $setting_id = "pen_front_sidebar_footer_top_display[$preset]";
  1306. $label = sprintf(
  1307. /* Translators: %s: a widget are name. */
  1308. __( 'Hide the "%s" widget area', 'pen' ),
  1309. __( 'Footer - Top', 'pen' )
  1310. );
  1311. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1312. $setting_id = "pen_front_sidebar_footer_left_display[$preset]";
  1313. $label = sprintf(
  1314. /* Translators: %s: a widget are name. */
  1315. __( 'Hide the "%s" widget area', 'pen' ),
  1316. __( 'Footer - Left', 'pen' )
  1317. );
  1318. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1319. $setting_id = "pen_front_sidebar_footer_right_display[$preset]";
  1320. $label = sprintf(
  1321. /* Translators: %s: a widget are name. */
  1322. __( 'Hide the "%s" widget area', 'pen' ),
  1323. __( 'Footer - Right', 'pen' )
  1324. );
  1325. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1326. $setting_id = "pen_front_sidebar_footer_bottom_display[$preset]";
  1327. $label = sprintf(
  1328. /* Translators: %s: a widget are name. */
  1329. __( 'Hide the "%s" widget area', 'pen' ),
  1330. __( 'Footer - Bottom', 'pen' )
  1331. );
  1332. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1333. }
  1334. }
  1335. if ( ! function_exists( 'pen_customize_footer' ) ) {
  1336. /**
  1337. * Adds footer options.
  1338. *
  1339. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1340. *
  1341. * @since Pen 1.0.0
  1342. * @return void
  1343. */
  1344. function pen_customize_footer( &$wp_customize ) {
  1345. $preset = 'preset_1';
  1346. $section = 'pen_section_footer';
  1347. $wp_customize->add_section(
  1348. $section,
  1349. array(
  1350. 'title' => __( 'Footer', 'pen' ),
  1351. 'description' => __( 'You can control the visibility of the phone number and social network icons through Customize &rarr; Contact and the colors of the footer links through Customize &rarr; Colors &rarr; Footer.', 'pen' ),
  1352. 'priority' => 6,
  1353. )
  1354. );
  1355. $setting_id = "pen_footer_alignment[$preset]";
  1356. $label = __( 'Footer alignment', 'pen' );
  1357. $choices = array(
  1358. 'left' => __( 'Left', 'pen' ),
  1359. 'center' => __( 'Center', 'pen' ),
  1360. 'right' => __( 'Right', 'pen' ),
  1361. );
  1362. pen_control_select( $wp_customize, $setting_id, $section, 'postMessage', $choices, $label );
  1363. $setting_id = "pen_footer_menu_display[$preset]";
  1364. $label = __( 'Display footer navigation', 'pen' );
  1365. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  1366. $setting_id = "pen_footer_menu_animation_reveal[$preset]";
  1367. $label = __( 'Footer menu animation', 'pen' );
  1368. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1369. $setting_id = "pen_footer_back_to_top_display[$preset]";
  1370. $label = __( 'Display "back to top" link', 'pen' );
  1371. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1372. $setting_id = "pen_footer_copyright_display[$preset]";
  1373. $label = __( 'Display copyright', 'pen' );
  1374. pen_control_checkbox( $wp_customize, $setting_id, $section, 'postMessage', $label );
  1375. $setting_id = "pen_footer_copyright_text[$preset]";
  1376. $label = __( 'Copyright notice', 'pen' );
  1377. $description = sprintf(
  1378. /* Translators: %s: HTML list. */
  1379. __( 'The following tokens are available:%s', 'pen' ),
  1380. sprintf(
  1381. '<br><ul><li>%s</li><li>%s</li><li>%s</li></ul>%s',
  1382. __( '<strong>%YEAR%</strong> for the current year.', 'pen' ),
  1383. __( '<strong>%SITE_NAME%</strong> for your site name as set in Settings &rarr; General.', 'pen' ),
  1384. __( '<strong>%SITE_URL%</strong> for your site URL as set in Settings &rarr; General.', 'pen' ),
  1385. sprintf(
  1386. /* Translators: %s: some text. */
  1387. __( '<strong>Examples:</strong>%s', 'pen' ),
  1388. sprintf(
  1389. '<br><small>%s</small><br><small>%s</small><br><small><em>%s</em></small>',
  1390. '&amp;copy; %YEAR% by %SITE_NAME%. All Rights Reserved.',
  1391. '&amp;copy; %YEAR% by &lt;a href="%SITE_URL%"&gt;%SITE_NAME%&lt;/a&gt;. All Rights Reserved.',
  1392. __( '(Supports limited HTML)', 'pen' )
  1393. )
  1394. )
  1395. )
  1396. );
  1397. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1398. }
  1399. }
  1400. if ( ! function_exists( 'pen_customize_contact' ) ) {
  1401. /**
  1402. * Adds contact details options.
  1403. *
  1404. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1405. *
  1406. * @since Pen 1.0.0
  1407. * @return void
  1408. */
  1409. function pen_customize_contact( &$wp_customize ) {
  1410. $preset = 'preset_1';
  1411. $panel = 'pen_panel_contact';
  1412. $wp_customize->add_panel(
  1413. $panel,
  1414. array(
  1415. 'title' => __( 'Contact information', 'pen' ),
  1416. 'priority' => 7,
  1417. )
  1418. );
  1419. $section = 'pen_section_twitter';
  1420. $wp_customize->add_section(
  1421. $section,
  1422. array(
  1423. 'title' => __( 'Twitter', 'pen' ),
  1424. 'panel' => $panel,
  1425. )
  1426. );
  1427. $setting_id = "pen_twitter[$preset]";
  1428. $label = __( 'Twitter URL', 'pen' );
  1429. $description = 'https://twitter.com/example';
  1430. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1431. $setting_id = "pen_twitter_header_display[$preset]";
  1432. $label = __( 'Twitter link in the header', 'pen' );
  1433. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1434. $setting_id = "pen_twitter_footer_display[$preset]";
  1435. $label = __( 'Twitter link in the footer', 'pen' );
  1436. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1437. $section = 'pen_section_facebook';
  1438. $wp_customize->add_section(
  1439. $section,
  1440. array(
  1441. 'title' => __( 'Facebook', 'pen' ),
  1442. 'panel' => $panel,
  1443. )
  1444. );
  1445. $setting_id = "pen_facebook[$preset]";
  1446. $label = __( 'Facebook URL', 'pen' );
  1447. $description = 'https://facebook.com/example';
  1448. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1449. $setting_id = "pen_facebook_header_display[$preset]";
  1450. $label = __( 'Facebook link in the header', 'pen' );
  1451. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1452. $setting_id = "pen_facebook_footer_display[$preset]";
  1453. $label = __( 'Facebook link in the footer', 'pen' );
  1454. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1455. $section = 'pen_section_instagram';
  1456. $wp_customize->add_section(
  1457. $section,
  1458. array(
  1459. 'title' => __( 'Instagram', 'pen' ),
  1460. 'panel' => $panel,
  1461. )
  1462. );
  1463. $setting_id = "pen_instagram[$preset]";
  1464. $label = __( 'Instagram URL', 'pen' );
  1465. $description = 'https://instagram.com/example';
  1466. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1467. $setting_id = "pen_instagram_header_display[$preset]";
  1468. $label = __( 'Instagram link in the header', 'pen' );
  1469. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1470. $setting_id = "pen_instagram_footer_display[$preset]";
  1471. $label = __( 'Instagram link in the footer', 'pen' );
  1472. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1473. $section = 'pen_section_vk';
  1474. $wp_customize->add_section(
  1475. $section,
  1476. array(
  1477. 'title' => __( 'VK', 'pen' ),
  1478. 'panel' => $panel,
  1479. )
  1480. );
  1481. $setting_id = "pen_vk[$preset]";
  1482. $label = __( 'VK URL', 'pen' );
  1483. $description = 'https://vk.com/example';
  1484. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1485. $setting_id = "pen_vk_header_display[$preset]";
  1486. $label = __( 'VK link in the header', 'pen' );
  1487. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1488. $setting_id = "pen_vk_footer_display[$preset]";
  1489. $label = __( 'VK link in the footer', 'pen' );
  1490. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1491. $section = 'pen_section_pinterest';
  1492. $wp_customize->add_section(
  1493. $section,
  1494. array(
  1495. 'title' => __( 'Pinterest', 'pen' ),
  1496. 'panel' => $panel,
  1497. )
  1498. );
  1499. $setting_id = "pen_pinterest[$preset]";
  1500. $label = __( 'Pinterest URL', 'pen' );
  1501. $description = 'https://pinterest.com/example';
  1502. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1503. $setting_id = "pen_pinterest_header_display[$preset]";
  1504. $label = __( 'Pinterest link in the header', 'pen' );
  1505. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1506. $setting_id = "pen_pinterest_footer_display[$preset]";
  1507. $label = __( 'Pinterest link in the footer', 'pen' );
  1508. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1509. $section = 'pen_section_linkedin';
  1510. $wp_customize->add_section(
  1511. $section,
  1512. array(
  1513. 'title' => __( 'LinkedIn', 'pen' ),
  1514. 'panel' => $panel,
  1515. )
  1516. );
  1517. $setting_id = "pen_linkedin[$preset]";
  1518. $label = __( 'LinkedIn URL', 'pen' );
  1519. $description = 'https://linkedin.com/example';
  1520. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1521. $setting_id = "pen_linkedin_header_display[$preset]";
  1522. $label = __( 'LinkedIn link in the header', 'pen' );
  1523. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1524. $setting_id = "pen_linkedin_footer_display[$preset]";
  1525. $label = __( 'LinkedIn link in the footer', 'pen' );
  1526. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1527. $section = 'pen_section_flickr';
  1528. $wp_customize->add_section(
  1529. $section,
  1530. array(
  1531. 'title' => __( 'Flickr', 'pen' ),
  1532. 'panel' => 'pen_panel_contact',
  1533. )
  1534. );
  1535. $setting_id = "pen_flickr[$preset]";
  1536. $label = __( 'Flickr URL', 'pen' );
  1537. $description = 'https://flickr.com/example';
  1538. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1539. $setting_id = "pen_flickr_header_display[$preset]";
  1540. $label = __( 'Flickr link in the header', 'pen' );
  1541. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1542. $setting_id = "pen_flickr_footer_display[$preset]";
  1543. $label = __( 'Flickr link in the footer', 'pen' );
  1544. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1545. $section = 'pen_section_bitbucket';
  1546. $wp_customize->add_section(
  1547. $section,
  1548. array(
  1549. 'title' => __( 'BitBucket', 'pen' ),
  1550. 'panel' => 'pen_panel_contact',
  1551. )
  1552. );
  1553. $setting_id = "pen_bitbucket[$preset]";
  1554. $label = __( 'BitBucket URL', 'pen' );
  1555. $description = 'https://bitbucket.com/example';
  1556. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1557. $setting_id = "pen_bitbucket_header_display[$preset]";
  1558. $label = __( 'BitBucket link in the header', 'pen' );
  1559. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1560. $setting_id = "pen_bitbucket_footer_display[$preset]";
  1561. $label = __( 'BitBucket link in the footer', 'pen' );
  1562. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1563. $section = 'pen_section_github';
  1564. $wp_customize->add_section(
  1565. $section,
  1566. array(
  1567. 'title' => __( 'Github', 'pen' ),
  1568. 'panel' => 'pen_panel_contact',
  1569. )
  1570. );
  1571. $setting_id = "pen_github[$preset]";
  1572. $label = __( 'Github URL', 'pen' );
  1573. $description = 'https://github.com/example';
  1574. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1575. $setting_id = "pen_github_header_display[$preset]";
  1576. $label = __( 'Github link in the header', 'pen' );
  1577. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1578. $setting_id = "pen_github_footer_display[$preset]";
  1579. $label = __( 'Github link in the footer', 'pen' );
  1580. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1581. $section = 'pen_section_slack';
  1582. $wp_customize->add_section(
  1583. $section,
  1584. array(
  1585. 'title' => __( 'Slack', 'pen' ),
  1586. 'panel' => $panel,
  1587. )
  1588. );
  1589. $setting_id = "pen_slack[$preset]";
  1590. $label = __( 'Slack URL', 'pen' );
  1591. $description = 'https://slack.com/example';
  1592. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1593. $setting_id = "pen_slack_header_display[$preset]";
  1594. $label = __( 'Slack link in the header', 'pen' );
  1595. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1596. $setting_id = "pen_slack_footer_display[$preset]";
  1597. $label = __( 'Slack link in the footer', 'pen' );
  1598. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1599. $section = 'pen_section_telegram';
  1600. $wp_customize->add_section(
  1601. $section,
  1602. array(
  1603. 'title' => __( 'Telegram', 'pen' ),
  1604. 'panel' => $panel,
  1605. )
  1606. );
  1607. $setting_id = "pen_telegram[$preset]";
  1608. $label = __( 'Telegram URL', 'pen' );
  1609. $description = 'https://t.me/example';
  1610. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1611. $setting_id = "pen_telegram_header_display[$preset]";
  1612. $label = __( 'Telegram link in the header', 'pen' );
  1613. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1614. $setting_id = "pen_telegram_footer_display[$preset]";
  1615. $label = __( 'Telegram link in the footer', 'pen' );
  1616. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1617. $section = 'pen_section_whatsapp';
  1618. $wp_customize->add_section(
  1619. $section,
  1620. array(
  1621. 'title' => __( 'WhatsApp', 'pen' ),
  1622. 'panel' => $panel,
  1623. )
  1624. );
  1625. $setting_id = "pen_whatsapp[$preset]";
  1626. $label = __( 'WhatsApp Link', 'pen' );
  1627. $description = 'whatsapp://send?text=Hi!&phone=+123456789';
  1628. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1629. $setting_id = "pen_whatsapp_header_display[$preset]";
  1630. $label = __( 'WhatsApp link in the header', 'pen' );
  1631. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1632. $setting_id = "pen_whatsapp_footer_display[$preset]";
  1633. $label = __( 'WhatsApp link in the footer', 'pen' );
  1634. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1635. $section = 'pen_section_skype';
  1636. $wp_customize->add_section(
  1637. $section,
  1638. array(
  1639. 'title' => __( 'Skype', 'pen' ),
  1640. 'panel' => $panel,
  1641. )
  1642. );
  1643. $setting_id = "pen_skype[$preset]";
  1644. $label = __( 'Skype Link', 'pen' );
  1645. $description = 'skype:username?call';
  1646. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1647. $setting_id = "pen_skype_header_display[$preset]";
  1648. $label = __( 'Skype link in the header', 'pen' );
  1649. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1650. $setting_id = "pen_skype_footer_display[$preset]";
  1651. $label = __( 'Skype link in the footer', 'pen' );
  1652. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1653. $section = 'pen_section_phone';
  1654. $wp_customize->add_section(
  1655. $section,
  1656. array(
  1657. 'title' => __( 'Phone', 'pen' ),
  1658. 'panel' => $panel,
  1659. )
  1660. );
  1661. $setting_id = "pen_phone[$preset]";
  1662. $label = __( 'Phone number', 'pen' );
  1663. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label );
  1664. $setting_id = "pen_phone_header_display[$preset]";
  1665. $label = __( 'Phone number in the header', 'pen' );
  1666. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1667. $setting_id = "pen_phone_header_animation_reveal[$preset]";
  1668. $label = __( 'Header phone number animation', 'pen' );
  1669. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1670. $setting_id = "pen_phone_footer_display[$preset]";
  1671. $label = __( 'Phone number in the footer', 'pen' );
  1672. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1673. $setting_id = "pen_phone_footer_animation_reveal[$preset]";
  1674. $label = __( 'Footer phone number animation', 'pen' );
  1675. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1676. $section = 'pen_section_rss';
  1677. $wp_customize->add_section(
  1678. $section,
  1679. array(
  1680. 'title' => __( 'Feed', 'pen' ),
  1681. 'panel' => $panel,
  1682. )
  1683. );
  1684. $setting_id = "pen_rss[$preset]";
  1685. $label = __( 'Feed URL', 'pen' );
  1686. $description = 'http://example.com/rss.xml';
  1687. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1688. $setting_id = "pen_rss_header_display[$preset]";
  1689. $label = __( 'RSS link in the header', 'pen' );
  1690. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1691. $setting_id = "pen_rss_footer_display[$preset]";
  1692. $label = __( 'RSS link in the footer', 'pen' );
  1693. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1694. $section = 'pen_section_email';
  1695. $wp_customize->add_section(
  1696. $section,
  1697. array(
  1698. 'title' => __( 'E-mail', 'pen' ),
  1699. 'panel' => $panel,
  1700. )
  1701. );
  1702. $setting_id = "pen_email[$preset]";
  1703. $label = __( 'Your e-mail or URL to a "Contact us" page', 'pen' );
  1704. $description = __( 'mail@example.com or http://example.com/contact-us', 'pen' );
  1705. pen_control_text( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1706. $setting_id = "pen_email_header_display[$preset]";
  1707. $label = __( 'E-mail link in the header', 'pen' );
  1708. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1709. $setting_id = "pen_email_footer_display[$preset]";
  1710. $label = __( 'E-mail link in the footer', 'pen' );
  1711. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1712. }
  1713. }
  1714. if ( ! function_exists( 'pen_customize_background' ) ) {
  1715. /**
  1716. * Adds the background image options.
  1717. *
  1718. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1719. *
  1720. * @since Pen 1.0.0
  1721. * @return void
  1722. */
  1723. function pen_customize_background( &$wp_customize ) {
  1724. $preset = 'preset_1';
  1725. $panel = 'p_panel_background_images';
  1726. $wp_customize->add_panel(
  1727. $panel,
  1728. array(
  1729. 'title' => __( 'Background images', 'pen' ),
  1730. 'priority' => 10,
  1731. )
  1732. );
  1733. $section = 'background_image';
  1734. $wp_customize->get_section( $section )->title = __( 'Site', 'pen' );
  1735. $wp_customize->get_section( $section )->priority = 1;
  1736. $wp_customize->get_section( $section )->transport = 'refresh';
  1737. $wp_customize->get_section( $section )->panel = $panel;
  1738. $setting_id = "pen_background_lights_dim[$preset]";
  1739. $label = __( 'Dim the lights', 'pen' );
  1740. $description = __( '(This feature is a part of the "Pen" theme.)', 'pen' );
  1741. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label, $description );
  1742. $section = 'header_image';
  1743. $wp_customize->get_section( $section )->title = __( 'Header', 'pen' );
  1744. $wp_customize->get_section( $section )->priority = 2;
  1745. $wp_customize->get_section( $section )->transport = 'refresh';
  1746. $wp_customize->get_section( $section )->panel = $panel;
  1747. $section = 'pen_section_background_image_navigation';
  1748. $wp_customize->add_section(
  1749. $section,
  1750. array(
  1751. 'title' => __( 'Navigation', 'pen' ),
  1752. 'priority' => 3,
  1753. 'panel' => $panel,
  1754. )
  1755. );
  1756. $setting_id = "pen_background_image_navigation[$preset]";
  1757. $label = __( 'Navigation', 'pen' );
  1758. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1759. $setting_id = "pen_background_image_navigation_submenu[$preset]";
  1760. $label = __( 'Navigation (Sub-menus)', 'pen' );
  1761. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1762. $section = 'pen_section_background_image_search';
  1763. $wp_customize->add_section(
  1764. $section,
  1765. array(
  1766. 'title' => __( 'Search Bar', 'pen' ),
  1767. 'priority' => 4,
  1768. 'description' => __( 'Please make sure you have the search box added to the top of the content area through Customize &rarr; Search so you can see your background image.', 'pen' ),
  1769. 'panel' => $panel,
  1770. )
  1771. );
  1772. $setting_id = "pen_background_image_search[$preset]";
  1773. $label = __( 'Search Bar', 'pen' );
  1774. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1775. $section = 'pen_section_background_image_content_title';
  1776. $wp_customize->add_section(
  1777. $section,
  1778. array(
  1779. 'title' => __( 'Content', 'pen' ),
  1780. 'priority' => 5,
  1781. 'panel' => $panel,
  1782. )
  1783. );
  1784. $setting_id = "pen_background_image_content_title[$preset]";
  1785. $label = __( 'Content Title', 'pen' );
  1786. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1787. $setting_id = "pen_background_image_content_title_dynamic[$preset]";
  1788. $label = __( 'Use featured image as background', 'pen' );
  1789. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1790. $section = 'pen_section_background_image_bottom';
  1791. $wp_customize->add_section(
  1792. $section,
  1793. array(
  1794. 'title' => __( 'Bottom', 'pen' ),
  1795. 'priority' => 6,
  1796. 'panel' => $panel,
  1797. )
  1798. );
  1799. $setting_id = "pen_background_image_bottom[$preset]";
  1800. $label = __( 'Bottom', 'pen' );
  1801. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1802. $section = 'pen_section_background_image_footer';
  1803. $wp_customize->add_section(
  1804. $section,
  1805. array(
  1806. 'title' => __( 'Footer', 'pen' ),
  1807. 'priority' => 7,
  1808. 'panel' => $panel,
  1809. )
  1810. );
  1811. $setting_id = "pen_background_image_footer[$preset]";
  1812. $label = __( 'Footer', 'pen' );
  1813. pen_control_image( $wp_customize, $setting_id, $section, 'refresh', $label );
  1814. }
  1815. }
  1816. if ( ! function_exists( 'pen_customize_logo' ) ) {
  1817. /**
  1818. * Moves logo options to "Site Identity".
  1819. *
  1820. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1821. *
  1822. * @since Pen 1.0.8
  1823. * @return void
  1824. */
  1825. function pen_customize_logo( &$wp_customize ) {
  1826. $preset = 'preset_1';
  1827. $section = 'title_tagline';
  1828. $setting_id = "pen_header_logo_display[$preset]";
  1829. $label = __( 'Display the site logo', 'pen' );
  1830. pen_control_checkbox( $wp_customize, $setting_id, $section, 'refresh', $label );
  1831. $setting_id = "pen_header_logo_animation_reveal[$preset]";
  1832. $label = __( 'Logo animation', 'pen' );
  1833. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', pen_animations(), $label );
  1834. $setting_id = "pen_header_logo_size[$preset]";
  1835. $label = __( 'Logo size', 'pen' );
  1836. $choices = array(
  1837. 'none' => __( 'None', 'pen' ),
  1838. 'height' => __( 'Limit height', 'pen' ),
  1839. 'width' => __( 'Limit width', 'pen' ),
  1840. );
  1841. pen_control_select( $wp_customize, $setting_id, $section, 'refresh', $choices, $label );
  1842. }
  1843. }
  1844. if ( ! function_exists( 'pen_control_color' ) ) {
  1845. /**
  1846. * Color control.
  1847. *
  1848. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1849. * @param string $setting_id The setting ID.
  1850. * @param string $section Field section.
  1851. * @param string $transport Transport type.
  1852. * @param string $label Field label.
  1853. * @param string $description Field description.
  1854. *
  1855. * @since Pen 1.0.8
  1856. * @return void
  1857. */
  1858. function pen_control_color( &$wp_customize, $setting_id, $section, $transport, $label, $description = '' ) {
  1859. $wp_customize->add_setting(
  1860. $setting_id,
  1861. array(
  1862. 'default' => pen_option_default( $setting_id ),
  1863. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  1864. 'transport' => $transport,
  1865. )
  1866. );
  1867. $wp_customize->add_control(
  1868. new WP_Customize_Color_Control(
  1869. $wp_customize,
  1870. $setting_id,
  1871. array(
  1872. 'label' => $label,
  1873. 'description' => $description,
  1874. 'section' => $section,
  1875. 'settings' => $setting_id,
  1876. )
  1877. )
  1878. );
  1879. }
  1880. }
  1881. if ( ! function_exists( 'pen_control_image' ) ) {
  1882. /**
  1883. * Image control.
  1884. *
  1885. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1886. * @param string $setting_id The setting ID.
  1887. * @param string $section Field section.
  1888. * @param string $transport Transport type.
  1889. * @param string $label Field label.
  1890. * @param string $description Field description.
  1891. *
  1892. * @since Pen 1.0.8
  1893. * @return void
  1894. */
  1895. function pen_control_image( &$wp_customize, $setting_id, $section, $transport, $label, $description = '' ) {
  1896. $wp_customize->add_setting(
  1897. $setting_id,
  1898. array(
  1899. 'default' => pen_option_default( $setting_id ),
  1900. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  1901. 'transport' => $transport,
  1902. )
  1903. );
  1904. $wp_customize->add_control(
  1905. new WP_Customize_Image_Control(
  1906. $wp_customize,
  1907. $setting_id,
  1908. array(
  1909. 'label' => $label,
  1910. 'description' => $description,
  1911. 'section' => $section,
  1912. 'settings' => $setting_id,
  1913. )
  1914. )
  1915. );
  1916. }
  1917. }
  1918. if ( ! function_exists( 'pen_control_checkbox' ) ) {
  1919. /**
  1920. * Checkbox control.
  1921. *
  1922. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1923. * @param string $setting_id The setting ID.
  1924. * @param string $section Field section.
  1925. * @param string $transport Transport type.
  1926. * @param string $label Field label.
  1927. * @param string $description Field description.
  1928. *
  1929. * @since Pen 1.0.8
  1930. * @return void
  1931. */
  1932. function pen_control_checkbox( &$wp_customize, $setting_id, $section, $transport, $label, $description = '' ) {
  1933. $wp_customize->add_setting(
  1934. $setting_id,
  1935. array(
  1936. 'default' => pen_option_default( $setting_id ),
  1937. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  1938. 'transport' => $transport,
  1939. )
  1940. );
  1941. $wp_customize->add_control(
  1942. $setting_id,
  1943. array(
  1944. 'label' => $label,
  1945. 'description' => $description,
  1946. 'section' => $section,
  1947. 'type' => 'checkbox',
  1948. )
  1949. );
  1950. }
  1951. }
  1952. if ( ! function_exists( 'pen_control_radio' ) ) {
  1953. /**
  1954. * Radio button control.
  1955. *
  1956. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1957. * @param string $setting_id The setting ID.
  1958. * @param string $section Field section.
  1959. * @param string $transport Transport type.
  1960. * @param array $choices Choices.
  1961. * @param string $label Field label.
  1962. * @param string $description Field description.
  1963. *
  1964. * @since Pen 1.0.8
  1965. * @return void
  1966. */
  1967. function pen_control_radio( &$wp_customize, $setting_id, $section, $transport, $choices, $label, $description = '' ) {
  1968. $wp_customize->add_setting(
  1969. $setting_id,
  1970. array(
  1971. 'default' => pen_option_default( $setting_id ),
  1972. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  1973. 'transport' => $transport,
  1974. )
  1975. );
  1976. $wp_customize->add_control(
  1977. $setting_id,
  1978. array(
  1979. 'label' => $label,
  1980. 'description' => $description,
  1981. 'section' => $section,
  1982. 'type' => 'radio',
  1983. 'choices' => $choices,
  1984. )
  1985. );
  1986. }
  1987. }
  1988. if ( ! function_exists( 'pen_control_select' ) ) {
  1989. /**
  1990. * Select control.
  1991. *
  1992. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  1993. * @param string $setting_id The setting ID.
  1994. * @param string $section Field section.
  1995. * @param string $transport Transport type.
  1996. * @param array $choices Choices.
  1997. * @param string $label Field label.
  1998. * @param string $description Field description.
  1999. *
  2000. * @since Pen 1.0.8
  2001. * @return void
  2002. */
  2003. function pen_control_select( &$wp_customize, $setting_id, $section, $transport, $choices, $label, $description = '' ) {
  2004. $wp_customize->add_setting(
  2005. $setting_id,
  2006. array(
  2007. 'default' => pen_option_default( $setting_id ),
  2008. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  2009. 'transport' => $transport,
  2010. )
  2011. );
  2012. $wp_customize->add_control(
  2013. $setting_id,
  2014. array(
  2015. 'label' => $label,
  2016. 'description' => $description,
  2017. 'section' => $section,
  2018. 'type' => 'select',
  2019. 'choices' => $choices,
  2020. )
  2021. );
  2022. }
  2023. }
  2024. if ( ! function_exists( 'pen_control_text' ) ) {
  2025. /**
  2026. * Text control.
  2027. *
  2028. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  2029. * @param string $setting_id The setting ID.
  2030. * @param string $section Field section.
  2031. * @param string $transport Transport type.
  2032. * @param string $label Field label.
  2033. * @param string $description Field description.
  2034. *
  2035. * @since Pen 1.0.8
  2036. * @return void
  2037. */
  2038. function pen_control_text( &$wp_customize, $setting_id, $section, $transport, $label, $description = '' ) {
  2039. $wp_customize->add_setting(
  2040. $setting_id,
  2041. array(
  2042. 'default' => pen_option_default( $setting_id ),
  2043. 'sanitize_callback' => pen_option_sanitize( $setting_id ),
  2044. 'transport' => $transport,
  2045. )
  2046. );
  2047. $wp_customize->add_control(
  2048. $setting_id,
  2049. array(
  2050. 'label' => $label,
  2051. 'description' => $description,
  2052. 'section' => $section,
  2053. 'type' => 'text',
  2054. )
  2055. );
  2056. }
  2057. }
  2058. if ( ! function_exists( 'pen_inline_css_general' ) ) {
  2059. /**
  2060. * Adds inline CSS.
  2061. *
  2062. * @since Pen 1.0.0
  2063. * @return void
  2064. */
  2065. function pen_inline_css_general() {
  2066. $css = '';
  2067. $preset_color = esc_html( pen_preset_get( 'color' ) );
  2068. $preset_font = esc_html( pen_preset_get( 'font_family' ) );
  2069. $background = esc_html( pen_option_get( 'color_site_background' ) );
  2070. $background_default = pen_option_default( 'color_site_background' );
  2071. $color = esc_html( pen_option_get( 'color_text' ) );
  2072. $color_default = pen_option_default( 'color_text' );
  2073. $site_font = esc_html( pen_option_get( 'font_family_site' ) );
  2074. if ( 'preset_1' !== $preset_color || $background !== $background_default || 'default' !== $site_font || $color !== $color_default ) {
  2075. // background overrides any linear-gradient in the CSS files
  2076. // and background-color for any background image.
  2077. $css .= 'body {
  2078. background-color:' . $background . ';
  2079. background:' . $background . ';';
  2080. if ( 'preset_1' !== $preset_color || $color !== $color_default ) {
  2081. $css .= 'color:' . $color . ';';
  2082. }
  2083. if ( 'default' !== $site_font ) {
  2084. $css .= 'font-family:"' . ltrim( $site_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;';
  2085. }
  2086. $css .= '}';
  2087. }
  2088. $headings_font = esc_html( pen_option_get( 'font_family_headings' ) );
  2089. if ( 'default' !== $headings_font ) {
  2090. $css .= 'h1,h2,h3,h4,h5 {
  2091. font-family:"' . ltrim( $headings_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2092. }';
  2093. }
  2094. if ( pen_option_get( 'color_site_shadow_display' ) ) {
  2095. $shadow_color = esc_html( pen_option_get( 'color_shadow' ) );
  2096. $shadow_color_default = pen_option_default( 'color_shadow' );
  2097. if ( 'preset_1' !== $preset_color || $shadow_color !== $shadow_color_default ) {
  2098. $shadow_color = new \Pen\Color( $shadow_color );
  2099. $shadow_color = $shadow_color->getRgb();
  2100. $shadow_color = 'rgba(' . implode( ',', $shadow_color ) . ',0.5)';
  2101. $css .= 'body.pen_drop_shadow #pen_header .pen_header_inner,
  2102. body.pen_drop_shadow #pen_search,
  2103. body.pen_drop_shadow #pen_bottom.pen_not_transparent,
  2104. body.pen_drop_shadow #pen_footer.pen_not_transparent {
  2105. box-shadow:0 0 20px ' . $shadow_color . ';
  2106. }
  2107. body.pen_drop_shadow #comments,
  2108. body.pen_drop_shadow #main .page-content,
  2109. body.pen_drop_shadow #main .pen_article_wrapper > article,
  2110. body.pen_drop_shadow.pen_list_masonry #pen_masonry article,
  2111. body.pen_drop_shadow.pen_list_plain #pen_pager,
  2112. body.pen_drop_shadow #main .pen_customize_overview.pen_off_screen {
  2113. box-shadow:0 5px 10px ' . $shadow_color . ', 0 0 5px ' . $shadow_color . ';
  2114. }';
  2115. }
  2116. }
  2117. $link_color = esc_html( pen_option_get( 'color_link' ) );
  2118. $link_color_default = pen_option_default( 'color_link' );
  2119. $link_color_hover = esc_html( pen_option_get( 'color_link_hover' ) );
  2120. $link_color_hover_default = pen_option_default( 'color_link_hover' );
  2121. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  2122. $css .= 'a {
  2123. color:' . $link_color . ';
  2124. }';
  2125. }
  2126. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  2127. $css .= 'a:focus,
  2128. a:hover,
  2129. a:active {
  2130. color:' . $link_color_hover . ';
  2131. }';
  2132. }
  2133. $form_font = esc_html( pen_option_get( 'font_family_forms' ) );
  2134. if ( 'default' !== $form_font ) {
  2135. $css .= 'input[type="date"],
  2136. input[type="email"],
  2137. input[type="file"],
  2138. input[type="number"],
  2139. input[type="tel"],
  2140. input[type="time"],
  2141. input[type="text"],
  2142. input[type="url"],
  2143. legend,
  2144. option,
  2145. select,
  2146. textarea,
  2147. #pen_header .pen_header_main .search-form .search-field,
  2148. #pen_search .search-form .search-field {
  2149. font-family:"' . ltrim( $form_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2150. font-weight:normal;
  2151. }';
  2152. }
  2153. $field_background_primary = esc_html( pen_option_get( 'color_bottom_field_background_primary' ) );
  2154. $field_background_primary_default = pen_option_default( 'color_bottom_field_background_primary' );
  2155. $field_background_secondary = esc_html( pen_option_get( 'color_bottom_field_background_secondary' ) );
  2156. $field_background_secondary_default = pen_option_default( 'color_bottom_field_background_secondary' );
  2157. $field_text = esc_html( pen_option_get( 'color_bottom_field_text' ) );
  2158. $field_text_default = pen_option_default( 'color_bottom_field_text' );
  2159. if ( 'preset_1' !== $preset_color || $field_background_primary !== $field_background_primary_default || $field_background_secondary !== $field_background_secondary_default || $field_text !== $field_text_default ) {
  2160. $css .= '#pen_bottom input[type="date"],
  2161. #pen_bottom input[type="email"],
  2162. #pen_bottom input[type="file"],
  2163. #pen_bottom input[type="number"],
  2164. #pen_bottom input[type="tel"],
  2165. #pen_bottom input[type="time"],
  2166. #pen_bottom input[type="text"],
  2167. #pen_bottom input[type="url"],
  2168. #pen_bottom option,
  2169. #pen_bottom select,
  2170. #pen_bottom textarea {
  2171. background:' . $field_background_secondary . ';';
  2172. if ( $field_background_primary !== $field_background_secondary ) {
  2173. $css .= 'background:-ms-linear-gradient(top,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);
  2174. background:linear-gradient(to bottom,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);';
  2175. }
  2176. if ( 'preset_1' !== $preset_color || $field_text !== $field_text_default ) {
  2177. $css .= 'color:' . $field_text . ';';
  2178. }
  2179. $css .= '}';
  2180. }
  2181. $button_color_text = esc_html( pen_option_get( 'color_button_text' ) );
  2182. $button_color_text_default = pen_option_default( 'color_button_text' );
  2183. $button_color_primary = esc_html( pen_option_get( 'color_button_background_primary' ) );
  2184. $button_color_primary_default = pen_option_default( 'color_button_background_primary' );
  2185. $button_color_secondary = esc_html( pen_option_get( 'color_button_background_secondary' ) );
  2186. $button_color_secondary_default = pen_option_default( 'color_button_background_secondary' );
  2187. $button_color_border = esc_html( pen_option_get( 'color_button_border' ) );
  2188. $button_color_border_default = pen_option_default( 'color_button_border' );
  2189. $button_font = esc_html( pen_option_get( 'font_family_buttons' ) );
  2190. if ( 'preset_1' !== $preset_color || $button_color_text !== $button_color_text_default || $button_color_primary !== $button_color_primary_default || $button_color_secondary !== $button_color_secondary_default || $button_color_border !== $button_color_border_default || 'default' !== $button_font ) {
  2191. $css .= '#primary .pen_button,
  2192. #primary .comments-link a,
  2193. #primary a.post-edit-link,
  2194. #primary .comment-list a.comment-edit-link,
  2195. #primary .comment-list .reply a,
  2196. #primary input[type="submit"],
  2197. #primary .entry-footer .tags-links a,
  2198. #page .hpcf_button_submit,
  2199. #cancel-comment-reply-link,
  2200. #content .page-links a,
  2201. #content .comment-navigation a,
  2202. #content .posts-navigation a,
  2203. #content .post-navigation a,
  2204. #content .wp-pagenavi a,
  2205. #content .wp-pagenavi span {';
  2206. if ( 'preset_1' !== $preset_color || $button_color_primary !== $button_color_primary_default || $button_color_secondary !== $button_color_secondary_default ) {
  2207. $css .= 'background-color:' . $button_color_secondary . ';
  2208. background:' . $button_color_secondary . ';';
  2209. if ( $button_color_primary !== $button_color_secondary ) {
  2210. $css .= 'background:-ms-linear-gradient(top,' . $button_color_primary . ' 0%,' . $button_color_secondary . ' 100%);
  2211. background:linear-gradient(to bottom,' . $button_color_primary . ' 0%,' . $button_color_secondary . ' 100%);';
  2212. }
  2213. }
  2214. if ( 'preset_1' !== $preset_color || $button_color_text !== $button_color_text_default ) {
  2215. $css .= 'color:' . $button_color_text . ' !important;';
  2216. }
  2217. if ( 'preset_1' !== $preset_color || $button_color_border !== $button_color_border_default ) {
  2218. $css .= 'border:1px solid' . $button_color_border . ' !important;';
  2219. }
  2220. if ( 'default' !== $button_font ) {
  2221. $css .= 'font-family:"' . ltrim( $button_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2222. font-weight:normal;';
  2223. }
  2224. $css .= '}';
  2225. if ( 'preset_1' !== $preset_color || $button_color_primary !== $button_color_primary_default || $button_color_secondary !== $button_color_secondary_default ) {
  2226. $css .= '#primary .pen_button:active,
  2227. #primary .comments-link a:active,
  2228. #primary a.post-edit-link:active,
  2229. #primary .comment-list a.comment-edit-link:active,
  2230. #primary .comment-list .reply a:active,
  2231. #primary input[type="submit"]:active,
  2232. #primary .entry-footer .tags-links a:active,
  2233. #cancel-comment-reply-link:active,
  2234. #content .entry-content input[type="submit"]:active,
  2235. #content .page-links a:active,
  2236. #content .comment-navigation a:active,
  2237. #content .posts-navigation a:active,
  2238. #content .post-navigation a:active,
  2239. #content .wp-pagenavi span,
  2240. #content .wp-pagenavi .current {
  2241. background:' . $button_color_secondary . ';
  2242. }';
  2243. }
  2244. if ( 'default' !== $button_font ) {
  2245. $css .= '#pen_header .pen_header_main .search-form .search-submit {
  2246. font-family:"' . ltrim( $button_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2247. font-weight:normal;
  2248. }';
  2249. }
  2250. }
  2251. if ( pen_sidebar_check( 'sidebar-top' ) ) {
  2252. $widget_title_top_font = esc_html( pen_option_get( 'font_family_widget_title_top' ) );
  2253. $widget_title_top_font_size = esc_html( pen_option_get( 'font_size_widget_title_top' ) );
  2254. $widget_title_top_font_size_default = pen_option_default( 'font_size_widget_title_top' );
  2255. if ( 'default' !== $widget_title_top_font || $widget_title_top_font_size !== $widget_title_top_font_size_default ) {
  2256. $css .= '#pen_top .widget-title {';
  2257. if ( 'default' !== $widget_title_top_font ) {
  2258. $css .= 'font-family:"' . ltrim( $widget_title_top_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2259. font-weight:normal;';
  2260. }
  2261. if ( $widget_title_top_font_size !== $widget_title_top_font_size_default ) {
  2262. $css .= 'font-size:' . $widget_title_top_font_size . ';';
  2263. }
  2264. $css .= '}';
  2265. }
  2266. }
  2267. if ( pen_sidebar_check( 'sidebar-left' ) ) {
  2268. $widget_title_left_font = esc_html( pen_option_get( 'font_family_widget_title_left' ) );
  2269. $widget_title_left_font_size = esc_html( pen_option_get( 'font_size_widget_title_left' ) );
  2270. $widget_title_left_font_size_default = pen_option_default( 'font_size_widget_title_left' );
  2271. if ( 'default' !== $widget_title_left_font || $widget_title_left_font_size !== $widget_title_left_font_size_default ) {
  2272. $css .= '#pen_left .widget-title {';
  2273. if ( 'default' !== $widget_title_left_font ) {
  2274. $css .= 'font-family:"' . ltrim( $widget_title_left_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2275. font-weight:normal;';
  2276. }
  2277. if ( $widget_title_left_font_size !== $widget_title_left_font_size_default ) {
  2278. $css .= 'font-size:' . $widget_title_left_font_size . ';';
  2279. }
  2280. $css .= '}';
  2281. }
  2282. }
  2283. if ( pen_sidebar_check( 'sidebar-right' ) ) {
  2284. $widget_title_right_font = esc_html( pen_option_get( 'font_family_widget_title_right' ) );
  2285. $widget_title_right_font_size = esc_html( pen_option_get( 'font_size_widget_title_right' ) );
  2286. $widget_title_right_font_size_default = pen_option_default( 'font_size_widget_title_right' );
  2287. if ( 'default' !== $widget_title_right_font || $widget_title_right_font_size !== $widget_title_right_font_size_default ) {
  2288. $css .= '#pen_right .widget-title {';
  2289. if ( 'default' !== $widget_title_right_font ) {
  2290. $css .= 'font-family:"' . ltrim( $widget_title_right_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2291. font-weight:normal;';
  2292. }
  2293. if ( $widget_title_right_font_size !== $widget_title_right_font_size_default ) {
  2294. $css .= 'font-size:' . $widget_title_right_font_size . ';';
  2295. }
  2296. $css .= '}';
  2297. }
  2298. }
  2299. if ( pen_sidebar_check( 'sidebar-bottom' ) ) {
  2300. $widget_title_bottom_font = esc_html( pen_option_get( 'font_family_widget_title_bottom' ) );
  2301. $widget_title_bottom_font_size = esc_html( pen_option_get( 'font_size_widget_title_bottom' ) );
  2302. $widget_title_bottom_font_size_default = pen_option_default( 'font_size_widget_title_bottom' );
  2303. if ( 'default' !== $widget_title_bottom_font || $widget_title_bottom_font_size !== $widget_title_bottom_font_size_default ) {
  2304. $css .= '#pen_bottom .widget-title {';
  2305. if ( 'default' !== $widget_title_bottom_font ) {
  2306. $css .= 'font-family:"' . ltrim( $widget_title_bottom_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2307. font-weight:normal;';
  2308. }
  2309. if ( $widget_title_bottom_font_size !== $widget_title_bottom_font_size_default ) {
  2310. $css .= 'font-size:' . $widget_title_bottom_font_size . ';';
  2311. }
  2312. $css .= '}';
  2313. }
  2314. }
  2315. $css = pen_compress_css( $css );
  2316. wp_add_inline_style( 'pen-css', $css );
  2317. }
  2318. add_action( 'wp_enqueue_scripts', 'pen_inline_css_general' );
  2319. }
  2320. if ( ! function_exists( 'pen_inline_css_header' ) ) {
  2321. /**
  2322. * Adds inline CSS for the header.
  2323. *
  2324. * @since Pen 1.0.0
  2325. * @return void
  2326. */
  2327. function pen_inline_css_header() {
  2328. $css = '';
  2329. $preset_color = esc_html( pen_preset_get( 'color' ) );
  2330. $background_left = esc_html( pen_option_get( 'color_header_background_primary' ) );
  2331. $background_left_default = pen_option_default( 'color_header_background_primary' );
  2332. $background_right = esc_html( pen_option_get( 'color_header_background_secondary' ) );
  2333. $background_right_default = pen_option_default( 'color_header_background_secondary' );
  2334. $header_image = get_header_image();
  2335. $angle = esc_html( pen_option_get( 'color_header_background_angle' ) );
  2336. $angle_default = pen_option_default( 'color_header_background_angle' );
  2337. if ( 'to right' === $angle ) {
  2338. $angle_ie = 'left';
  2339. } elseif ( 'to bottom' === $angle ) {
  2340. $angle_ie = 'top';
  2341. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  2342. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  2343. }
  2344. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $header_image || $angle !== $angle_default ) {
  2345. $css .= '#pen_header .pen_header_inner {
  2346. background-color:' . $background_left . ';
  2347. background:' . $background_left . ';';
  2348. if ( $background_left !== $background_right ) {
  2349. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  2350. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  2351. }
  2352. if ( $header_image ) {
  2353. $css .= "background-image:url('" . $header_image . "');
  2354. background-repeat:no-repeat;
  2355. background-position:top center;
  2356. background-size:cover;";
  2357. }
  2358. $css .= '}';
  2359. }
  2360. $text_color = esc_html( pen_option_get( 'color_header_text' ) );
  2361. $text_color_default = pen_option_default( 'color_header_text' );
  2362. if ( ! pen_option_get( 'color_header_text_shadow_display' ) ) {
  2363. $text_shadow = 'none';
  2364. } else {
  2365. $text_shadow = '1px 1px 1px ' . esc_html( pen_option_get( 'color_header_text_shadow' ) );
  2366. }
  2367. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default || '1px 1px 1px ' . pen_option_default( 'color_header_text_shadow' ) !== $text_shadow ) {
  2368. $css .= '#pen_header .pen_header_main {';
  2369. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default ) {
  2370. $css .= 'color:' . $text_color . ';';
  2371. }
  2372. if ( 'preset_1' !== $preset_color || '1px 1px 1px ' . pen_option_default( 'color_header_text_shadow' ) !== $text_shadow ) {
  2373. $css .= 'text-shadow:' . $text_shadow . ';';
  2374. }
  2375. $css .= '}';
  2376. }
  2377. $link_color = esc_html( pen_option_get( 'color_header_link' ) );
  2378. $link_color_default = pen_option_default( 'color_header_link' );
  2379. $link_color_hover = esc_html( pen_option_get( 'color_header_link_hover' ) );
  2380. $link_color_hover_default = pen_option_default( 'color_header_link_hover' );
  2381. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  2382. $css .= '#pen_header .pen_header_main a {
  2383. color:' . $link_color . ';
  2384. }';
  2385. }
  2386. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  2387. $css .= '#pen_header .pen_header_main a:focus,
  2388. #pen_header .pen_header_main a:hover,
  2389. #pen_header .pen_header_main a:active,
  2390. #pen_header .pen_social_networks a:focus,
  2391. #pen_header .pen_social_networks a:hover,
  2392. #pen_header .pen_social_networks a:active {
  2393. color:' . $link_color_hover . ' !important;
  2394. }';
  2395. }
  2396. $sitetitle_color = esc_html( pen_option_get( 'color_header_sitetitle' ) );
  2397. $sitetitle_color_default = pen_option_default( 'color_header_sitetitle' );
  2398. $sitetitle_color_hover = esc_html( pen_option_get( 'color_header_sitetitle_hover' ) );
  2399. $sitetitle_color_hover_default = pen_option_default( 'color_header_sitetitle_hover' );
  2400. $sitetitle_font = esc_html( pen_option_get( 'font_family_sitetitle' ) );
  2401. $sitetitle_size = esc_html( pen_option_get( 'font_size_sitetitle' ) );
  2402. $sitetitle_size_default = pen_option_default( 'font_size_sitetitle' );
  2403. if ( 'preset_1' !== $preset_color || $sitetitle_color !== $sitetitle_color_default || $link_color !== $link_color_default // || because $link_color may affect the sitetitle_color.
  2404. || 'default' !== $sitetitle_font || $sitetitle_size !== $sitetitle_size_default ) {
  2405. $css .= '#pen_header h1 a .site-title {';
  2406. if ( 'preset_1' !== $preset_color || $sitetitle_color !== $sitetitle_color_default || $link_color !== $link_color_default ) {
  2407. $css .= 'color:' . $sitetitle_color . ';';
  2408. }
  2409. if ( 'default' !== $sitetitle_font ) {
  2410. $css .= 'font-family:"' . ltrim( $sitetitle_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2411. font-weight:normal;';
  2412. }
  2413. if ( $sitetitle_size !== $sitetitle_size_default ) {
  2414. $css .= 'font-size:' . $sitetitle_size . ';';
  2415. }
  2416. $css .= '}';
  2417. }
  2418. if ( 'preset_1' !== $preset_color || $sitetitle_color_hover !== $sitetitle_color_hover_default || $link_color_hover !== $link_color_hover_default ) {
  2419. $css .= '#pen_header h1 a:focus .site-title,
  2420. #pen_header h1 a:hover .site-title,
  2421. #pen_header h1 a:active .site-title {
  2422. color:' . $sitetitle_color_hover . ';
  2423. }';
  2424. }
  2425. $sitedescription_color = esc_html( pen_option_get( 'color_header_sitedescription' ) );
  2426. $sitedescription_color_default = pen_option_default( 'color_header_sitedescription' );
  2427. $sitedescription_color_hover = esc_html( pen_option_get( 'color_header_sitedescription_hover' ) );
  2428. $sitedescription_color_hover_default = pen_option_default( 'color_header_sitedescription_hover' );
  2429. $sitedescription_font = esc_html( pen_option_get( 'font_family_sitedescription' ) );
  2430. $sitedescription_size = esc_html( pen_option_get( 'font_size_sitedescription' ) );
  2431. $sitedescription_size_default = pen_option_default( 'font_size_sitedescription' );
  2432. if ( 'preset_1' !== $preset_color || $sitedescription_color !== $sitedescription_color_default || $link_color !== $link_color_default || 'default' !== $sitedescription_font || $sitedescription_size !== $sitedescription_size_default ) {
  2433. $css .= '#pen_header h1 a .site-description {';
  2434. if ( 'preset_1' !== $preset_color || $sitedescription_color !== $sitedescription_color_default || $link_color !== $link_color_default ) {
  2435. $css .= 'color:' . $sitedescription_color . ';';
  2436. }
  2437. if ( 'default' !== $sitedescription_font ) {
  2438. $css .= 'font-family:"' . ltrim( $sitedescription_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2439. font-weight:normal;';
  2440. }
  2441. if ( $sitedescription_size !== $sitedescription_size_default ) {
  2442. $css .= 'font-size:' . $sitedescription_size . ';';
  2443. }
  2444. $css .= '}';
  2445. }
  2446. if ( 'preset_1' !== $preset_color || $sitedescription_color_hover !== $sitedescription_color_hover_default || $link_color_hover !== $link_color_hover_default ) {
  2447. $css .= '#pen_header h1 a:focus .site-description,
  2448. #pen_header h1 a:hover .site-description,
  2449. #pen_header h1 a:active .site-description {
  2450. color:' . $sitedescription_color_hover . ';
  2451. }';
  2452. }
  2453. $social_size = esc_html( pen_option_get( 'font_size_social_header' ) );
  2454. $social_size_default = pen_option_default( 'font_size_social_header' );
  2455. if ( $social_size !== $social_size_default ) {
  2456. $css .= '#pen_header .pen_social_networks li {
  2457. font-size:' . $social_size . '
  2458. }';
  2459. }
  2460. if ( pen_option_get( 'phone' ) && pen_option_get( 'phone_header_display' ) ) {
  2461. $phone_color = esc_html( pen_option_get( 'color_header_phone' ) );
  2462. $phone_color_default = pen_option_default( 'color_header_phone' );
  2463. $phone_color_hover = esc_html( pen_option_get( 'color_header_phone_hover' ) );
  2464. $phone_color_hover_default = pen_option_default( 'color_header_phone_hover' );
  2465. $phone_font = esc_html( pen_option_get( 'font_family_phone_header' ) );
  2466. $phone_size = esc_html( pen_option_get( 'font_size_phone_header' ) );
  2467. $phone_size_default = pen_option_default( 'font_size_phone_header' );
  2468. if ( 'preset_1' !== $preset_color || $phone_color !== $phone_color_default || 'default' !== $phone_font || $phone_size !== $phone_size_default ) {
  2469. $css .= '#pen_header .pen_header_main .pen_phone a {';
  2470. if ( 'preset_1' !== $preset_color || $phone_color !== $phone_color_default ) {
  2471. $css .= 'color:' . $phone_color . ';';
  2472. }
  2473. if ( 'default' !== $phone_font ) {
  2474. $css .= 'font-family:"' . ltrim( $phone_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2475. font-weight:normal;';
  2476. }
  2477. if ( $phone_size !== $phone_size_default ) {
  2478. $css .= 'font-size:' . $phone_size . ';';
  2479. }
  2480. $css .= '}';
  2481. }
  2482. if ( 'preset_1' !== $preset_color || $phone_color_hover !== $phone_color_hover_default ) {
  2483. $css .= '#pen_header .pen_header_main .pen_phone a:focus,
  2484. #pen_header .pen_header_main .pen_phone a:hover,
  2485. #pen_header .pen_header_main .pen_phone a:active {
  2486. color:' . $phone_color_hover . ' !important;
  2487. }';
  2488. }
  2489. }
  2490. $field_background_primary = esc_html( pen_option_get( 'color_header_field_background_primary' ) );
  2491. $field_background_primary_default = pen_option_default( 'color_header_field_background_primary' );
  2492. $field_background_secondary = esc_html( pen_option_get( 'color_header_field_background_secondary' ) );
  2493. $field_background_secondary_default = pen_option_default( 'color_header_field_background_secondary' );
  2494. $field_text = esc_html( pen_option_get( 'color_header_field_text' ) );
  2495. $field_text_default = pen_option_default( 'color_header_field_text' );
  2496. if ( 'preset_1' !== $preset_color || $field_background_primary !== $field_background_primary_default || $field_background_secondary !== $field_background_secondary_default || $field_text !== $field_text_default ) {
  2497. $css .= '#pen_header .pen_header_main input[type="date"],
  2498. #pen_header .pen_header_main input[type="email"],
  2499. #pen_header .pen_header_main input[type="file"],
  2500. #pen_header .pen_header_main input[type="number"],
  2501. #pen_header .pen_header_main input[type="tel"],
  2502. #pen_header .pen_header_main input[type="time"],
  2503. #pen_header .pen_header_main input[type="text"],
  2504. #pen_header .pen_header_main input[type="url"],
  2505. #pen_header .pen_header_main option,
  2506. #pen_header .pen_header_main select,
  2507. #pen_header .pen_header_main textarea,
  2508. #pen_header .pen_header_main .search-form .search-field {
  2509. background:' . $field_background_secondary . ';';
  2510. if ( $field_background_primary !== $field_background_secondary ) {
  2511. $css .= 'background:-ms-linear-gradient(top,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);
  2512. background:linear-gradient(to bottom,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);';
  2513. }
  2514. if ( 'preset_1' !== $preset_color || $field_text !== $field_text_default ) {
  2515. $css .= 'color:' . $field_text . ';';
  2516. }
  2517. $css .= '}';
  2518. }
  2519. $search_background_top = esc_html( pen_option_get( 'color_header_search_background_primary' ) );
  2520. $search_background_top_default = pen_option_default( 'color_header_search_background_primary' );
  2521. $search_background_bottom = esc_html( pen_option_get( 'color_header_search_background_secondary' ) );
  2522. $search_background_bottom_default = pen_option_default( 'color_header_search_background_secondary' );
  2523. $search_text = esc_html( pen_option_get( 'color_header_search_text' ) );
  2524. $search_text_default = pen_option_default( 'color_header_search_text' );
  2525. $background_dark = false;
  2526. $search_text_check = new \Pen\Color( $search_text );
  2527. if ( $search_text_check->isDark() ) {
  2528. $background_dark = true;
  2529. }
  2530. if ( 'preset_1' !== $preset_color || $search_background_top !== $search_background_top_default || $search_background_bottom !== $search_background_bottom_default || $search_text !== $search_text_default || $background_dark ) {
  2531. $css .= '#pen_header .pen_header_main .search-form .search-submit {
  2532. background-color:' . $search_background_bottom . ';
  2533. background:' . $search_background_bottom . ';';
  2534. if ( $search_background_top !== $search_background_bottom ) {
  2535. $css .= 'background:-ms-linear-gradient(top,' . $search_background_top . ' 0%,' . $search_background_bottom . ' 100%);
  2536. background:linear-gradient(to bottom,' . $search_background_top . ' 0%,' . $search_background_bottom . ' 100%);';
  2537. }
  2538. if ( 'preset_1' !== $preset_color || $search_text !== $search_text_default ) {
  2539. $css .= 'color:' . $search_text . ';';
  2540. }
  2541. $css .= '}';
  2542. if ( $background_dark ) {
  2543. $css .= 'body.pen_drop_shadow #pen_header .pen_header_main .search-form .search-submit {
  2544. text-shadow:1px 1px 2px rgba(255,255,255,0.5);
  2545. }';
  2546. }
  2547. $css .= 'body.pen_drop_shadow #pen_header .pen_header_main input[type="date"]:focus,
  2548. body.pen_drop_shadow #pen_header .pen_header_main input[type="date"]:active,
  2549. body.pen_drop_shadow #pen_header .pen_header_main input[type="email"]:focus,
  2550. body.pen_drop_shadow #pen_header .pen_header_main input[type="email"]:active,
  2551. body.pen_drop_shadow #pen_header .pen_header_main input[type="file"]:focus,
  2552. body.pen_drop_shadow #pen_header .pen_header_main input[type="file"]:active,
  2553. body.pen_drop_shadow #pen_header .pen_header_main input[type="number"]:focus,
  2554. body.pen_drop_shadow #pen_header .pen_header_main input[type="number"]:active,
  2555. body.pen_drop_shadow #pen_header .pen_header_main input[type="tel"]:focus,
  2556. body.pen_drop_shadow #pen_header .pen_header_main input[type="tel"]:active,
  2557. body.pen_drop_shadow #pen_header .pen_header_main input[type="time"]:focus,
  2558. body.pen_drop_shadow #pen_header .pen_header_main input[type="time"]:active,
  2559. body.pen_drop_shadow #pen_header .pen_header_main input[type="text"]:focus,
  2560. body.pen_drop_shadow #pen_header .pen_header_main input[type="text"]:active,
  2561. body.pen_drop_shadow #pen_header .pen_header_main input[type="url"]:focus,
  2562. body.pen_drop_shadow #pen_header .pen_header_main input[type="url"]:active,
  2563. body.pen_drop_shadow #pen_header .pen_header_main option:focus,
  2564. body.pen_drop_shadow #pen_header .pen_header_main option:active,
  2565. body.pen_drop_shadow #pen_header .pen_header_main select:focus,
  2566. body.pen_drop_shadow #pen_header .pen_header_main select:active,
  2567. body.pen_drop_shadow #pen_header .pen_header_main textarea:focus,
  2568. body.pen_drop_shadow #pen_header .pen_header_main textarea:active,
  2569. body.pen_drop_shadow #pen_header .pen_header_main .search-form .search-field:focus,
  2570. body.pen_drop_shadow #pen_header .pen_header_main .search-form .search-field:active {
  2571. box-shadow:2px 2px 2px rgba(0,0,0,0.2) inset, 0 0 7px ' . $search_background_bottom . ';
  2572. }
  2573. #pen_header .pen_header_main .search-form .search-submit:focus,
  2574. #pen_header .pen_header_main .search-form .search-submit:active {
  2575. background:' . $search_background_bottom . ';
  2576. }';
  2577. }
  2578. $css = pen_compress_css( $css );
  2579. wp_add_inline_style( 'pen-css', $css );
  2580. }
  2581. add_action( 'wp_enqueue_scripts', 'pen_inline_css_header' );
  2582. }
  2583. if ( ! function_exists( 'pen_inline_css_navigation' ) ) {
  2584. /**
  2585. * Adds inline CSS for the main navigation menu.
  2586. *
  2587. * @since Pen 1.0.0
  2588. * @return void
  2589. */
  2590. function pen_inline_css_navigation() {
  2591. $css = '';
  2592. if ( pen_option_get( 'navigation_display' ) ) {
  2593. $preset_color = esc_html( pen_preset_get( 'color' ) );
  2594. $background_left = esc_html( pen_option_get( 'color_navigation_background_primary' ) );
  2595. $background_left_default = pen_option_default( 'color_navigation_background_primary' );
  2596. $background_right = esc_html( pen_option_get( 'color_navigation_background_secondary' ) );
  2597. $background_right_default = pen_option_default( 'color_navigation_background_secondary' );
  2598. $background_image = esc_html( pen_option_get( 'background_image_navigation' ) );
  2599. $angle = esc_html( pen_option_get( 'color_navigation_background_angle' ) );
  2600. $angle_default = pen_option_default( 'color_navigation_background_angle' );
  2601. if ( 'to right' === $angle ) {
  2602. $angle_ie = 'left';
  2603. } elseif ( 'to bottom' === $angle ) {
  2604. $angle_ie = 'top';
  2605. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  2606. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  2607. }
  2608. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $background_image || $angle !== $angle_default ) {
  2609. $css .= '#pen_navigation {
  2610. background-color:' . $background_left . ';
  2611. background:' . $background_left . ';';
  2612. if ( $background_left !== $background_right ) {
  2613. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  2614. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  2615. }
  2616. if ( $background_image ) {
  2617. $css .= "background-image:url('" . $background_image . "');
  2618. background-repeat:no-repeat;
  2619. background-position:top center;
  2620. background-size:cover;";
  2621. }
  2622. $css .= '}';
  2623. }
  2624. $background_submenu_left = esc_html( pen_option_get( 'color_navigation_background_submenu_primary' ) );
  2625. $background_submenu_left_default = pen_option_default( 'color_navigation_background_submenu_primary' );
  2626. $background_submenu_right = esc_html( pen_option_get( 'color_navigation_background_submenu_secondary' ) );
  2627. $background_submenu_right_default = pen_option_default( 'color_navigation_background_submenu_secondary' );
  2628. $background_submenu_image = esc_html( pen_option_get( 'background_image_navigation_submenu' ) );
  2629. $angle = esc_html( pen_option_get( 'color_navigation_background_submenu_angle' ) );
  2630. $angle_default = pen_option_default( 'color_navigation_background_submenu_angle' );
  2631. if ( 'to right' === $angle ) {
  2632. $angle_ie = 'left';
  2633. } elseif ( 'to bottom' === $angle ) {
  2634. $angle_ie = 'top';
  2635. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  2636. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  2637. }
  2638. if ( 'preset_1' !== $preset_color || $background_submenu_left !== $background_submenu_left_default || $background_submenu_right !== $background_submenu_right_default || $background_submenu_image || $angle !== $angle_default ) {
  2639. $css .= '#pen_navigation ul ul {
  2640. background-color:' . $background_submenu_left . ';
  2641. background:' . $background_submenu_left . ';';
  2642. if ( $background_submenu_left !== $background_submenu_right ) {
  2643. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_submenu_left . ' 0%,' . $background_submenu_right . ' 100%);
  2644. background:linear-gradient(' . $angle . ',' . $background_submenu_left . ' 0%,' . $background_submenu_right . ' 100%);';
  2645. }
  2646. if ( $background_submenu_image ) {
  2647. $css .= "background-image:url('" . $background_submenu_image . "');
  2648. background-repeat:no-repeat;
  2649. background-position:top center;
  2650. background-size:cover;";
  2651. }
  2652. $css .= '}';
  2653. }
  2654. $link_color = esc_html( pen_option_get( 'color_navigation_link' ) );
  2655. $link_color_default = pen_option_default( 'color_navigation_link' );
  2656. $link_color_hover = esc_html( pen_option_get( 'color_navigation_link_hover' ) );
  2657. $link_color_hover_default = pen_option_default( 'color_navigation_link_hover' );
  2658. $navigation_font = esc_html( pen_option_get( 'font_family_navigation' ) );
  2659. $navigation_size = esc_html( pen_option_get( 'font_size_navigation' ) );
  2660. $navigation_size_default = pen_option_default( 'font_size_navigation' );
  2661. if ( ! pen_option_get( 'color_navigation_text_shadow_display' ) ) {
  2662. $text_shadow = 'none';
  2663. } else {
  2664. $text_shadow = '1px 1px 1px ' . esc_html( pen_option_get( 'color_navigation_text_shadow' ) );
  2665. }
  2666. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default || '1px 1px 1px ' . pen_option_default( 'color_navigation_text_shadow' ) !== $text_shadow || 'default' !== $navigation_font || $navigation_size !== $navigation_size_default ) {
  2667. $css .= '#pen_navigation a {';
  2668. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  2669. $css .= 'color:' . $link_color . ';';
  2670. }
  2671. if ( 'default' !== $navigation_font ) {
  2672. $css .= 'font-family:"' . ltrim( $navigation_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2673. font-weight:normal;';
  2674. }
  2675. if ( $navigation_size !== $navigation_size_default ) {
  2676. $css .= 'font-size:' . $navigation_size . ';';
  2677. }
  2678. if ( 'preset_1' !== $preset_color || '1px 1px 1px ' . pen_option_default( 'color_navigation_text_shadow' ) !== $text_shadow ) {
  2679. $css .= 'text-shadow:' . $text_shadow . ';';
  2680. }
  2681. $css .= '}';
  2682. $separator = esc_html( pen_option_get( 'navigation_separator' ) );
  2683. if ( 'preset_1' !== $preset_color && $separator ) {
  2684. if ( in_array( $separator, array( 1, 2, 3 ), true ) ) {
  2685. $css .= '#pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:after,
  2686. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:after {
  2687. background:-ms-linear-gradient(270deg, rgba(0,0,0,0) 0%, ' . $link_color . ' 50%, rgba(0,0,0,0) 100%);
  2688. background:linear-gradient(180deg, rgba(0,0,0,0) 0%, ' . $link_color . ' 50%, rgba(0,0,0,0) 100%);
  2689. }';
  2690. } elseif ( in_array( $separator, array( 4, 5, 7 ), true ) ) {
  2691. $css .= '#pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:after,
  2692. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:after {
  2693. background:' . $link_color . ';
  2694. }';
  2695. } elseif ( 6 === $separator ) {
  2696. $css .= '#pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:before,
  2697. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:before,
  2698. #pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:after,
  2699. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:after {
  2700. background:' . $link_color . ';
  2701. }';
  2702. } elseif ( in_array( $separator, array( 8, 9 ), true ) ) {
  2703. $css .= '#pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:after,
  2704. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:after {
  2705. border-color:' . $link_color . ';
  2706. }';
  2707. } elseif ( 10 === $separator ) {
  2708. $css .= '#pen_navigation.pen_separator_' . $separator . ' div#primary-menu > ul > li:after,
  2709. #pen_navigation.pen_separator_' . $separator . ' ul#primary-menu > li:after {
  2710. color:' . $link_color . ';
  2711. }';
  2712. }
  2713. }
  2714. $hover = esc_html( pen_option_get( 'navigation_hover' ) );
  2715. if ( 'preset_1' !== $preset_color && $hover ) {
  2716. if ( 1 === $hover || 2 === $hover ) {
  2717. $link_color_check = new \Pen\Color( $link_color );
  2718. if ( $link_color_check->isDark() ) {
  2719. $css .= '#pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li.sfHover > a,
  2720. #pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:focus,
  2721. #pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:hover,
  2722. #pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:active,
  2723. #pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li.current-menu-item > a,
  2724. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li.sfHover > a,
  2725. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:focus,
  2726. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:hover,
  2727. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:active,
  2728. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li.current-menu-item > a {';
  2729. if ( 'preset_15' === $preset_color ) {
  2730. $css .= 'background:rgba(255,255,255,0.5);';
  2731. } else {
  2732. $css .= 'background:rgba(255,255,255,0.3);';
  2733. }
  2734. $css .= '}';
  2735. }
  2736. } elseif ( in_array( $hover, array( 3, 4, 5, 6, 7, 10 ), true ) ) {
  2737. $css .= '#pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:after,
  2738. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:after {
  2739. background:' . $link_color . ';
  2740. }';
  2741. } elseif ( 8 === $hover ) {
  2742. $css .= '#pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:after,
  2743. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:after {
  2744. border-top-color:' . $link_color . ';
  2745. }';
  2746. } elseif ( 9 === $hover ) {
  2747. $css .= '#pen_navigation.pen_hover_' . $hover . ' div#primary-menu > ul > li > a:after,
  2748. #pen_navigation.pen_hover_' . $hover . ' ul#primary-menu > li > a:after {
  2749. border-bottom-color:' . $link_color . ';
  2750. }';
  2751. }
  2752. }
  2753. }
  2754. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  2755. $css .= '#pen_navigation li.sfHover > a,
  2756. #pen_navigation a:focus,
  2757. #pen_navigation a:hover,
  2758. #pen_navigation a:active {
  2759. color:' . $link_color_hover . ';
  2760. }';
  2761. }
  2762. $link_color_submenu = esc_html( pen_option_get( 'color_navigation_link_submenu' ) );
  2763. $link_color_submenu_default = pen_option_default( 'color_navigation_link_submenu' );
  2764. $link_color_hover_submenu = esc_html( pen_option_get( 'color_navigation_link_hover_submenu' ) );
  2765. $link_color_hover_submenu_default = pen_option_default( 'color_navigation_link_hover_submenu' );
  2766. $navigation_submenu_font = esc_html( pen_option_get( 'font_family_navigation_submenu' ) );
  2767. if ( ! pen_option_get( 'color_navigation_text_shadow_display_submenu' ) ) {
  2768. $text_shadow_submenu = 'none';
  2769. } else {
  2770. $text_shadow_submenu = '1px 1px 1px ' . esc_html( pen_option_get( 'color_navigation_text_shadow_submenu' ) );
  2771. }
  2772. if ( 'preset_1' !== $preset_color || $link_color_submenu !== $link_color_submenu_default || '1px 1px 1px ' . pen_option_default( 'color_navigation_text_shadow_submenu' ) !== $text_shadow_submenu || 'default' !== $navigation_submenu_font || $navigation_size !== $navigation_size_default ) {
  2773. $css .= '#pen_navigation li li a {';
  2774. if ( 'preset_1' !== $preset_color || $link_color_submenu !== $link_color_submenu_default ) {
  2775. $css .= 'color:' . $link_color_submenu . ';';
  2776. }
  2777. if ( 'default' !== $navigation_submenu_font ) {
  2778. $css .= 'font-family:"' . ltrim( $navigation_submenu_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  2779. font-weight:normal;';
  2780. }
  2781. if ( $navigation_size !== $navigation_size_default ) {
  2782. $css .= 'font-size:' . $navigation_size . ';';
  2783. }
  2784. if ( 'preset_1' !== $preset_color || '1px 1px 1px ' . pen_option_default( 'color_navigation_text_shadow_submenu' ) !== $text_shadow_submenu ) {
  2785. $css .= 'text-shadow:' . $text_shadow_submenu . ';';
  2786. }
  2787. $css .= '}';
  2788. $separator = esc_html( pen_option_get( 'navigation_separator_submenu' ) );
  2789. if ( 'preset_1' !== $preset_color && $separator ) {
  2790. if ( 1 === $separator ) {
  2791. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2792. background:-ms-linear-gradient(180deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 25%,rgba(0,0,0,0) 100%);
  2793. background:linear-gradient(90deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 25%,rgba(0,0,0,0) 100%);
  2794. }';
  2795. } elseif ( 2 === $separator ) {
  2796. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2797. background:-ms-linear-gradient(180deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 50%,rgba(0,0,0,0) 100%);
  2798. background:linear-gradient(90deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 50%,rgba(0,0,0,0) 100%);
  2799. }';
  2800. } elseif ( 3 === $separator ) {
  2801. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2802. background:-ms-linear-gradient(180deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 75%,rgba(0,0,0,0) 100%);
  2803. background:linear-gradient(90deg,rgba(0,0,0,0) 0%, ' . $link_color_submenu . ' 75%,rgba(0,0,0,0) 100%);
  2804. }';
  2805. } elseif ( in_array( $separator, array( 4, 5, 7 ), true ) ) {
  2806. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2807. background:' . $link_color_submenu . ';
  2808. }';
  2809. } elseif ( 6 === $separator ) {
  2810. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:before,
  2811. #pen_navigation.pen_separator_' . $separator . ' li li:after {
  2812. background:' . $link_color_submenu . ';
  2813. }';
  2814. } elseif ( in_array( $separator, array( 8, 9 ), true ) ) {
  2815. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2816. border-color:' . $link_color . ';
  2817. }';
  2818. } elseif ( 10 === $separator ) {
  2819. $css .= '#pen_navigation.pen_separator_submenu_' . $separator . ' li li:after {
  2820. color:' . $link_color . ';
  2821. }';
  2822. }
  2823. }
  2824. }
  2825. if ( 'preset_1' !== $preset_color || $link_color_hover_submenu !== $link_color_hover_submenu_default ) {
  2826. $css .= '#pen_navigation li li.sfHover > a,
  2827. #pen_navigation li li a:focus,
  2828. #pen_navigation li li a:hover,
  2829. #pen_navigation li li a:active {
  2830. color:' . $link_color_hover_submenu . ';
  2831. }';
  2832. }
  2833. $css = pen_compress_css( $css );
  2834. }
  2835. wp_add_inline_style( 'pen-css', $css );
  2836. }
  2837. add_action( 'wp_enqueue_scripts', 'pen_inline_css_navigation' );
  2838. }
  2839. if ( ! function_exists( 'pen_inline_css_search' ) ) {
  2840. /**
  2841. * Adds inline CSS for the search bar.
  2842. *
  2843. * @since Pen 1.0.0
  2844. * @return void
  2845. */
  2846. function pen_inline_css_search() {
  2847. $css = '';
  2848. $search_location = get_post_meta( get_the_ID(), 'pen_content_search_location_override', true );
  2849. if ( ! $search_location || 'default' === $search_location ) {
  2850. $search_location = esc_html( pen_option_get( 'search_location' ) );
  2851. }
  2852. $search = pen_html_search_box();
  2853. if ( $search && 'content' === $search_location ) {
  2854. $preset_color = esc_html( pen_preset_get( 'color' ) );
  2855. $field_background_primary = esc_html( pen_option_get( 'color_search_field_background_primary' ) );
  2856. $field_background_primary_default = pen_option_default( 'color_search_field_background_primary' );
  2857. $field_background_secondary = esc_html( pen_option_get( 'color_search_field_background_secondary' ) );
  2858. $field_background_secondary_default = pen_option_default( 'color_search_field_background_secondary' );
  2859. $field_text = esc_html( pen_option_get( 'color_search_field_text' ) );
  2860. $field_text_default = pen_option_default( 'color_search_field_text' );
  2861. if ( 'preset_1' !== $preset_color || $field_background_primary !== $field_background_primary_default || $field_background_secondary !== $field_background_secondary_default || $field_text !== $field_text_default ) {
  2862. $css .= '#pen_search .search-form .search-field {
  2863. background:' . $field_background_secondary . ';';
  2864. if ( $field_background_primary !== $field_background_secondary ) {
  2865. $css .= 'background:-ms-linear-gradient(top,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);
  2866. background:linear-gradient(to bottom,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);';
  2867. }
  2868. if ( 'preset_1' !== $preset_color || $field_text !== $field_text_default ) {
  2869. $css .= 'color:' . $field_text . ';';
  2870. }
  2871. $css .= '}';
  2872. }
  2873. $background_left = esc_html( pen_option_get( 'color_search_background_primary' ) );
  2874. $background_left_default = pen_option_default( 'color_search_background_primary' );
  2875. $background_right = esc_html( pen_option_get( 'color_search_background_secondary' ) );
  2876. $background_right_default = pen_option_default( 'color_search_background_secondary' );
  2877. $background_image = esc_html( pen_option_get( 'background_image_search' ) );
  2878. $angle = esc_html( pen_option_get( 'color_search_background_angle' ) );
  2879. $angle_default = pen_option_default( 'color_search_background_angle' );
  2880. if ( 'to right' === $angle ) {
  2881. $angle_ie = 'left';
  2882. } elseif ( 'to bottom' === $angle ) {
  2883. $angle_ie = 'top';
  2884. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  2885. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  2886. }
  2887. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $background_image || $angle !== $angle_default ) {
  2888. $css .= '#pen_search {
  2889. background-color:' . $background_left . ';
  2890. background:' . $background_left . ';';
  2891. if ( $background_left !== $background_right ) {
  2892. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  2893. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  2894. }
  2895. if ( $background_image ) {
  2896. $css .= "background-image:url('" . $background_image . "');
  2897. background-repeat:no-repeat;
  2898. background-position:top center;
  2899. background-size:cover;";
  2900. }
  2901. $css .= '}';
  2902. }
  2903. $text_color = esc_html( pen_option_get( 'color_search_text' ) );
  2904. $text_color_default = pen_option_default( 'color_search_text' );
  2905. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default ) {
  2906. $css .= '#pen_search .widget {
  2907. color:' . $text_color . ';
  2908. }';
  2909. }
  2910. if ( ! pen_option_get( 'color_search_text_shadow_display' ) ) {
  2911. $text_shadow = 'none';
  2912. } else {
  2913. $text_shadow = '1px 1px 1px ' . esc_html( pen_option_get( 'color_search_text_shadow' ) );
  2914. }
  2915. if ( 'preset_1' !== $preset_color || '1px 1px 1px ' . pen_option_default( 'color_search_text_shadow' ) !== $text_shadow ) {
  2916. $css .= 'body.pen_drop_shadow #pen_search .widget {
  2917. text-shadow:' . $text_shadow . ';
  2918. }';
  2919. }
  2920. $link_color = esc_html( pen_option_get( 'color_search_link' ) );
  2921. $link_color_default = pen_option_default( 'color_search_link' );
  2922. $link_color_hover = esc_html( pen_option_get( 'color_search_link_hover' ) );
  2923. $link_color_hover_default = pen_option_default( 'color_search_link_hover' );
  2924. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  2925. $css .= '#pen_search .widget a {
  2926. color:' . $link_color . ';
  2927. }';
  2928. }
  2929. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  2930. $css .= '#pen_search .widget a:focus,
  2931. #pen_search .widget a:hover,
  2932. #pen_search .widget a:active {
  2933. color:' . $link_color_hover . ' !important;
  2934. }';
  2935. }
  2936. $search_background_top = esc_html( pen_option_get( 'color_search_button_background_primary' ) );
  2937. $search_background_top_default = pen_option_default( 'color_search_button_background_primary' );
  2938. $search_background_bottom = esc_html( pen_option_get( 'color_search_button_background_secondary' ) );
  2939. $search_background_bottom_default = pen_option_default( 'color_search_button_background_secondary' );
  2940. $search_text = esc_html( pen_option_get( 'color_search_button_text' ) );
  2941. $search_text_default = pen_option_default( 'color_search_button_text' );
  2942. $background_dark = false;
  2943. $search_text_check = new \Pen\Color( $search_text );
  2944. if ( $search_text_check->isDark() ) {
  2945. $background_dark = true;
  2946. }
  2947. if ( 'preset_1' !== $preset_color || $search_background_top !== $search_background_top_default || $search_background_bottom !== $search_background_bottom_default || $search_text !== $search_text_default || $background_dark ) {
  2948. $css .= '#pen_search .search-form .search-submit {
  2949. background:' . $search_background_bottom . ';';
  2950. if ( $search_background_top !== $search_background_bottom ) {
  2951. $css .= 'background:-ms-linear-gradient(top,' . $search_background_top . ' 0%,' . $search_background_bottom . ' 100%);
  2952. background:linear-gradient(to bottom,' . $search_background_top . ' 0%,' . $search_background_bottom . ' 100%);';
  2953. }
  2954. if ( 'preset_1' !== $preset_color || $search_text !== $search_text_default ) {
  2955. $css .= 'color:' . $search_text . ';';
  2956. }
  2957. $css .= '}
  2958. #pen_search .search-form .search-submit:active {
  2959. background:' . $search_background_bottom . ';
  2960. }';
  2961. if ( $background_dark ) {
  2962. $css .= 'body.pen_drop_shadow #pen_search .search-form .search-submit {
  2963. text-shadow:1px 1px 2px rgba(255,255,255,0.5);
  2964. }';
  2965. }
  2966. }
  2967. $css = pen_compress_css( $css );
  2968. }
  2969. wp_add_inline_style( 'pen-css', $css );
  2970. }
  2971. add_action( 'wp_enqueue_scripts', 'pen_inline_css_search' );
  2972. }
  2973. if ( ! function_exists( 'pen_inline_css_content' ) ) {
  2974. /**
  2975. * Adds inline CSS for the content area.
  2976. *
  2977. * @since Pen 1.0.0
  2978. * @return void
  2979. */
  2980. function pen_inline_css_content() {
  2981. $css = '';
  2982. $preset_color = esc_html( pen_preset_get( 'color' ) );
  2983. $background_left = esc_html( pen_option_get( 'color_content_title_background_primary' ) );
  2984. $background_left_default = pen_option_default( 'color_content_title_background_primary' );
  2985. $background_right = esc_html( pen_option_get( 'color_content_title_background_secondary' ) );
  2986. $background_right_default = pen_option_default( 'color_content_title_background_secondary' );
  2987. $background_image = esc_html( pen_option_get( 'background_image_content_title' ) );
  2988. $angle = esc_html( pen_option_get( 'color_content_title_background_angle' ) );
  2989. $angle_default = pen_option_default( 'color_content_title_background_angle' );
  2990. if ( 'to right' === $angle ) {
  2991. $angle_ie = 'left';
  2992. } elseif ( 'to bottom' === $angle ) {
  2993. $angle_ie = 'top';
  2994. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  2995. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  2996. }
  2997. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $angle !== $angle_default || $background_image ) {
  2998. $css .= '#main article header {
  2999. background-color:' . $background_left . ';
  3000. background:' . $background_left . ';';
  3001. if ( $background_left !== $background_right ) {
  3002. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  3003. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  3004. }
  3005. if ( $background_image ) {
  3006. $css .= "background-image:url('" . $background_image . "');
  3007. background-repeat:no-repeat;
  3008. background-position:top center;
  3009. background-size:cover;";
  3010. }
  3011. $css .= '}';
  3012. }
  3013. $text_color = esc_html( pen_option_get( 'color_content_text' ) );
  3014. $text_color_default = pen_option_default( 'color_content_text' );
  3015. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default ) {
  3016. $css .= '#main .page-content,
  3017. #main .entry-content,
  3018. #main .entry-summary,
  3019. #main .entry-footer,
  3020. #main label,
  3021. #comments,
  3022. #comments h3 {
  3023. color:' . $text_color . ';
  3024. }';
  3025. $view = is_singular() ? 'content' : 'list';
  3026. $profile_display = get_post_meta( get_the_ID(), 'pen_' . $view . '_profile_display_override', true );
  3027. if ( ! $profile_display || 'default' === $profile_display ) {
  3028. $profile_display = esc_html( pen_option_get( $view . '_profile_display' ) );
  3029. }
  3030. if ( $profile_display ) {
  3031. $css .= '#primary .pen_author_profile:before {
  3032. background: -ms-linear-gradient(180deg, rgba(255,255,255,0) 0%,' . $text_color . ' 50%, rgba(255,255,255,0) 100%);
  3033. background: linear-gradient(90deg, rgba(255,255,255,0) 0%,' . $text_color . ' 50%, rgba(255,255,255,0) 100%);
  3034. }';
  3035. }
  3036. }
  3037. $background_color = esc_html( pen_option_get( 'color_content_background_primary' ) );
  3038. $background_color_default = pen_option_default( 'color_content_background_primary' );
  3039. if ( 'preset_1' !== $preset_color || $background_color !== $background_color_default ) {
  3040. $css .= '#main .page-content,
  3041. #main .pen_article_wrapper > article,
  3042. body.pen_list_masonry #pen_masonry article,
  3043. #primary .pen_author_profile .pen_author_avatar,
  3044. #comments,
  3045. #comments ol.comment-list li.comment div.comment-author .photo,
  3046. body.pen_list_plain #pen_pager {
  3047. background-color:' . $background_color . ';
  3048. background:' . $background_color . ';
  3049. }';
  3050. }
  3051. $link_color = esc_html( pen_option_get( 'color_content_link' ) );
  3052. $link_color_default = pen_option_default( 'color_content_link' );
  3053. $link_color_hover = esc_html( pen_option_get( 'color_content_link_hover' ) );
  3054. $link_color_hover_default = pen_option_default( 'color_content_link_hover' );
  3055. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  3056. $css .= '#primary a {
  3057. color:' . $link_color . ';
  3058. }';
  3059. }
  3060. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  3061. $css .= '#primary a:focus,
  3062. #primary a:hover,
  3063. #primary a:active {
  3064. color:' . $link_color_hover . ';
  3065. }';
  3066. }
  3067. if ( ! pen_option_get( 'color_content_title_text_shadow_display' ) ) {
  3068. $text_shadow = 'none';
  3069. } else {
  3070. $text_shadow = '1px 1px 1px ' . esc_html( pen_option_get( 'color_content_title_text_shadow' ) );
  3071. }
  3072. if ( is_singular() ) {
  3073. $title_font = esc_html( pen_option_get( 'font_family_title_content' ) );
  3074. $title_size = esc_html( pen_option_get( 'font_size_title_content' ) );
  3075. $title_size_default = pen_option_default( 'font_size_title_content' );
  3076. } else {
  3077. $title_font = esc_html( pen_option_get( 'font_family_title_list' ) );
  3078. $title_size = esc_html( pen_option_get( 'font_size_title_list' ) );
  3079. $title_size_default = pen_option_default( 'font_size_title_list' );
  3080. }
  3081. if ( 'preset_1' !== $preset_color || $title_size !== $title_size_default || '1px 1px 1px ' . pen_option_default( 'color_content_title_text_shadow' ) !== $text_shadow || 'default' !== $title_font ) {
  3082. $css .= '#main header .entry-title,
  3083. #main header .page-title {';
  3084. if ( 'default' !== $title_font ) {
  3085. $css .= 'font-family:"' . ltrim( $title_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  3086. font-weight:normal;';
  3087. }
  3088. if ( $title_size !== $title_size_default ) {
  3089. $css .= 'font-size:' . $title_size . ' !important;';
  3090. }
  3091. if ( 'preset_1' !== $preset_color || '1px 1px 1px ' . pen_option_default( 'color_content_title_text_shadow' ) !== $text_shadow ) {
  3092. $css .= 'text-shadow:' . $text_shadow . ';';
  3093. }
  3094. $css .= '}';
  3095. }
  3096. $title_color = esc_html( pen_option_get( 'color_content_title_text' ) );
  3097. $title_color_default = pen_option_default( 'color_content_title_text' );
  3098. if ( 'preset_1' !== $preset_color || $title_color !== $title_color_default ) {
  3099. $css .= '#main article header {
  3100. color:' . $title_color . ';
  3101. }
  3102. #main article .entry-meta > span:after {
  3103. background: -ms-linear-gradient(270deg, rgba(0,0,0,0) 0%,' . $title_color . ' 50%, rgba(0,0,0,0) 100%);
  3104. background: linear-gradient(180deg, rgba(0,0,0,0) 0%,' . $title_color . ' 50%, rgba(0,0,0,0) 100%);
  3105. }';
  3106. }
  3107. $link_color = esc_html( pen_option_get( 'color_content_title_link' ) );
  3108. $link_color_default = pen_option_default( 'color_content_title_link' );
  3109. $link_color_hover = esc_html( pen_option_get( 'color_content_title_link_hover' ) );
  3110. $link_color_hover_default = pen_option_default( 'color_content_title_link_hover' );
  3111. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  3112. $css .= '#main article header a {
  3113. color:' . $link_color . ';
  3114. }';
  3115. }
  3116. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  3117. $css .= '#main article header a:focus,
  3118. #main article header a:hover,
  3119. #main article header a:active {
  3120. color:' . $link_color_hover . ';
  3121. }';
  3122. }
  3123. $field_background_primary = esc_html( pen_option_get( 'color_content_field_background_primary' ) );
  3124. $field_background_primary_default = pen_option_default( 'color_content_field_background_primary' );
  3125. $field_background_secondary = esc_html( pen_option_get( 'color_content_field_background_secondary' ) );
  3126. $field_background_secondary_default = pen_option_default( 'color_content_field_background_secondary' );
  3127. $field_text = esc_html( pen_option_get( 'color_content_field_text' ) );
  3128. $field_text_default = pen_option_default( 'color_content_field_text' );
  3129. if ( 'preset_1' !== $preset_color || $field_background_primary !== $field_background_primary_default || $field_background_secondary !== $field_background_secondary_default || $field_text !== $field_text_default ) {
  3130. $css .= '#main input[type="date"],
  3131. #main input[type="email"],
  3132. #main input[type="file"],
  3133. #main input[type="number"],
  3134. #main input[type="tel"],
  3135. #main input[type="time"],
  3136. #main input[type="text"],
  3137. #main input[type="url"],
  3138. #main option,
  3139. #main select,
  3140. #main textarea {
  3141. background:' . $field_background_secondary . ';';
  3142. if ( $field_background_primary !== $field_background_secondary ) {
  3143. $css .= 'background:-ms-linear-gradient(top,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);
  3144. background:linear-gradient(to bottom,' . $field_background_primary . ' 0%,' . $field_background_secondary . ' 100%);';
  3145. }
  3146. if ( 'preset_1' !== $preset_color || $field_text !== $field_text_default ) {
  3147. $css .= 'color:' . $field_text . ';';
  3148. }
  3149. $css .= '}';
  3150. }
  3151. $css = pen_compress_css( $css );
  3152. wp_add_inline_style( 'pen-css', $css );
  3153. }
  3154. add_action( 'wp_enqueue_scripts', 'pen_inline_css_content' );
  3155. }
  3156. if ( ! function_exists( 'pen_inline_css_list' ) ) {
  3157. /**
  3158. * Adds inline CSS for lists.
  3159. *
  3160. * @since Pen 1.0.0
  3161. * @return void
  3162. */
  3163. function pen_inline_css_list() {
  3164. $css = '';
  3165. $preset_color = esc_html( pen_preset_get( 'color' ) );
  3166. if ( 'masonry' === pen_list_type() ) {
  3167. $list_masonry_thumbnail_style = esc_html( pen_option_get( 'list_masonry_thumbnail_style' ) );
  3168. $color_list_thumbnail_background_primary = esc_html( pen_option_get( 'color_list_thumbnail_background_primary' ) );
  3169. $color_list_thumbnail_background_primary_default = pen_option_default( 'color_list_thumbnail_background_primary' );
  3170. $color_list_thumbnail_background_secondary = esc_html( pen_option_get( 'color_list_thumbnail_background_secondary' ) );
  3171. $color_list_thumbnail_background_secondary_default = pen_option_default( 'color_list_thumbnail_background_secondary' );
  3172. if ( 'preset_1' !== $preset_color || $color_list_thumbnail_background_primary !== $color_list_thumbnail_background_primary_default || $color_list_thumbnail_background_secondary !== $color_list_thumbnail_background_secondary_default ) {
  3173. $css .= 'body.pen_list_masonry #pen_masonry article.pen_thumbnail_style_' . $list_masonry_thumbnail_style . ' .post-thumbnail {
  3174. background: -ms-linear-gradient(180deg, ' . $color_list_thumbnail_background_primary . ' 0%, ' . $color_list_thumbnail_background_secondary . ' 50%, ' . $color_list_thumbnail_background_primary . ' 100%);
  3175. background: linear-gradient(90deg, ' . $color_list_thumbnail_background_primary . ' 0%, ' . $color_list_thumbnail_background_secondary . ' 50%, ' . $color_list_thumbnail_background_primary . ' 100%);
  3176. }';
  3177. }
  3178. }
  3179. $css = pen_compress_css( $css );
  3180. wp_add_inline_style( 'pen-css', $css );
  3181. }
  3182. add_action( 'wp_enqueue_scripts', 'pen_inline_css_list' );
  3183. }
  3184. if ( ! function_exists( 'pen_inline_css_bottom' ) ) {
  3185. /**
  3186. * Adds inline CSS for the bottom area.
  3187. *
  3188. * @since Pen 1.0.0
  3189. * @return void
  3190. */
  3191. function pen_inline_css_bottom() {
  3192. $css = '';
  3193. if ( pen_sidebar_check( 'sidebar-bottom' ) ) {
  3194. $preset_color = esc_html( pen_preset_get( 'color' ) );
  3195. $background_left = esc_html( pen_option_get( 'color_bottom_background_primary' ) );
  3196. $background_left_default = pen_option_default( 'color_bottom_background_primary' );
  3197. $background_right = esc_html( pen_option_get( 'color_bottom_background_secondary' ) );
  3198. $background_right_default = pen_option_default( 'color_bottom_background_secondary' );
  3199. $background_image = esc_html( pen_option_get( 'background_image_bottom' ) );
  3200. $angle = esc_html( pen_option_get( 'color_bottom_background_angle' ) );
  3201. $angle_default = pen_option_default( 'color_bottom_background_angle' );
  3202. if ( 'to right' === $angle ) {
  3203. $angle_ie = 'left';
  3204. } elseif ( 'to bottom' === $angle ) {
  3205. $angle_ie = 'top';
  3206. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  3207. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  3208. }
  3209. $text_color = esc_html( pen_option_get( 'color_bottom_text' ) );
  3210. $text_color_default = pen_option_default( 'color_bottom_text' );
  3211. if ( ! pen_option_get( 'color_bottom_text_shadow_display' ) ) {
  3212. $text_shadow = 'none';
  3213. } else {
  3214. $text_shadow = '1px 1px 2px ' . esc_html( pen_option_get( 'color_bottom_text_shadow' ) );
  3215. }
  3216. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $background_image || '1px 1px 2px ' . pen_option_default( 'color_bottom_text_shadow' ) !== $text_shadow || $angle !== $angle_default ) {
  3217. $css .= '#pen_bottom.pen_not_transparent {
  3218. background-color:' . $background_left . ';
  3219. background:' . $background_left . ';';
  3220. if ( $background_left !== $background_right ) {
  3221. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  3222. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  3223. }
  3224. if ( $background_image ) {
  3225. $css .= "background-image:url('" . $background_image . "');
  3226. background-repeat:no-repeat;
  3227. background-position:top center;
  3228. background-size:cover;";
  3229. }
  3230. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default ) {
  3231. $css .= 'color:' . $text_color . ';';
  3232. }
  3233. if ( 'preset_1' !== $preset_color || '1px 1px 2px ' . pen_option_default( 'color_bottom_text_shadow' ) !== $text_shadow ) {
  3234. $css .= 'text-shadow:' . $text_shadow . ';';
  3235. }
  3236. $css .= '}';
  3237. }
  3238. $headings_color = esc_html( pen_option_get( 'color_bottom_headings' ) );
  3239. $headings_color_default = pen_option_default( 'color_bottom_headings' );
  3240. if ( ! pen_option_get( 'color_bottom_headings_text_shadow_display' ) ) {
  3241. $headings_shadow = 'none';
  3242. } else {
  3243. $headings_shadow = '1px 1px 2px ' . esc_html( pen_option_get( 'color_bottom_headings_text_shadow' ) );
  3244. }
  3245. if ( 'preset_1' !== $preset_color || $headings_color !== $headings_color_default || '1px 1px 2px ' . pen_option_default( 'color_bottom_headings_text_shadow' ) !== $headings_shadow ) {
  3246. $css .= '#pen_bottom .pen_widget_transparent h3,
  3247. #pen_bottom .pen_widget_transparent h4,
  3248. #pen_bottom .pen_widget_transparent h5 {';
  3249. if ( 'preset_1' !== $preset_color || $headings_color !== $headings_color_default ) {
  3250. $css .= 'color:' . $headings_color . ';';
  3251. }
  3252. if ( 'preset_1' !== $preset_color || '1px 1px 2px ' . pen_option_default( 'color_bottom_headings_text_shadow' ) !== $headings_shadow ) {
  3253. $css .= 'text-shadow:' . $headings_shadow . ';';
  3254. }
  3255. $css .= '}';
  3256. }
  3257. $link_color = esc_html( pen_option_get( 'color_bottom_link' ) );
  3258. $link_color_default = pen_option_default( 'color_bottom_link' );
  3259. $link_color_hover = esc_html( pen_option_get( 'color_bottom_link_hover' ) );
  3260. $link_color_hover_default = pen_option_default( 'color_bottom_link_hover' );
  3261. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  3262. $css .= '#pen_bottom a {
  3263. color:' . $link_color . ';
  3264. }';
  3265. }
  3266. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  3267. $css .= '#pen_bottom a:focus,
  3268. #pen_bottom a:hover,
  3269. #pen_bottom a:active {
  3270. color:' . $link_color_hover . ';
  3271. }';
  3272. }
  3273. $css = pen_compress_css( $css );
  3274. }
  3275. wp_add_inline_style( 'pen-css', $css );
  3276. }
  3277. add_action( 'wp_enqueue_scripts', 'pen_inline_css_bottom' );
  3278. }
  3279. if ( ! function_exists( 'pen_inline_css_footer' ) ) {
  3280. /**
  3281. * Adds inline CSS for the footer area.
  3282. *
  3283. * @since Pen 1.0.0
  3284. * @return void
  3285. */
  3286. function pen_inline_css_footer() {
  3287. $css = '';
  3288. $preset_color = esc_html( pen_preset_get( 'color' ) );
  3289. $background_left = esc_html( pen_option_get( 'color_footer_background_primary' ) );
  3290. $background_left_default = pen_option_default( 'color_footer_background_primary' );
  3291. $background_right = esc_html( pen_option_get( 'color_footer_background_secondary' ) );
  3292. $background_right_default = pen_option_default( 'color_footer_background_secondary' );
  3293. $background_image = esc_html( pen_option_get( 'background_image_footer' ) );
  3294. $angle = esc_html( pen_option_get( 'color_footer_background_angle' ) );
  3295. $angle_default = pen_option_default( 'color_footer_background_angle' );
  3296. if ( 'to right' === $angle ) {
  3297. $angle_ie = 'left';
  3298. } elseif ( 'to bottom' === $angle ) {
  3299. $angle_ie = 'top';
  3300. } elseif ( false !== strpos( $angle, 'deg' ) ) {
  3301. $angle_ie = ( str_replace( 'deg', '', $angle ) + 200 ) . 'deg';
  3302. }
  3303. $text_color = esc_html( pen_option_get( 'color_footer_text' ) );
  3304. $text_color_default = pen_option_default( 'color_footer_text' );
  3305. $link_color = esc_html( pen_option_get( 'color_footer_link' ) );
  3306. $link_color_default = pen_option_default( 'color_footer_link' );
  3307. if ( ! pen_option_get( 'color_footer_text_shadow_display' ) ) {
  3308. $text_shadow = 'none';
  3309. } else {
  3310. $text_shadow = '1px 1px 2px ' . esc_html( pen_option_get( 'color_footer_text_shadow' ) );
  3311. }
  3312. if ( 'preset_1' !== $preset_color || $background_left !== $background_left_default || $background_right !== $background_right_default || $background_image || $angle !== $angle_default ) {
  3313. $css .= '#pen_footer.pen_not_transparent {
  3314. background-color:' . $background_left . ';
  3315. background:' . $background_left . ';';
  3316. if ( $background_left !== $background_right ) {
  3317. $css .= 'background:-ms-linear-gradient(' . $angle_ie . ',' . $background_left . ' 0%,' . $background_right . ' 100%);
  3318. background:linear-gradient(' . $angle . ',' . $background_left . ' 0%,' . $background_right . ' 100%);';
  3319. }
  3320. if ( $background_image ) {
  3321. $css .= "background-image:url('" . $background_image . "');
  3322. background-repeat:no-repeat;
  3323. background-position:top center;
  3324. background-size:cover;";
  3325. }
  3326. if ( 'preset_1' !== $preset_color || $text_color !== $text_color_default ) {
  3327. $css .= 'color:' . $text_color . ';';
  3328. }
  3329. if ( 'preset_1' !== $preset_color || '1px 1px 2px ' . pen_option_default( 'color_footer_text_shadow' ) !== $text_shadow ) {
  3330. $css .= 'text-shadow:' . $text_shadow . ';';
  3331. }
  3332. $css .= '}
  3333. a#pen_back {
  3334. background:' . $background_right . ';
  3335. color:' . $link_color . ';
  3336. text-shadow:' . $text_shadow . ';
  3337. }';
  3338. }
  3339. $link_color_hover = esc_html( pen_option_get( 'color_footer_link_hover' ) );
  3340. $link_color_hover_default = pen_option_default( 'color_footer_link_hover' );
  3341. if ( 'preset_1' !== $preset_color || $link_color !== $link_color_default ) {
  3342. $css .= '#pen_footer a,
  3343. #pen_footer .pen_footer_inner .pen_social_networks a {
  3344. color:' . $link_color . ';
  3345. }
  3346. #pen_footer .pen_footer_inner .pen_social_networks a {
  3347. border-color:' . $link_color . ';
  3348. }
  3349. @media only screen and (min-width:728px) {
  3350. #pen_footer .pen_footer_inner #pen_footer_menu li a:after {
  3351. background: -ms-linear-gradient(270deg, rgba(0,0,0,0) 0%,' . $link_color . ' 50%, rgba(0,0,0,0) 100%);
  3352. background: linear-gradient(180deg, rgba(0,0,0,0) 0%,' . $link_color . ' 50%, rgba(0,0,0,0) 100%);
  3353. }
  3354. }';
  3355. }
  3356. if ( 'preset_1' !== $preset_color || $link_color_hover !== $link_color_hover_default ) {
  3357. $css .= '#pen_footer a:focus,
  3358. #pen_footer a:hover,
  3359. #pen_footer a:active,
  3360. #pen_footer .pen_footer_inner .pen_social_networks a:focus,
  3361. #pen_footer .pen_footer_inner .pen_social_networks a:hover,
  3362. #pen_footer .pen_footer_inner .pen_social_networks a:active {
  3363. color:' . $link_color_hover . ';
  3364. }
  3365. #pen_footer .pen_footer_inner .pen_social_networks a:focus,
  3366. #pen_footer .pen_footer_inner .pen_social_networks a:hover,
  3367. #pen_footer .pen_footer_inner .pen_social_networks a:active {
  3368. border-color:' . $link_color_hover . ';
  3369. }';
  3370. }
  3371. if ( pen_option_get( 'phone' ) && pen_option_get( 'phone_footer_display' ) ) {
  3372. $phone_font = esc_html( pen_option_get( 'font_family_phone_footer' ) );
  3373. $phone_size = esc_html( pen_option_get( 'font_size_phone_footer' ) );
  3374. $phone_size_default = pen_option_default( 'font_size_phone_footer' );
  3375. if ( 'preset_1' !== $preset_color || 'default' !== $phone_font || $phone_size !== $phone_size_default ) {
  3376. $css .= '#pen_footer .pen_footer_inner .pen_phone a {';
  3377. if ( 'default' !== $phone_font ) {
  3378. $css .= 'font-family:"' . ltrim( $phone_font, 'g:' ) . '", Arial, Helvetica, Sans-serif;
  3379. font-weight:normal;';
  3380. }
  3381. if ( $phone_size !== $phone_size_default ) {
  3382. $css .= 'font-size:' . $phone_size . ';';
  3383. }
  3384. $css .= '}';
  3385. }
  3386. }
  3387. $css = pen_compress_css( $css );
  3388. wp_add_inline_style( 'pen-css', $css );
  3389. }
  3390. add_action( 'wp_enqueue_scripts', 'pen_inline_css_footer' );
  3391. }
  3392. if ( ! function_exists( 'pen_customize_register' ) ) {
  3393. /**
  3394. * Add postMessage support for site title and description for the Theme Customizer.
  3395. *
  3396. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  3397. *
  3398. * @since Pen 1.0.0
  3399. * @return void
  3400. */
  3401. function pen_customize_register( $wp_customize ) {
  3402. pen_customize_contact( $wp_customize );
  3403. pen_customize_color( $wp_customize );
  3404. // pen_customize_typography( $wp_customize );
  3405. pen_customize_header( $wp_customize );
  3406. pen_customize_content_list( $wp_customize );
  3407. pen_customize_content_full( $wp_customize );
  3408. pen_customize_site_layout( $wp_customize );
  3409. pen_customize_front( $wp_customize );
  3410. pen_customize_footer( $wp_customize );
  3411. pen_customize_background( $wp_customize );
  3412. pen_customize_logo( $wp_customize );
  3413. }
  3414. add_action( 'customize_register', 'pen_customize_register' );
  3415. }
  3416. if ( ! function_exists( 'pen_customizer_preview_js' ) ) {
  3417. /**
  3418. * Enhancements for the the Theme Customizer.
  3419. *
  3420. * @since Pen 1.0.0
  3421. * @return void
  3422. */
  3423. function pen_customizer_preview_js() {
  3424. wp_enqueue_script( 'pen-customizer-preview', get_template_directory_uri() . '/assets/js/pen-customize-preview.js', array( 'customize-preview', 'wp-backbone' ), wp_get_theme( 'pen' )->get( 'Version' ), true );
  3425. wp_localize_script(
  3426. 'pen-customizer-preview',
  3427. 'pen_preview_js',
  3428. array(
  3429. 'preset_color' => pen_preset_get( 'color' ),
  3430. )
  3431. );
  3432. }
  3433. add_action( 'customize_preview_init', 'pen_customizer_preview_js' );
  3434. }
  3435. if ( ! function_exists( 'pen_customizer_main_js' ) ) {
  3436. /**
  3437. * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
  3438. *
  3439. * @since Pen 1.0.0
  3440. * @return void
  3441. */
  3442. function pen_customizer_main_js() {
  3443. $preset_preview = false;
  3444. if ( pen_filter_input( 'GET', 'pen_preview_color' ) || pen_filter_input( 'GET', 'pen_preview_font' ) ) {
  3445. $preset_preview = true;
  3446. }
  3447. wp_enqueue_script( 'pen-customizer-main', get_template_directory_uri() . '/assets/js/pen-customize-main.js', array(), wp_get_theme( 'pen' )->get( 'Version' ), true );
  3448. wp_localize_script(
  3449. 'pen-customizer-main',
  3450. 'pen_customize_js',
  3451. array(
  3452. 'support_url' => esc_url( PEN_SUPPORT_URL ),
  3453. 'preset_preview' => $preset_preview,
  3454. 'preset_color' => str_replace( 'preset_', '', pen_preset_get( 'color' ) ),
  3455. 'preset_font' => str_replace( 'preset_', '', pen_preset_get( 'font_family' ) ),
  3456. 'text' => array(
  3457. 'pen_theme' => __( 'Pen', 'pen' ),
  3458. 'support_text' => __( 'Do you need help?', 'pen' ),
  3459. 'support_description' => __( 'Request Support', 'pen' ),
  3460. 'theme_specific' => sprintf(
  3461. "%1\$s\r\n%2\$s",
  3462. __( 'Pen theme only:', 'pen' ),
  3463. __( "This is a part of the 'Pen' theme so if you switch to another theme these settings will be no longer used. The rest of the settings that are here are either parts of the WordPress core or added via plugins and they are available with or without this theme.", 'pen' )
  3464. ),
  3465. ),
  3466. )
  3467. );
  3468. }
  3469. add_action( 'customize_controls_enqueue_scripts', 'pen_customizer_main_js' );
  3470. }