An updated theme (based on Atticus Finch) for ClassicPress
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

544 lines
19 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <?php
  2. // Our action hook widget areas -- only display them if active
  3. // header.php action hooks
  4. if ( get_theme_mod( 'portage_before_header') == '1' ) :
  5. add_action('portage_before_header', 'portage_before_header_fc' );
  6. function portage_before_header_fc(){
  7. if ( is_active_sidebar( 'portage_before_header' ) ) {
  8. echo '<div id="portage_before_header" class="portage-action-hook">';
  9. dynamic_sidebar( 'portage_before_header' );
  10. echo '</div>';
  11. }
  12. }
  13. endif;
  14. if ( get_theme_mod( 'portage_after_top_menu') == '1' ) :
  15. add_action('portage_after_top_menu', 'portage_after_top_menu_FC' );
  16. function portage_after_top_menu_FC(){
  17. if ( is_active_sidebar( 'portage_after_top_menu' ) ) {
  18. echo '<div id="portage_after_top_menu" class="portage-action-hook">';
  19. dynamic_sidebar( 'portage_after_top_menu' );
  20. echo '</div>';
  21. }
  22. }
  23. endif;
  24. if ( get_theme_mod( 'portage_before_social_media') == '1' ) :
  25. add_action('portage_before_social_media', 'portage_before_social_media_fc' );
  26. function portage_before_social_media_fc(){
  27. if ( is_active_sidebar( 'portage_before_social_media' ) ) {
  28. echo '<div id="portage_before_social_media" class="portage-action-hook">';
  29. dynamic_sidebar( 'portage_before_social_media' );
  30. echo '</div>';
  31. }
  32. }
  33. endif;
  34. if ( get_theme_mod( 'portage_before_primary_menu') == '1' ) :
  35. add_action('portage_before_primary_menu', 'portage_before_primary_menu_fc' );
  36. function portage_before_primary_menu_fc(){
  37. if ( is_active_sidebar( 'portage_before_primary_menu' ) ) {
  38. echo '<div id="portage_before_primary_menu" class="portage-action-hook">';
  39. dynamic_sidebar( 'portage_before_primary_menu' );
  40. echo '</div>';
  41. }
  42. }
  43. endif;
  44. if ( get_theme_mod( 'portage_after_header') == '1' ) :
  45. add_action('portage_after_header', 'portage_after_header_fc' );
  46. function portage_after_header_fc(){
  47. if ( is_active_sidebar( 'portage_after_header' ) ) {
  48. echo '<div id="portage_after_header" class="portage-action-hook">';
  49. dynamic_sidebar( 'portage_after_header' );
  50. echo '</div>';
  51. }
  52. }
  53. endif;
  54. // index.php action hooks
  55. if ( get_theme_mod( 'portage_container_top') == '1' ) :
  56. add_action('portage_container_top', 'portage_container_top_fc' );
  57. function portage_container_top_fc(){
  58. if ( is_active_sidebar( 'portage_container_top' ) ) {
  59. echo '<div id="portage_container_top" class="portage-action-hook">';
  60. dynamic_sidebar( 'portage_container_top' );
  61. echo '</div><div class="clear"></div>';
  62. }
  63. }
  64. endif;
  65. // content.php action hooks
  66. if ( get_theme_mod( 'portage_before_post_title') == '1' ) :
  67. add_action('portage_before_post_title', 'portage_before_post_title_fc' );
  68. function portage_before_post_title_fc(){
  69. if ( is_active_sidebar( 'portage_before_post_title' ) ) {
  70. echo '<div id="portage_before_post_title" class="portage-action-hook">';
  71. dynamic_sidebar( 'portage_before_post_title' );
  72. echo '</div>';
  73. }
  74. }
  75. endif;
  76. if ( get_theme_mod( 'portage_before_post_content') == '1' ) :
  77. add_action('portage_before_post_content', 'portage_before_post_content_fc' );
  78. function portage_before_post_content_fc(){
  79. if ( is_active_sidebar( 'portage_before_post_content' ) ) {
  80. echo '<div id="portage_before_post_content" class="portage-action-hook">';
  81. dynamic_sidebar( 'portage_before_post_content' );
  82. echo '</div>';
  83. }
  84. }
  85. endif;
  86. if ( get_theme_mod( 'portage_post_top') == '1' ) :
  87. add_action('portage_post_top', 'portage_post_top_fc' );
  88. function portage_post_top_fc(){
  89. if ( is_active_sidebar( 'portage_post_top' ) ) {
  90. echo '<div id="portage_post_top" class="portage-action-hook">';
  91. dynamic_sidebar( 'portage_post_top' );
  92. echo '</div>';
  93. }
  94. }
  95. endif;
  96. if ( get_theme_mod( 'portage_post_bottom') == '1' ) :
  97. add_action('portage_post_bottom', 'portage_post_bottom_fc' );
  98. function portage_post_bottom_fc(){
  99. if ( is_active_sidebar( 'portage_post_bottom' ) ) {
  100. echo '<div id="portage_post_bottom" class="portage-action-hook">';
  101. dynamic_sidebar( 'portage_post_bottom' );
  102. echo '</div>';
  103. }
  104. }
  105. endif;
  106. if ( get_theme_mod( 'portage_after_post_content') == '1' ) :
  107. add_action('portage_after_post_content', 'portage_after_post_content_fc' );
  108. function portage_after_post_content_fc(){
  109. if ( is_active_sidebar( 'portage_after_post_content' ) ) {
  110. echo '<div id="portage_after_post_content" class="portage-action-hook">';
  111. dynamic_sidebar( 'portage_after_post_content' );
  112. echo '</div>';
  113. }
  114. }
  115. endif;
  116. if ( get_theme_mod( 'portage_before_post_meta') == '1' ) :
  117. add_action('portage_before_post_meta', 'portage_before_post_meta_fc' );
  118. function portage_before_post_meta_fc(){
  119. if ( is_active_sidebar( 'portage_before_post_meta' ) ) {
  120. echo '<div id="portage_before_post_meta" class="portage-action-hook">';
  121. dynamic_sidebar( 'portage_before_post_meta' );
  122. echo '</div>';
  123. }
  124. }
  125. endif;
  126. if ( get_theme_mod( 'portage_after_post_meta') == '1' ) :
  127. add_action('portage_after_post_meta', 'portage_after_post_meta_fc' );
  128. function portage_after_post_meta_fc(){
  129. if ( is_active_sidebar( 'portage_after_post_meta' ) ) {
  130. echo '<div id="portage_after_post_meta" class="portage-action-hook">';
  131. dynamic_sidebar( 'portage_after_post_meta' );
  132. echo '</div>';
  133. }
  134. }
  135. endif;
  136. // comments.php action hooks
  137. if ( get_theme_mod( 'portage_before_comments') == '1' ) :
  138. add_action('portage_before_comments', 'portage_before_comments_fc' );
  139. function portage_before_comments_fc(){
  140. if ( is_active_sidebar( 'portage_before_comments' ) ) {
  141. echo '<div id="portage_before_comments" class="portage-action-hook">';
  142. dynamic_sidebar( 'portage_before_comments' );
  143. echo '</div>';
  144. }
  145. }
  146. endif;
  147. if ( get_theme_mod( 'portage_after_comments') == '1' ) :
  148. add_action('portage_after_comments', 'portage_after_comments_fc' );
  149. function portage_after_comments_fc(){
  150. if ( is_active_sidebar( 'portage_after_comments' ) ) {
  151. echo '<div id="portage_after_comments" class="portage-action-hook">';
  152. dynamic_sidebar( 'portage_after_comments' );
  153. echo '</div>';
  154. }
  155. }
  156. endif;
  157. if ( get_theme_mod( 'portage_before_comment_form') == '1' ) :
  158. add_action('portage_before_comment_form', 'portage_before_comment_form_fc' );
  159. function portage_before_comment_form_fc(){
  160. if ( comments_open() ) : {
  161. if ( is_active_sidebar( 'portage_before_comment_form' ) ) {
  162. echo '<div id="portage_before_comment_form" class="portage-action-hook">';
  163. dynamic_sidebar( 'portage_before_comment_form' );
  164. echo '</div>';
  165. }
  166. }
  167. endif;
  168. }
  169. endif;
  170. if ( get_theme_mod( 'portage_after_comment_form') == '1' ) :
  171. add_action('portage_after_comment_form', 'portage_after_comment_form_fc' );
  172. function portage_after_comment_form_fc(){
  173. if (comments_open() ) : {
  174. if ( is_active_sidebar( 'portage_after_comment_form' ) ) {
  175. echo '<div id="portage_after_comment_form" class="portage-action-hook">';
  176. dynamic_sidebar( 'portage_after_comment_form' );
  177. echo '</div>';
  178. }
  179. }
  180. endif;
  181. }
  182. endif;
  183. // footer.php action hooks
  184. if ( get_theme_mod( 'portage_container_bottom') == '1' ) :
  185. add_action('portage_container_bottom', 'portage_container_bottom_fc' );
  186. function portage_container_bottom_fc(){
  187. if ( is_active_sidebar( 'portage_container_bottom' ) ) {
  188. echo '<div class="clear"></div><div id="portage_container_bottom" class="portage-action-hook">';
  189. dynamic_sidebar( 'portage_container_bottom' );
  190. echo '</div><div class="clear"></div>';
  191. }
  192. }
  193. endif;
  194. if ( get_theme_mod( 'portage_before_footer_menu') == '1' ) :
  195. add_action('portage_before_footer_menu', 'portage_before_footer_menu_fc' );
  196. function portage_before_footer_menu_fc(){
  197. if ( is_active_sidebar( 'portage_before_footer_menu' ) ) {
  198. echo '<div id="portage_before_footer_menu" class="portage-action-hook">';
  199. dynamic_sidebar( 'portage_before_footer_menu' );
  200. echo '</div>';
  201. }
  202. }
  203. endif;
  204. if ( get_theme_mod( 'portage_footer_top') == '1' ) :
  205. add_action('portage_footer_top', 'portage_footer_top_fc' );
  206. function portage_footer_top_fc(){
  207. if ( is_active_sidebar( 'portage_footer_top' ) ) {
  208. echo '<div id="portage_footer_top" class="portage-action-hook">';
  209. dynamic_sidebar( 'portage_footer_top' );
  210. echo '</div>';
  211. }
  212. }
  213. endif;
  214. if ( get_theme_mod( 'portage_footer_bottom') == '1' ) :
  215. add_action('portage_footer_bottom', 'portage_footer_bottom_fc' );
  216. function portage_footer_bottom_fc(){
  217. if ( is_active_sidebar( 'portage_footer_bottom' ) ) {
  218. echo '<div id="portage_footer_bottom" class="portage-action-hook">';
  219. dynamic_sidebar( 'portage_footer_bottom' );
  220. echo '</div>';
  221. }
  222. }
  223. endif;
  224. if ( get_theme_mod( 'portage_after_footer') == '1' ) :
  225. add_action('portage_after_footer', 'portage_after_footer_fc' );
  226. function portage_after_footer_fc(){
  227. if ( is_active_sidebar( 'portage_after_footer' ) ) {
  228. echo '<div id="portage_after_footer" class="portage-action-hook">';
  229. dynamic_sidebar( 'portage_after_footer' );
  230. echo '</div>';
  231. }
  232. }
  233. endif;
  234. // Register our action hooks as widget areas
  235. // codex.wordpress.org/Widgetizing_Themes
  236. function greybox_action_hook_widgets() {
  237. // Header widgets
  238. if ( get_theme_mod( 'portage_before_header') == '1' ) :
  239. register_sidebar( array(
  240. 'name' => 'Before Header',
  241. 'id' => 'portage_before_header',
  242. 'description' => __( 'Widgets in this area will be shown on all posts and pages just above the header and the "above header menu" (if you are using one).', 'portage' ),
  243. 'before_widget' => '<div class="portage-before-header-widget">',
  244. 'after_widget' => '</div>',
  245. 'before_title' => '<h3>',
  246. 'after_title' => '</h3>',
  247. ) );
  248. endif;
  249. if ( get_theme_mod( 'portage_after_top_menu') == '1' ) :
  250. register_sidebar( array(
  251. 'name' => 'After Top Menu',
  252. 'id' => 'portage_after_top_menu',
  253. 'description' => __( 'Widgets in this area will be shown on all posts and pages below the top menu and above the site name.', 'portage' ),
  254. 'before_widget' => '<div class="portage-after-top-menu-widget">',
  255. 'after_widget' => '</div>',
  256. 'before_title' => '<h3>',
  257. 'after_title' => '</h3>',
  258. ) );
  259. endif;
  260. if ( get_theme_mod( 'portage_before_social_media') == '1' ) :
  261. register_sidebar( array(
  262. 'name' => 'Before Social Media',
  263. 'id' => 'portage_before_social_media',
  264. 'description' => __( 'Widgets in this area will be shown on all posts and pages to the left of the title and to the right of the social media menu.', 'portage' ),
  265. 'before_widget' => '<div class="portage-before-social-media-widget">',
  266. 'after_widget' => '</div>',
  267. 'before_title' => '<h3>',
  268. 'after_title' => '</h3>',
  269. ) );
  270. endif;
  271. if ( get_theme_mod( 'portage_before_primary_menu') == '1' ) :
  272. register_sidebar( array(
  273. 'name' => 'Before Primary Menu',
  274. 'id' => 'portage_before_primary_menu',
  275. 'description' => __( 'Widgets in this area will be shown on all posts and pages above the primary menu.', 'portage' ),
  276. 'before_widget' => '<div class="portage-before-primary-menu-widget">',
  277. 'after_widget' => '</div>',
  278. 'before_title' => '<h3>',
  279. 'after_title' => '</h3>',
  280. ) );
  281. endif;
  282. if ( get_theme_mod( 'portage_after_header') == '1' ) :
  283. register_sidebar( array(
  284. 'name' => 'After Header',
  285. 'id' => 'portage_after_header',
  286. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the header and before the main content and sidebar.', 'portage' ),
  287. 'before_widget' => '<div class="portage-after-header-widget">',
  288. 'after_widget' => '</div>',
  289. 'before_title' => '<h3>',
  290. 'after_title' => '</h3>',
  291. ) );
  292. endif;
  293. // Index widgets
  294. if ( get_theme_mod( 'portage_container_top') == '1' ) :
  295. register_sidebar( array(
  296. 'name' => 'Top of Container',
  297. 'id' => 'portage_container_top',
  298. 'description' => __( 'Widgets in this area will be shown on all posts and pages above the sidebar and content.', 'portage' ),
  299. 'before_widget' => '<div class="portage-container-top-widget">',
  300. 'after_widget' => '</div>',
  301. 'before_title' => '<h3>',
  302. 'after_title' => '</h3>',
  303. ) );
  304. endif;
  305. // Content widgets
  306. if ( get_theme_mod( 'portage_before_post_title') == '1' ) :
  307. register_sidebar( array(
  308. 'name' => 'Before Post Title',
  309. 'id' => 'portage_before_post_title',
  310. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the post title.', 'portage' ),
  311. 'before_widget' => '<div class="portage-before-post-title-widget">',
  312. 'after_widget' => '</div>',
  313. 'before_title' => '<h3>',
  314. 'after_title' => '</h3>',
  315. ) );
  316. endif;
  317. if ( get_theme_mod( 'portage_before_post_content') == '1' ) :
  318. register_sidebar( array(
  319. 'name' => 'Before Post Content',
  320. 'id' => 'portage_before_post_content',
  321. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the title and before the post content.', 'portage' ),
  322. 'before_widget' => '<div class="portage-before-post-content-widget">',
  323. 'after_widget' => '</div>',
  324. 'before_title' => '<h3>',
  325. 'after_title' => '</h3>',
  326. ) );
  327. endif;
  328. if ( get_theme_mod( 'portage_post_top') == '1' ) :
  329. register_sidebar( array(
  330. 'name' => 'Top of Post',
  331. 'id' => 'portage_post_top',
  332. 'description' => __( 'Widgets in this area will be shown on all posts and pages at the top of the post.', 'portage' ),
  333. 'before_widget' => '<div class="portage-post-top-widget">',
  334. 'after_widget' => '</div>',
  335. 'before_title' => '<h3>',
  336. 'after_title' => '</h3>',
  337. ) );
  338. endif;
  339. if ( get_theme_mod( 'portage_post_bottom') == '1' ) :
  340. register_sidebar( array(
  341. 'name' => 'Bottom of Post',
  342. 'id' => 'portage_post_bottom',
  343. 'description' => __( 'Widgets in this area will be shown on all posts and pages at the bottom of the post.', 'portage' ),
  344. 'before_widget' => '<div class="portage-post-bottom-widget">',
  345. 'after_widget' => '</div>',
  346. 'before_title' => '<h3>',
  347. 'after_title' => '</h3>',
  348. ) );
  349. endif;
  350. if ( get_theme_mod( 'portage_after_post_content') == '1' ) :
  351. register_sidebar( array(
  352. 'name' => 'After Post Content',
  353. 'id' => 'portage_after_post_content',
  354. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the post content.', 'portage' ),
  355. 'before_widget' => '<div class="portage-after-post-content-widget">',
  356. 'after_widget' => '</div>',
  357. 'before_title' => '<h3>',
  358. 'after_title' => '</h3>',
  359. ) );
  360. endif;
  361. if ( get_theme_mod( 'portage_before_post_meta') == '1' ) :
  362. register_sidebar( array(
  363. 'name' => 'Before Post Meta',
  364. 'id' => 'portage_before_post_meta',
  365. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the post meta.', 'portage' ),
  366. 'before_widget' => '<div class="portage-before-post-meta-widget">',
  367. 'after_widget' => '</div>',
  368. 'before_title' => '<h3>',
  369. 'after_title' => '</h3>',
  370. ) );
  371. endif;
  372. if ( get_theme_mod( 'portage_after_post_meta') == '1' ) :
  373. register_sidebar( array(
  374. 'name' => 'After Post Meta',
  375. 'id' => 'portage_after_post_meta',
  376. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the post meta.', 'portage' ),
  377. 'before_widget' => '<div class="portage-after-post-meta-widget">',
  378. 'after_widget' => '</div>',
  379. 'before_title' => '<h3>',
  380. 'after_title' => '</h3>',
  381. ) );
  382. endif;
  383. // Comments widgets
  384. if ( get_theme_mod( 'portage_before_comments') == '1' ) :
  385. register_sidebar( array(
  386. 'name' => 'Before Comments',
  387. 'id' => 'portage_before_comments',
  388. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the comments.', 'portage' ),
  389. 'before_widget' => '<div class="portage-before-comments-widget">',
  390. 'after_widget' => '</div>',
  391. 'before_title' => '<h3>',
  392. 'after_title' => '</h3>',
  393. ) );
  394. endif;
  395. if ( get_theme_mod( 'portage_after_comments') == '1' ) :
  396. register_sidebar( array(
  397. 'name' => 'After Comments',
  398. 'id' => 'portage_after_comments',
  399. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the comments.', 'portage' ),
  400. 'before_widget' => '<div class="portage-after-comments-widget">',
  401. 'after_widget' => '</div>',
  402. 'before_title' => '<h3>',
  403. 'after_title' => '</h3>',
  404. ) );
  405. endif;
  406. if ( get_theme_mod( 'portage_before_comment_form') == '1' ) :
  407. register_sidebar( array(
  408. 'name' => 'Before Comment Form',
  409. 'id' => 'portage_before_comment_form',
  410. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the comment form.', 'portage' ),
  411. 'before_widget' => '<div class="portage-before-comment-form-widget">',
  412. 'after_widget' => '</div>',
  413. 'before_title' => '<h3>',
  414. 'after_title' => '</h3>',
  415. ) );
  416. endif;
  417. if ( get_theme_mod( 'portage_after_comment_form') == '1' ) :
  418. register_sidebar( array(
  419. 'name' => 'After Comment Form',
  420. 'id' => 'portage_after_comment_form',
  421. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the comment form.', 'portage' ),
  422. 'before_widget' => '<div class="portage-after-comment-form-widget">',
  423. 'after_widget' => '</div>',
  424. 'before_title' => '<h3>',
  425. 'after_title' => '</h3>',
  426. ) );
  427. endif;
  428. // Footer widgets
  429. if ( get_theme_mod( 'portage_container_bottom') == '1' ) :
  430. register_sidebar( array(
  431. 'name' => 'Bottom of Container',
  432. 'id' => 'portage_container_bottom',
  433. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the footer.', 'portage' ),
  434. 'before_widget' => '<div class="portage-container-bottom-widget">',
  435. 'after_widget' => '</div>',
  436. 'before_title' => '<h3>',
  437. 'after_title' => '</h3>',
  438. ) );
  439. endif;
  440. if ( get_theme_mod( 'portage_before_footer_menu') == '1' ) :
  441. register_sidebar( array(
  442. 'name' => 'Before Footer Menu',
  443. 'id' => 'portage_before_footer_menu',
  444. 'description' => __( 'Widgets in this area will be shown on all posts and pages before the footer menu.', 'portage' ),
  445. 'before_widget' => '<div class="portage-before-footer-menu-widget">',
  446. 'after_widget' => '</div>',
  447. 'before_title' => '<h3>',
  448. 'after_title' => '</h3>',
  449. ) );
  450. endif;
  451. if ( get_theme_mod( 'portage_footer_top') == '1' ) :
  452. register_sidebar( array(
  453. 'name' => 'Footer Top',
  454. 'id' => 'portage_footer_top',
  455. 'description' => __( 'Widgets in this area will be shown on all posts and pages at the top of the footer.', 'portage' ),
  456. 'before_widget' => '<div class="portage-footer-top-widget">',
  457. 'after_widget' => '</div>',
  458. 'before_title' => '<h3>',
  459. 'after_title' => '</h3>',
  460. ) );
  461. endif;
  462. if ( get_theme_mod( 'portage_footer_bottom') == '1' ) :
  463. register_sidebar( array(
  464. 'name' => 'Footer Bottom',
  465. 'id' => 'portage_footer_bottom',
  466. 'description' => __( 'Widgets in this area will be shown on all posts and pages at the bottom of the footer.', 'portage' ),
  467. 'before_widget' => '<div class="portage-footer-bottom-widget">',
  468. 'after_widget' => '</div>',
  469. 'before_title' => '<h3>',
  470. 'after_title' => '</h3>',
  471. ) );
  472. endif;
  473. if ( get_theme_mod( 'portage_after_footer') == '1' ) :
  474. register_sidebar( array(
  475. 'name' => 'After Footer',
  476. 'id' => 'portage_after_footer',
  477. 'description' => __( 'Widgets in this area will be shown on all posts and pages after the footer.', 'portage' ),
  478. 'before_widget' => '<div class="portage-after-footer-widget">',
  479. 'after_widget' => '</div>',
  480. 'before_title' => '<h3>',
  481. 'after_title' => '</h3>',
  482. ) );
  483. endif;
  484. } // end function
  485. add_action( 'widgets_init', 'greybox_action_hook_widgets' );