PageRenderTime 58ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/library/extensions/content-extensions.php

https://github.com/middlesister/Thematic
PHP | 1880 lines | 954 code | 321 blank | 605 comment | 160 complexity | 3fe8c549827875faf228a8c415b1d0dd MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * Content Extensions
  4. *
  5. * @package ThematicCoreLibrary
  6. * @subpackage ContentExtensions
  7. * @todo revisit docblock desciptions & tags
  8. */
  9. /**
  10. * Register action hook: thematic_abovecontainer
  11. *
  12. * Located in 404.php, archive.php, archives.php, attachement.php, author.php, category.php index.php,
  13. * links.php, page.php, search.php, single.php, tag.php
  14. * Just between #main and #container
  15. */
  16. function thematic_abovecontainer() {
  17. do_action('thematic_abovecontainer');
  18. } // end thematic_abovecontainer
  19. /**
  20. * Register action hook: thematic_abovecontent
  21. *
  22. * Located in 404.php, archive.php, archives.php, attachement.php, author.php, category.php index.php,
  23. * links.php, page.php, search.php, single.php, tag.php
  24. * Just between #main and #container
  25. */
  26. function thematic_abovecontent() {
  27. do_action('thematic_abovecontent');
  28. } // end thematic_abovecontent
  29. /**
  30. * Register action hook: thematic_abovepost
  31. *
  32. * Located in 404.php, archives.php, attachment.php, links.php, page.php, search.php and template-page-fullwidth.php
  33. * Just above #post
  34. */
  35. function thematic_abovepost() {
  36. do_action('thematic_abovepost');
  37. } // end thematic_abovepost
  38. /**
  39. * Register action hook: thematic_archives
  40. *
  41. * Located in archives.php
  42. * Just after the content
  43. */
  44. function thematic_archives() {
  45. do_action('thematic_archives');
  46. } // end thematic_archives
  47. /**
  48. * Register action hook: thematic_navigation_above
  49. *
  50. * Located in archive.php, author.php, category.php, index.php, search.php, single.php, tag.php
  51. * Just before the content
  52. */
  53. function thematic_navigation_above() {
  54. do_action('thematic_navigation_above');
  55. } // end thematic_navigation_above
  56. /**
  57. * Register action hook: thematic_navigation_below
  58. *
  59. * Located in archive.php, author.php, category.php, index.php, search.php, single.php, tag.php
  60. * Just after the content
  61. */
  62. function thematic_navigation_below() {
  63. do_action('thematic_navigation_below');
  64. } // end thematic_navigation_below
  65. /**
  66. * Register action hook: thematic_above_indexloop
  67. *
  68. * Located in index.php
  69. * Just before the loop
  70. */
  71. function thematic_above_indexloop() {
  72. do_action('thematic_above_indexloop');
  73. } // end thematic_above_indexloop
  74. /**
  75. * Register action hook: thematic_above_archiveloop
  76. *
  77. * Located in archive.php
  78. * Just before the loop
  79. */
  80. function thematic_above_archiveloop() {
  81. do_action('thematic_above_archiveloop');
  82. } // end thematic_above_archiveloop
  83. /**
  84. * Register action hook: thematic_archiveloop
  85. *
  86. * Located in archive.php
  87. * The Loop used on archive pages
  88. */
  89. function thematic_archiveloop() {
  90. do_action('thematic_archiveloop');
  91. } // end thematic_archiveloop
  92. /**
  93. * Register action hook: thematic_authorloop
  94. *
  95. * Located in author.php
  96. * The Loop used on author pages
  97. */
  98. function thematic_authorloop() {
  99. do_action('thematic_authorloop');
  100. } // end thematic_authorloop
  101. /**
  102. * Register action hook: thematic_categoryloop
  103. *
  104. * Located in category.php
  105. * The Loop used on category pages
  106. */
  107. function thematic_categoryloop() {
  108. do_action('thematic_categoryloop');
  109. } // end thematic_categoryloop
  110. /**
  111. * Register action hook: thematic_indexloop
  112. *
  113. * Located in index.php
  114. * The default loop
  115. */
  116. function thematic_indexloop() {
  117. do_action('thematic_indexloop');
  118. } // end thematic_indexloop
  119. /**
  120. * Register action hook: thematic_searchloop
  121. *
  122. * Located in search.php
  123. * The loop used on search result pages
  124. */
  125. function thematic_searchloop() {
  126. do_action('thematic_searchloop');
  127. } // end thematic_searchloop
  128. /**
  129. * Register action hook: thematic_singlepost
  130. *
  131. * Located in single.php
  132. * The Loop on single pages
  133. */
  134. function thematic_singlepost() {
  135. do_action('thematic_singlepost');
  136. } //end thematic_singlepost
  137. /**
  138. * Register action hook: thematic_tagloop
  139. *
  140. * Located in tag.php
  141. * The Loop on tag archive pages
  142. */
  143. function thematic_tagloop() {
  144. do_action('thematic_tagloop');
  145. } // end thematic_tagloop
  146. /**
  147. * Register action hook: thematic_below_indexloop
  148. *
  149. * Located in index.php
  150. * Just after the loop
  151. */
  152. function thematic_below_indexloop() {
  153. do_action('thematic_below_indexloop');
  154. } // end thematic_below_indexloop
  155. /**
  156. * Register action hook: thematic_below_archiveloop
  157. *
  158. * Located in archive.php
  159. * Just after the loop
  160. */
  161. function thematic_below_archiveloop() {
  162. do_action('thematic_below_archiveloop');
  163. } // end thematic_below_archiveloop
  164. /**
  165. * Register action hook: thematic_above_categoryloop
  166. *
  167. * Located in category.php
  168. * Just before the loop
  169. */
  170. function thematic_above_categoryloop() {
  171. do_action('thematic_above_categoryloop');
  172. } // end thematic_above_categoryloop
  173. /**
  174. * Register action hook: thematic_below_categoryloop
  175. *
  176. * Located in category.php
  177. * Just after the loop
  178. */
  179. function thematic_below_categoryloop() {
  180. do_action('thematic_below_categoryloop');
  181. } // end thematic_below_categoryloop
  182. /**
  183. * Register action hook: thematic_above_searchloop
  184. *
  185. * Located in search.php
  186. * Just before the loop
  187. */
  188. function thematic_above_searchloop() {
  189. do_action('thematic_above_searchloop');
  190. } // end thematic_above_searchloop
  191. /**
  192. * Register action hook: thematic_below_searchloop
  193. *
  194. * Located in search.php
  195. * Just after the loop
  196. */
  197. function thematic_below_searchloop() {
  198. do_action('thematic_below_searchloop');
  199. } // end thematic_below_searchloop
  200. /**
  201. * Register action hook: thematic_above_tagloop
  202. *
  203. * Located in tag.php
  204. * Just before the loop
  205. */
  206. function thematic_above_tagloop() {
  207. do_action('thematic_above_tagloop');
  208. } // end thematic_above_tagloop
  209. /**
  210. * Register action hook: thematic_init
  211. *
  212. * Located in tag.php
  213. * Just after the loop
  214. */
  215. function thematic_below_tagloop() {
  216. do_action('thematic_below_tagloop');
  217. } // end thematic_below_tagloop
  218. /**
  219. * Register action hook: thematic_belowpost
  220. *
  221. * Located in 404.php, archives.php, attachment.php, links.php, page.php, search.php and template-page-fullwidth.php
  222. * Just below #post
  223. */
  224. function thematic_belowpost() {
  225. do_action('thematic_belowpost');
  226. } // end thematic_belowpost
  227. /**
  228. * Register action hook: thematic_belowcontent
  229. *
  230. * Located in 404.php, archive.php, archives.php, attachement.php, author.php, category.php index.php,
  231. * links.php, page.php, search.php, single.php, tag.php
  232. * Just below #content
  233. */
  234. function thematic_belowcontent() {
  235. do_action('thematic_belowcontent');
  236. } // end thematic_belowcontent
  237. /**
  238. * Register action hook: thematic_belowcontainer
  239. *
  240. * Located in 404.php, archive.php, archives.php, attachement.php, author.php, category.php index.php,
  241. * links.php, page.php, search.php, single.php, tag.php
  242. * Just below #container
  243. */
  244. function thematic_belowcontainer() {
  245. do_action('thematic_belowcontainer');
  246. } // end thematic_belowcontainer
  247. if (function_exists('childtheme_override_page_title')) {
  248. /**
  249. * @ignore
  250. */
  251. function thematic_page_title() {
  252. childtheme_override_page_title();
  253. }
  254. } else {
  255. /**
  256. * Create the page title.
  257. *
  258. * Echoes the title of the webpage for specific queries. The markup is conditionally set using template tags.
  259. * Located in templates: archive.php, attachement.php, author.php, category.php, search.php, tag.php
  260. *
  261. * Override: childtheme_override_page_title <br>
  262. * Filter: thematic_page_title
  263. *
  264. * @todo review and remove possiblity for displaying an empty div for archive-meta
  265. */
  266. function thematic_page_title() {
  267. global $post;
  268. $content = "\t\t\t\t";
  269. if (is_attachment()) {
  270. $content .= '<h2 class="page-title"><a href="';
  271. $content .= apply_filters('the_permalink',get_permalink($post->post_parent));
  272. $content .= '" rev="attachment"><span class="meta-nav">&laquo; </span>';
  273. $content .= get_the_title($post->post_parent);
  274. $content .= '</a></h2>';
  275. } elseif (is_author()) {
  276. $content .= '<h1 class="page-title author">';
  277. $author = get_the_author_meta( 'display_name', $post->post_author );
  278. $content .= __('Author Archives:', 'thematic');
  279. $content .= ' <span>' . $author .'</span>';
  280. $content .= '</h1>';
  281. } elseif (is_category()) {
  282. $content .= '<h1 class="page-title">';
  283. $content .= __('Category Archives:', 'thematic');
  284. $content .= ' <span>' . single_cat_title('', FALSE) .'</span>';
  285. $content .= '</h1>' . "\n";
  286. $content .= "\n\t\t\t\t" . '<div class="archive-meta">';
  287. if ( !(''== category_description()) ) {
  288. $content .= apply_filters('archive_meta', category_description());
  289. }
  290. $content .= '</div>';
  291. } elseif (is_search()) {
  292. $content .= '<h1 class="page-title">';
  293. $content .= __('Search Results for:', 'thematic');
  294. $content .= ' <span id="search-terms">' . get_search_query() .'</span>';
  295. $content .= '</h1>';
  296. } elseif (is_tag()) {
  297. $content .= '<h1 class="page-title">';
  298. $content .= __('Tag Archives:', 'thematic');
  299. $content .= ' <span>';
  300. $content .= single_tag_title( '', false );
  301. $content .= '</span></h1>';
  302. } elseif (is_tax()) {
  303. global $taxonomy;
  304. $content .= '<h1 class="page-title">';
  305. $tax = get_taxonomy($taxonomy);
  306. $content .= $tax->labels->singular_name . ' ';
  307. $content .= __('Archives:', 'thematic');
  308. $content .= ' <span>' . thematic_get_term_name() .'</span>';
  309. $content .= '</h1>';
  310. } elseif (is_post_type_archive()) {
  311. $content .= '<h1 class="page-title">';
  312. $post_type_obj = get_post_type_object( get_post_type() );
  313. $post_type_name = $post_type_obj->labels->singular_name;
  314. $content .= __('Archives:', 'thematic');
  315. $content .= ' <span>' . $post_type_name . '</span>';
  316. $content .= '</h1>';
  317. } elseif (is_day()) {
  318. $content .= '<h1 class="page-title">';
  319. $content .= sprintf( __('Daily Archives: %s', 'thematic'), '<span>' . get_the_time( get_option('date_format') ) ) . '</span>';
  320. $content .= '</h1>';
  321. } elseif (is_month()) {
  322. $content .= '<h1 class="page-title">';
  323. $content .= sprintf( __('Monthly Archives: %s', 'thematic') , '<span>' . get_the_time('F Y') ) . '</span>';
  324. $content .= '</h1>';
  325. } elseif (is_year()) {
  326. $content .= '<h1 class="page-title">';
  327. $content .= sprintf( __('Yearly Archives: %s', 'thematic'), '<span>' . get_the_time('Y') ) . '</span>';
  328. $content .= '</h1>';
  329. }
  330. $content .= "\n";
  331. echo apply_filters('thematic_page_title', $content);
  332. }
  333. }
  334. if (function_exists('childtheme_override_nav_above')) {
  335. /**
  336. * @ignore
  337. */
  338. function thematic_nav_above() {
  339. childtheme_override_nav_above();
  340. }
  341. } else {
  342. /**
  343. * Create the above navigation
  344. *
  345. * Includes compatibility with WP-PageNavi plugin
  346. *
  347. * Override: childtheme_override_nav_above <br>
  348. *
  349. * @link http://wordpress.org/extend/plugins/wp-pagenavi/ WP-PageNavi Plugin Page
  350. */
  351. function thematic_nav_above() {
  352. if ( is_single() ) {
  353. ?>
  354. <nav id="nav-above" class="navigation" role="navigation">
  355. <div class="nav-previous"><?php thematic_previous_post_link() ?></div>
  356. <div class="nav-next"><?php thematic_next_post_link() ?></div>
  357. </nav>
  358. <?php } else { ?>
  359. <nav id="nav-above" class="navigation" role="navigation">
  360. <?php if ( function_exists( 'wp_pagenavi' ) ) { ?>
  361. <?php wp_pagenavi(); ?>
  362. <?php } else { ?>
  363. <div class="nav-previous"><?php next_posts_link(sprintf('<span class="meta-nav">&laquo;</span> %s', __('Older posts', 'thematic') ) ) ?></div>
  364. <div class="nav-next"><?php previous_posts_link(sprintf('%s <span class="meta-nav">&raquo;</span>',__( 'Newer posts', 'thematic') ) ) ?></div>
  365. <?php } ?>
  366. </nav>
  367. <?php
  368. }
  369. }
  370. } // end nav_above
  371. add_action('thematic_navigation_above', 'thematic_nav_above', 2);
  372. if (function_exists('childtheme_override_archive_loop')) {
  373. /**
  374. * @ignore
  375. */
  376. function thematic_archive_loop() {
  377. childtheme_override_archive_loop();
  378. }
  379. } else {
  380. /**
  381. * The Archive loop
  382. *
  383. * Located in archive.php
  384. *
  385. * Override: childtheme_override_archive_loop
  386. */
  387. function thematic_archive_loop() {
  388. while ( have_posts() ) : the_post();
  389. // action hook for insterting content above #post
  390. thematic_abovepost();
  391. ?>
  392. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  393. <?php
  394. // creating the post header
  395. thematic_postheader();
  396. ?>
  397. <div class="entry-content">
  398. <?php thematic_content(); ?>
  399. </div><!-- .entry-content -->
  400. <?php thematic_postfooter(); ?>
  401. </article><!-- #post -->
  402. <?php
  403. // action hook for insterting content below #post
  404. thematic_belowpost();
  405. endwhile;
  406. }
  407. } // end archive_loop
  408. add_action('thematic_archiveloop', 'thematic_archive_loop');
  409. if (function_exists('childtheme_override_author_loop')) {
  410. /**
  411. * @ignore
  412. */
  413. function thematic_author_loop() {
  414. childtheme_override_author_loop();
  415. }
  416. } else {
  417. /**
  418. * The Author loop
  419. *
  420. * Located in author.php
  421. *
  422. * Override: childtheme_override_author_loop
  423. */
  424. function thematic_author_loop() {
  425. rewind_posts();
  426. while ( have_posts() ) : the_post();
  427. // action hook for insterting content above #post
  428. thematic_abovepost();
  429. ?>
  430. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  431. <?php
  432. // creating the post header
  433. thematic_postheader();
  434. ?>
  435. <div class="entry-content">
  436. <?php thematic_content(); ?>
  437. </div><!-- .entry-content -->
  438. <?php thematic_postfooter(); ?>
  439. </article><!-- #post -->
  440. <?php
  441. // action hook for insterting content below #post
  442. thematic_belowpost();
  443. endwhile;
  444. }
  445. } // end author_loop
  446. add_action('thematic_authorloop', 'thematic_author_loop');
  447. if (function_exists('childtheme_override_category_loop')) {
  448. /**
  449. * @ignore
  450. */
  451. function thematic_category_loop() {
  452. childtheme_override_category_loop();
  453. }
  454. } else {
  455. /**
  456. * The Category loop
  457. *
  458. * Located in category.php
  459. *
  460. * Override: childtheme_override_category_loop
  461. */
  462. function thematic_category_loop() {
  463. while ( have_posts() ) : the_post();
  464. // action hook for insterting content above #post
  465. thematic_abovepost();
  466. ?>
  467. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  468. <?php
  469. // creating the post header
  470. thematic_postheader();
  471. ?>
  472. <div class="entry-content">
  473. <?php thematic_content(); ?>
  474. </div><!-- .entry-content -->
  475. <?php thematic_postfooter(); ?>
  476. </article><!-- #post -->
  477. <?php
  478. // action hook for insterting content below #post
  479. thematic_belowpost();
  480. endwhile;
  481. }
  482. } // end category_loop
  483. add_action('thematic_categoryloop', 'thematic_category_loop');
  484. if (function_exists('childtheme_override_index_loop')) {
  485. /**
  486. * @ignore
  487. */
  488. function thematic_index_loop() {
  489. childtheme_override_index_loop();
  490. }
  491. } else {
  492. /**
  493. * The Index loop
  494. *
  495. * Located in index.php
  496. *
  497. * Override: childtheme_override_index_loop
  498. */
  499. function thematic_index_loop() {
  500. // Count the number of posts so we can insert a widgetized area
  501. $count = 1;
  502. while ( have_posts() ) : the_post();
  503. // action hook for inserting content above #post
  504. thematic_abovepost();
  505. ?>
  506. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  507. <?php
  508. // creating the post header
  509. thematic_postheader();
  510. ?>
  511. <div class="entry-content">
  512. <?php thematic_content(); ?>
  513. <?php wp_link_pages( array( 'before' => sprintf( '<nav class="page-link">%s', __( 'Pages:', 'thematic' ) ),
  514. 'after' => '</nav>' ) ); ?>
  515. </div><!-- .entry-content -->
  516. <?php thematic_postfooter(); ?>
  517. </article><!-- #post -->
  518. <?php
  519. // action hook for insterting content below #post
  520. thematic_belowpost();
  521. comments_template();
  522. if ( $count == thematic_get_theme_opt( 'index_insert' ) ) {
  523. get_sidebar('index-insert');
  524. }
  525. $count = $count + 1;
  526. endwhile;
  527. }
  528. } // end index_loop
  529. add_action('thematic_indexloop', 'thematic_index_loop');
  530. if (function_exists('childtheme_override_single_post')) {
  531. /**
  532. * @ignore
  533. */
  534. function thematic_single_post() {
  535. childtheme_override_single_post();
  536. }
  537. } else {
  538. /**
  539. * The Single post loop
  540. *
  541. * Located in single.php
  542. *
  543. * Override: childtheme_override_single_post
  544. */
  545. function thematic_single_post() {
  546. // action hook for insterting content above #post
  547. thematic_abovepost();
  548. ?>
  549. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  550. <?php
  551. // creating the post header
  552. thematic_postheader();
  553. ?>
  554. <div class="entry-content">
  555. <?php thematic_content(); ?>
  556. <?php wp_link_pages( array( 'before' => sprintf( '<nav class="page-link">%s', __( 'Pages:', 'thematic' ) ),
  557. 'after' => '</nav>' ) ); ?>
  558. </div><!-- .entry-content -->
  559. <?php thematic_postfooter(); ?>
  560. </article><!-- #post -->
  561. <?php
  562. // action hook for insterting content below #post
  563. thematic_belowpost();
  564. }
  565. } // end single_post
  566. add_action('thematic_singlepost', 'thematic_single_post');
  567. if (function_exists('childtheme_override_search_loop')) {
  568. /**
  569. * @ignore
  570. */
  571. function thematic_search_loop() {
  572. childtheme_override_search_loop();
  573. }
  574. } else {
  575. /**
  576. * The Search loop
  577. *
  578. * Located in search.php
  579. *
  580. * Override: childtheme_override_search_loop
  581. */
  582. function thematic_search_loop() {
  583. while ( have_posts() ) : the_post();
  584. // action hook for insterting content above #post
  585. thematic_abovepost();
  586. ?>
  587. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  588. <?php
  589. // creating the post header
  590. thematic_postheader();
  591. ?>
  592. <div class="entry-content">
  593. <?php thematic_content(); ?>
  594. </div><!-- .entry-content -->
  595. <?php thematic_postfooter(); ?>
  596. </article><!-- #post -->
  597. <?php
  598. // action hook for insterting content below #post
  599. thematic_belowpost();
  600. endwhile;
  601. }
  602. } // end search_loop
  603. add_action('thematic_searchloop', 'thematic_search_loop');
  604. if (function_exists('childtheme_override_tag_loop')) {
  605. /**
  606. * @ignore
  607. */
  608. function thematic_tag_loop() {
  609. childtheme_override_tag_loop();
  610. }
  611. } else {
  612. /**
  613. * The Tag loop
  614. *
  615. * Located in tag.php
  616. *
  617. * Override: childtheme_override_tag_loop
  618. */
  619. function thematic_tag_loop() {
  620. while ( have_posts() ) : the_post();
  621. // action hook for insterting content above #post
  622. thematic_abovepost();
  623. ?>
  624. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
  625. <?php
  626. // creating the post header
  627. thematic_postheader();
  628. ?>
  629. <div class="entry-content">
  630. <?php thematic_content(); ?>
  631. </div><!-- .entry-content -->
  632. <?php thematic_postfooter(); ?>
  633. </article><!-- #post -->
  634. <?php
  635. // action hook for insterting content below #post
  636. thematic_belowpost();
  637. endwhile;
  638. }
  639. } // end tag_loop
  640. add_action('thematic_tagloop', 'thematic_tag_loop');
  641. /**
  642. * Filter: thematic_time_title
  643. *
  644. * Create the time url title displayed in the post header
  645. */
  646. function thematic_time_title() {
  647. $time_title = 'Y-m-d\TH:i:sO';
  648. // Filters should return correct
  649. $time_title = apply_filters('thematic_time_title', $time_title);
  650. return $time_title;
  651. } // end time_title
  652. /**
  653. * Filter: thematic_time_display
  654. *
  655. * Create the time displayed in the post header
  656. */
  657. function thematic_time_display() {
  658. $time_display = get_option('date_format');
  659. // Filters should return correct
  660. $time_display = apply_filters('thematic_time_display', $time_display);
  661. return $time_display;
  662. } // end time_display
  663. if (function_exists('childtheme_override_postheader')) {
  664. /**
  665. * @ignore
  666. */
  667. function thematic_postheader() {
  668. childtheme_override_postheader();
  669. }
  670. } else {
  671. /**
  672. * Create the post header
  673. *
  674. * Override: childtheme_override_postheader <br>
  675. * Filter: thematic_postheader
  676. */
  677. function thematic_postheader() {
  678. global $post;
  679. if ( is_404() || $post->post_type == 'page') {
  680. $postheader = '<header class="entry-header">' . thematic_postheader_posttitle() . "</header><!-- .entry-header -->\n";
  681. } else {
  682. $postheader = '<header class="entry-header">' . thematic_postheader_posttitle() . thematic_postheader_postmeta() . "</header><!-- .entry-header -->\n";
  683. }
  684. echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header
  685. }
  686. } // end postheader
  687. if (function_exists('childtheme_override_postheader_posteditlink')) {
  688. /**
  689. * @ignore
  690. */
  691. function thematic_postheader_posteditlink() {
  692. return childtheme_override_postheader_posteditlink();
  693. }
  694. } else {
  695. /**
  696. * Create the post edit link
  697. *
  698. * Override: childtheme_override_postheader_posteditlink <br>
  699. * Filter: thematic_postheader_posteditlink
  700. */
  701. function thematic_postheader_posteditlink() {
  702. $posteditlink = sprintf( '<a href="%s" title="%s" class="edit">%s</a>' ,
  703. get_edit_post_link(),
  704. esc_attr__('Edit post', 'thematic'),
  705. /* translators: post edit link */
  706. __('Edit', 'thematic'));
  707. return apply_filters('thematic_postheader_posteditlink', $posteditlink);
  708. }
  709. } // end postheader_posteditlink
  710. if (function_exists('childtheme_override_postheader_posttitle')) {
  711. /**
  712. * @ignore
  713. */
  714. function thematic_postheader_posttitle() {
  715. return childtheme_override_postheader_posttitle();
  716. }
  717. } else {
  718. /**
  719. * Create the post title
  720. *
  721. * Override: childtheme_override_postheader_posttitle <br>
  722. * Filter: thematic_postheader_posttitle
  723. */
  724. function thematic_postheader_posttitle() {
  725. $posttitle = "\n\n\t\t\t\t\t";
  726. if ( !$title_content = get_the_title() ) {
  727. $title_content = '<a href="' . get_permalink() . '">' . _x('(Untitled)', 'Default title for untitled posts', 'thematic') . '</a>';
  728. }
  729. if (is_single() || is_page()) {
  730. $posttitle .= '<h1 class="entry-title">' . $title_content . "</h1>\n";
  731. } elseif (is_404()) {
  732. $posttitle .= '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
  733. } else {
  734. $posttitle .= '<h1 class="entry-title">';
  735. $posttitle .= sprintf('<a href="%s" rel="bookmark">%s</a>',
  736. apply_filters('the_permalink', get_permalink()),
  737. $title_content
  738. );
  739. $posttitle .= "</h1>\n";
  740. }
  741. return apply_filters('thematic_postheader_posttitle',$posttitle);
  742. }
  743. } // end postheader_posttitle
  744. if (function_exists('childtheme_override_postheader_postmeta')) {
  745. /**
  746. * @ignore
  747. */
  748. function thematic_postheader_postmeta() {
  749. return childtheme_override_postheader_postmeta();
  750. }
  751. } else {
  752. /**
  753. * Create the post meta
  754. *
  755. * Override: childtheme_override_postheader_postmeta <br>
  756. * Filter: thematic_postheader_postmeta
  757. */
  758. function thematic_postheader_postmeta() {
  759. $postmeta = "\n\t\t\t\t\t";
  760. $postmeta .= '<div class="entry-meta">' . "\n\n";
  761. $postmeta .= "\t" . thematic_postmeta_authorlink() . "\n\n";
  762. $postmeta .= "\t" . '<span class="meta-sep meta-sep-entry-date"> | </span>'. "\n\n";
  763. $postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n";
  764. $postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n";
  765. $postmeta .= '</div><!-- .entry-meta -->' . "\n";
  766. return apply_filters('thematic_postheader_postmeta',$postmeta);
  767. }
  768. } // end postheader_postmeta
  769. if (function_exists('childtheme_override_postmeta_authorlink')) {
  770. /**
  771. * @ignore
  772. */
  773. function thematic_postmeta_authorlink() {
  774. return childtheme_override_postmeta_authorlink();
  775. }
  776. } else {
  777. /**
  778. * Create the author link for post meta
  779. *
  780. * Override: childtheme_override_postmeta_authorlink <br>
  781. * Filter: thematic_postmeta_authorlink
  782. */
  783. function thematic_postmeta_authorlink() {
  784. global $authordata;
  785. $author_prep = '<span class="meta-prep meta-prep-author">' . __('By', 'thematic') . ' </span>';
  786. if ( thematic_is_custom_post_type() && !current_theme_supports( 'thematic_support_post_type_author_link' ) ) {
  787. $author_info = '<span class="vcard"><span class="fn nickname">';
  788. $author_info .= get_the_author_meta( 'display_name' ) ;
  789. $author_info .= '</span></span>';
  790. } else {
  791. $author_info = '<span class="author vcard">';
  792. $author_info .= sprintf('<a class="url fn n" href="%s" title="%s">%s</a>',
  793. get_author_posts_url( $authordata->ID, $authordata->user_nicename ),
  794. /* translators: author name */
  795. sprintf( esc_attr__( 'View all posts by %s', 'thematic' ), get_the_author_meta( 'display_name' ) ),
  796. get_the_author_meta( 'display_name' ));
  797. $author_info .= '</span>';
  798. }
  799. $author_credit = $author_prep . $author_info ;
  800. return apply_filters('thematic_postmeta_authorlink', $author_credit);
  801. }
  802. } // end postmeta_authorlink
  803. if (function_exists('childtheme_override_postmeta_entrydate')) {
  804. /**
  805. * @ignore
  806. */
  807. function thematic_postmeta_entrydate() {
  808. return childtheme_override_postmeta_entrydate();
  809. }
  810. } else {
  811. /**
  812. * Create entry date for post meta
  813. *
  814. * Override: childtheme_override_postmeta_entrydate <br>
  815. * Filter: thematic_postmeta_entrydate
  816. */
  817. function thematic_postmeta_entrydate() {
  818. $entrydate = '<span class="meta-prep meta-prep-entry-date">' . __('Published:', 'thematic') . ' </span>';
  819. $entrydate .= '<span class="entry-date"><abbr class="published" title="';
  820. $entrydate .= get_the_time(thematic_time_title()) . '">';
  821. $entrydate .= get_the_time(thematic_time_display());
  822. $entrydate .= '</abbr></span>';
  823. return apply_filters('thematic_postmeta_entrydate', $entrydate);
  824. }
  825. } // end postmeta_entrydate
  826. if (function_exists('childtheme_override_postmeta_editlink')) {
  827. /**
  828. * @ignore
  829. */
  830. function thematic_postmeta_editlink() {
  831. return childtheme_override_postmeta_editlink();
  832. }
  833. } else {
  834. /**
  835. * Create edit link for post meta
  836. *
  837. * Override: childtheme_override_postmeta_editlink <br>
  838. * Filter: thematic_postmeta_editlink
  839. */
  840. function thematic_postmeta_editlink() {
  841. // Display edit link
  842. if (current_user_can('edit_posts')) {
  843. $editlink = '<span class="meta-sep meta-sep-edit">|</span> ' . "\n\n\t\t\t\t\t\t" . thematic_postheader_posteditlink();
  844. return apply_filters('thematic_postmeta_editlink', $editlink);
  845. }
  846. }
  847. } // end postmeta_editlink
  848. // Sets up the post content
  849. if (function_exists('childtheme_override_content_init')) {
  850. /**
  851. * @ignore
  852. */
  853. function thematic_content_init() {
  854. childtheme_override_content_init();
  855. }
  856. } else {
  857. /**
  858. * Set up the post content to use excerpt or full posts
  859. *
  860. * Uses conditional template tags to decide whether posts should be displayed using excerpts or the full content
  861. *
  862. * Override: childtheme_override_content_init <br>
  863. * Filter: thematic_content
  864. */
  865. function thematic_content_init() {
  866. global $thematic_content_length;
  867. $content = '';
  868. $thematic_content_length = '';
  869. if (is_home() || is_front_page()) {
  870. $content = 'full';
  871. } elseif (is_single()) {
  872. $content = 'full';
  873. } elseif (is_tag()) {
  874. $content = 'excerpt';
  875. } elseif (is_search()) {
  876. $content = 'excerpt';
  877. } elseif (is_category()) {
  878. $content = 'excerpt';
  879. } elseif (is_author()) {
  880. $content = 'excerpt';
  881. } elseif (is_archive()) {
  882. $content = 'excerpt';
  883. }
  884. $thematic_content_length = apply_filters('thematic_content', $content);
  885. }
  886. } // end content_init
  887. add_action('thematic_abovepost','thematic_content_init');
  888. if (function_exists('childtheme_override_content')) {
  889. /**
  890. * @ignore
  891. */
  892. function thematic_content() {
  893. childtheme_override_content();
  894. }
  895. } else {
  896. /**
  897. * Create the post content
  898. *
  899. * Detects whether to use the full length or excerpt of a post and displays it. Post thumbnails are included on
  900. * excerpt posts.
  901. *
  902. * Override: childtheme_override_content <br>
  903. * Filter: thematic_post_thumbs <br>
  904. * Filter: thematic_post_thumb_size <br>
  905. * Filter: thematic_post_thumb_attr <br>
  906. * Filter: thematic_post
  907. */
  908. function thematic_content() {
  909. global $thematic_content_length;
  910. if ( strtolower($thematic_content_length) == 'full' ) {
  911. $post = get_the_content( thematic_more_text() );
  912. $post = apply_filters('the_content', $post);
  913. $post = str_replace(']]>', ']]&gt;', $post);
  914. } elseif ( strtolower($thematic_content_length) == 'excerpt') {
  915. $post = '';
  916. $post .= get_the_excerpt();
  917. $post = apply_filters('the_excerpt',$post);
  918. if ( apply_filters( 'thematic_post_thumbs', TRUE) ) {
  919. $post_title = get_the_title();
  920. $size = apply_filters( 'thematic_post_thumb_size' , array(100,100) );
  921. $attr = apply_filters( 'thematic_post_thumb_attr', array('title' => sprintf( esc_attr__('Permalink to %s', 'thematic'), the_title_attribute( 'echo=0' ) ) ) );
  922. if ( has_post_thumbnail() ) {
  923. $post = sprintf('<a class="entry-thumb" href="%s" title="%s">%s</a>',
  924. get_permalink() ,
  925. sprintf( esc_attr__('Permalink to %s', 'thematic'), the_title_attribute( 'echo=0' ) ),
  926. get_the_post_thumbnail(get_the_ID(), $size, $attr)) . $post;
  927. }
  928. }
  929. } elseif ( strtolower($thematic_content_length) == 'none') {
  930. $post= '';
  931. } else {
  932. $post = get_the_content( thematic_more_text() );
  933. $post = apply_filters('the_content', $post);
  934. $post = str_replace(']]>', ']]&gt;', $post);
  935. }
  936. echo apply_filters('thematic_post', $post);
  937. }
  938. } // end content
  939. if (function_exists('childtheme_override_archivesopen')) {
  940. /**
  941. * @ignore
  942. */
  943. function thematic_archivesopen() {
  944. childtheme_override_archivesopen();
  945. }
  946. } else {
  947. /**
  948. * Open the list of archived posts in the page template Archives Page
  949. *
  950. * Override: childtheme_override_archivesopen
  951. */
  952. function thematic_archivesopen() { ?>
  953. <ul id="archives-page" class="xoxo">
  954. <?php }
  955. } // end archivesopen
  956. add_action('thematic_archives', 'thematic_archivesopen', 1);
  957. if (function_exists('childtheme_override_category_archives')) {
  958. /**
  959. * @ignore
  960. */
  961. function thematic_category_archives() {
  962. childtheme_override_category_archives();
  963. }
  964. } else {
  965. /**
  966. * Display category archives
  967. *
  968. * Added to the archive list on the page template Archives Page
  969. *
  970. * Override: childtheme_override_category_archives
  971. */
  972. function thematic_category_archives() { ?>
  973. <li id="category-archives" class="content-column">
  974. <h2><?php _e('Archives by Category', 'thematic') ?></h2>
  975. <ul>
  976. <?php wp_list_categories( array ( 'feed' => 'RSS',
  977. 'title_li' => '',
  978. 'show_count' => true ) );
  979. ?>
  980. </ul>
  981. </li>
  982. <?php }
  983. } // end category_archives
  984. add_action('thematic_archives', 'thematic_category_archives', 3);
  985. if (function_exists('childtheme_override_monthly_archives')) {
  986. /**
  987. * @ignore
  988. */
  989. function thematic_monthly_archives() {
  990. childtheme_override_monthly_archives();
  991. }
  992. } else {
  993. /**
  994. * Display monthly archives
  995. *
  996. * Added to the archive list on the page template Archives Page
  997. *
  998. * Override: childtheme_override_monthly_archives
  999. */
  1000. function thematic_monthly_archives() { ?>
  1001. <li id="monthly-archives" class="content-column">
  1002. <h2><?php _e('Archives by Month', 'thematic') ?></h2>
  1003. <ul>
  1004. <?php wp_get_archives(array('type' => 'monthly',
  1005. 'show_post_count' => true )); ?>
  1006. </ul>
  1007. </li>
  1008. <?php }
  1009. } // end monthly_archives
  1010. add_action('thematic_archives', 'thematic_monthly_archives', 5);
  1011. if (function_exists('childtheme_override_archivesclose')) {
  1012. /**
  1013. * @ignore
  1014. */
  1015. function thematic_archivesclose() {
  1016. childtheme_override_archivesclose();
  1017. }
  1018. } else {
  1019. /**
  1020. * Close the archive list used in the page template Archives Page
  1021. *
  1022. * Override: childtheme_override_archivesclose
  1023. */
  1024. function thematic_archivesclose() { ?>
  1025. </ul>
  1026. <?php }
  1027. } // end _archivesclose
  1028. add_action('thematic_archives', 'thematic_archivesclose', 9);
  1029. /**
  1030. * Register action hook: thematic_404
  1031. *
  1032. * Located in 404.php
  1033. */
  1034. function thematic_404() {
  1035. do_action('thematic_404');
  1036. } // end thematic_404
  1037. if ( function_exists('childtheme_override_404_content') ) {
  1038. /**
  1039. * @ignore
  1040. */
  1041. function thematic_404_content() {
  1042. childtheme_override_404_content();
  1043. }
  1044. } else {
  1045. /**
  1046. * Create the content for the 404 Error page
  1047. *
  1048. * Located in 404.php
  1049. * Override: childtheme_override_404_content
  1050. */
  1051. function thematic_404_content() { ?>
  1052. <?php thematic_postheader(); ?>
  1053. <div class="entry-content">
  1054. <p><?php _e( 'Apologies, but we were unable to find what you were looking for. Perhaps searching will help.', 'thematic' ) ?></p>
  1055. </div><!-- .entry-content -->
  1056. <form id="error404-searchform" method="get" action="<?php echo home_url(); ?>/">
  1057. <div>
  1058. <input id="error404-s" name="s" type="text" value="<?php the_search_query(); ?>" size="40" />
  1059. <input id="error404-searchsubmit" name="searchsubmit" type="submit" value="<?php esc_attr_e( 'Find', 'thematic' ); ?>" />
  1060. </div>
  1061. </form>
  1062. <?php }
  1063. } // end 404_content
  1064. add_action( 'thematic_404','thematic_404_content' );
  1065. /**
  1066. * Create the $more_link_text for the_content
  1067. *
  1068. * Used on posts that are divided using the more tag in post editor
  1069. *
  1070. * Filter: more_text
  1071. *
  1072. */
  1073. function thematic_more_text() {
  1074. /* translators: %s is right angle brackets */
  1075. $content = sprintf ( __('Read More %s', 'thematic'), ' <span class="meta-nav">&raquo;</span>');
  1076. return apply_filters('more_text', $content);
  1077. } // end thematic_more_text
  1078. /**
  1079. * Create the arguments for wp_list_bookmarks in links.php
  1080. *
  1081. * Filter: list_bookmarks_args
  1082. *
  1083. */
  1084. function thematic_list_bookmarks_args() {
  1085. $content = array ( 'title_before' => '<h2>',
  1086. 'title_after' => '</h2>');
  1087. return apply_filters('list_bookmarks_args', $content);
  1088. } // end thematic_list_bookmarks_args
  1089. if (function_exists('childtheme_override_postfooter')) {
  1090. /**
  1091. * @ignore
  1092. */
  1093. function thematic_postfooter() {
  1094. childtheme_override_postfooter();
  1095. }
  1096. } else {
  1097. /**
  1098. * Create the post footer
  1099. *
  1100. * Override: childtheme_override_postfooter <br>
  1101. * Filter: thematic_postfooter
  1102. */
  1103. function thematic_postfooter() {
  1104. $post_type = get_post_type();
  1105. $post_type_obj = get_post_type_object($post_type);
  1106. // Check for "Page" post-type and logged in user to show edit link
  1107. if ( $post_type == 'page' && current_user_can('edit_posts') ) {
  1108. $postfooter = '<footer class="entry-utility">' . thematic_postfooter_posteditlink();
  1109. $postfooter .= "</footer><!-- .entry-utility -->\n";
  1110. // Display nothing for logged out users on a "Page" post-type
  1111. } elseif ( $post_type == 'page' ) {
  1112. $postfooter = '';
  1113. // For post-types other than "Pages" press on
  1114. } else {
  1115. $postfooter = '<footer class="entry-utility">';
  1116. if ( is_single() ) {
  1117. $post_type_archive_link = ( function_exists( 'get_post_type_archive_link' ) ? get_post_type_archive_link( $post_type ) : home_url( '/?post_type=' . $post_type ) );
  1118. if ( thematic_is_custom_post_type() && $post_type_obj->has_archive ) {
  1119. /* translators: %s is custom post type singular name, wrapped in link tags */
  1120. $postfooter .= sprintf( __( 'Browse the %s archive.', 'thematic' ),
  1121. /* translators: %s is custom post type singular name */
  1122. ' <a href="' . $post_type_archive_link . '" title="' . sprintf( esc_attr__( 'Permalink to %s Archive', 'thematic' ), $post_type_obj->labels->singular_name ) . '">' . $post_type_obj->labels->singular_name . '</a>'
  1123. );
  1124. $postfooter .= ' ';
  1125. }
  1126. $postfooter .= thematic_postfooter_posttax();
  1127. $postfooter .= sprintf( _x('Bookmark the %1$spermalink%2$s.', '1s and 2s are the a href link wrappers, do not reverse them', 'thematic'), sprintf('<a title="%s" href="%s">', sprintf( esc_attr__('Permalink to %s', 'thematic'), the_title_attribute( 'echo=0' ) ), apply_filters('the_permalink', get_permalink())) , '</a>') . ' ';
  1128. if ( post_type_supports( $post_type, 'comments') ) {
  1129. $postfooter .= thematic_postfooter_postconnect();
  1130. }
  1131. } elseif ( post_type_supports( $post_type, 'comments') ) {
  1132. $postfooter .= thematic_postfooter_posttax();
  1133. $postfooter .= thematic_postfooter_postcomments();
  1134. }
  1135. // Display edit link
  1136. if (current_user_can('edit_posts')) {
  1137. if ( !is_single() && post_type_supports( $post_type, 'comments') ) {
  1138. $postfooter .= "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-edit">|</span> ';
  1139. }
  1140. $postfooter .= ' ' . thematic_postfooter_posteditlink();
  1141. }
  1142. $postfooter .= "\n\n\t\t\t\t\t</footer><!-- .entry-utility -->\n";
  1143. }
  1144. // Put it on the screen
  1145. echo apply_filters( 'thematic_postfooter', $postfooter ); // Filter to override default post footer
  1146. }
  1147. } // end postfooter
  1148. if (function_exists('childtheme_override_postfooter_posteditlink')) {
  1149. /**
  1150. * @ignore
  1151. */
  1152. function thematic_postfooter_posteditlink() {
  1153. return childtheme_override_postfooter_posteditlink();
  1154. }
  1155. } else {
  1156. /**
  1157. * Create the post edit link for the post footer
  1158. *
  1159. * Override: childtheme_override_postfooter_posteditlink <br>
  1160. * Filter: thematic_postfooter_posteditlink
  1161. */
  1162. function thematic_postfooter_posteditlink() {
  1163. $posteditlink = sprintf( '<a href="%s" title="%s" class="edit">%s</a>' ,
  1164. get_edit_post_link(),
  1165. esc_attr__('Edit post', 'thematic'),
  1166. /* translators: post edit link */
  1167. __('Edit', 'thematic'));
  1168. return apply_filters('thematic_postfooter_posteditlink',$posteditlink);
  1169. }
  1170. } // end postfooter_posteditlink
  1171. if (function_exists('childtheme_override_postfooter_posttax')) {
  1172. /**
  1173. * @ignore
  1174. */
  1175. function thematic_postfooter_posttax() {
  1176. return childtheme_override_postfooter_posttax();
  1177. }
  1178. } else {
  1179. /**
  1180. * Create the taxonomy list for the post footer
  1181. *
  1182. * Lists categories, tags, and custom taxonomies
  1183. *
  1184. * Override: childtheme_override_postfooter_posttax <br>
  1185. * Filter: thematic_postfooter_posttax
  1186. */
  1187. function thematic_postfooter_posttax() {
  1188. $post_type_tax = get_post_taxonomies();
  1189. $post_tax_list = '';
  1190. if ( isset($post_type_tax) && $post_type_tax ) {
  1191. foreach ( $post_type_tax as $tax ) {
  1192. if ($tax == 'category') {
  1193. $post_tax_list .= thematic_postfooter_postcategory();
  1194. } elseif ($tax == 'post_tag') {
  1195. $post_tax_list .= thematic_postfooter_posttags();
  1196. } else {
  1197. $post_tax_list .= thematic_postfooter_postterms($tax);
  1198. }
  1199. }
  1200. }
  1201. return apply_filters('thematic_postfooter_posttax',$post_tax_list); // Filter for default post terms
  1202. }
  1203. }
  1204. if (function_exists('childtheme_override_postfooter_postterms')) {
  1205. /**
  1206. * @ignore
  1207. */
  1208. function thematic_postfooter_postterms($tax) {
  1209. return childtheme_override_postfooter_postterms($tax);
  1210. }
  1211. } else {
  1212. /**
  1213. * Create the list of custom taxonomy terms for post footer
  1214. *
  1215. * Override: childtheme_override_postfooter_postterms($tax) <br>
  1216. * Filter: thematic_postfooter_postterms
  1217. *
  1218. * @param string $tax The taxonomy that the terms will be fetched from
  1219. */
  1220. function thematic_postfooter_postterms($tax) {
  1221. global $post;
  1222. if ($tax == 'post_format') {
  1223. return;
  1224. }
  1225. $tax_terms = '';
  1226. $tax_obj = get_taxonomy($tax);
  1227. if ( wp_get_object_terms($post->ID, $tax) ) {
  1228. $term_list = get_the_term_list( 0, $tax, '' , ', ', '' );
  1229. $tax_terms = '<span class="' . $tax . '-links">';
  1230. if ( strpos( $term_list, ',' ) ) {
  1231. $tax_terms .= $tax_obj->labels->name . ': ';
  1232. } else {
  1233. $tax_terms .= $tax_obj->labels->singular_name . ': ';
  1234. }
  1235. $tax_terms .= $term_list;
  1236. if ( is_single() ) {
  1237. $tax_terms .= '. ';
  1238. $tax_terms .= '</span>';
  1239. } else {
  1240. $tax_terms .= '</span>' . "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-tag-links">|</span> ';
  1241. }
  1242. }
  1243. return apply_filters('thematic_postfooter_postterms', $tax_terms ); // Filter for custom taxonomy terms
  1244. }
  1245. }
  1246. if (function_exists('childtheme_override_postfooter_postcategory')) {
  1247. /**
  1248. * @ignore
  1249. */
  1250. function thematic_postfooter_postcategory() {
  1251. return childtheme_override_postfooter_postcategory();
  1252. }
  1253. } else {
  1254. /**
  1255. * Create the category list for post footer
  1256. *
  1257. * Override: childtheme_override_postfooter_postcategory <br>
  1258. * Filter: thematic_postfooter_postcategory
  1259. */
  1260. function thematic_postfooter_postcategory() {
  1261. $postcategory = "\n\n\t\t\t\t\t\t" . '<span class="cat-links">';
  1262. if (is_single()) {
  1263. /* translators: %s is postfooter categories */
  1264. $postcategory .= sprintf( __('This entry was posted in %s', 'thematic'), get_the_category_list(', ') );
  1265. $postcategory .= '</span>';
  1266. $posttags = get_the_tags();
  1267. if ( !$posttags ) {
  1268. $postcategory .= '. ';
  1269. } else {
  1270. //$postcategory .= ' ';
  1271. }
  1272. } elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */
  1273. /* translators: %s is postfooter categories */
  1274. $postcategory .= sprintf( __('Also posted in %s', 'thematic'), $cats_meow );
  1275. $postcategory .= '</span>' . "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-tag-links">|</span> ';
  1276. } else {
  1277. /* translators: %s is postfooter categories */
  1278. $postcategory .= sprintf( __('Posted in %s', 'thematic'), get_the_category_list(', ') );
  1279. $postcategory .= '</span>' . "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-tag-links">|</span> ';
  1280. }
  1281. return apply_filters('thematic_postfooter_postcategory',$postcategory);
  1282. }
  1283. } // end postfooter_postcategory
  1284. if (function_exists('childtheme_override_postfooter_posttags')) {
  1285. /**
  1286. * @ignore
  1287. */
  1288. function thematic_postfooter_posttags() {
  1289. return childtheme_override_postfooter_posttags();
  1290. }
  1291. } else {
  1292. /**
  1293. * Create the tags list for post footer
  1294. *
  1295. * Override: childtheme_override_postfooter_posttags <br>
  1296. * Filter: thematic_postfooter_posttags
  1297. */
  1298. function thematic_postfooter_posttags() {
  1299. if ( is_single() && !is_object_in_taxonomy( get_post_type(), 'category' ) ) {
  1300. $tagtext = __('This entry is tagged', 'thematic') . ' ';
  1301. $posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>. ');
  1302. } elseif ( is_single() ) {
  1303. $tagtext = __('and tagged', 'thematic') . ' ';
  1304. $posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>. ');
  1305. } elseif ( is_tag() && $tag_ur_it = thematic_tag_ur_it(', ') ) { /* Returns tags other than the one queried */
  1306. $posttags = '<span class="tag-links">' . __('Also tagged', 'thematic') . ' ' . $tag_ur_it . '</span>' . "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-comments-link">|</span> ';
  1307. } else {
  1308. $tagtext = __('Tagged', 'thematic') . ' ';
  1309. $posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>' . "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-comments-link">|</span> ');
  1310. }
  1311. return apply_filters('thematic_postfooter_posttags',$posttags);
  1312. }
  1313. } // end postfooter_posttags
  1314. if (function_exists('childtheme_override_postfooter_postcomments')) {
  1315. /**
  1316. * @ignore
  1317. */
  1318. function thematic_postfooter_postcomments() {
  1319. return childtheme_override_postfooter_postcomments();
  1320. }
  1321. } else {
  1322. /**
  1323. * Create the comments link for the post footer on archive pages
  1324. *
  1325. * Override: childtheme_override_postfooter_postcomments <br>
  1326. * Filter: thematic_postfooter_postcomments
  1327. */
  1328. function thematic_postfooter_postcomments() {
  1329. if (comments_open()) {
  1330. $postcommentnumber = get_comments_number();
  1331. if ($postcommentnumber > '0') {
  1332. $postcomments = sprintf('<span class="comments-link"><a href="%s" title="%s" rel="bookmark">%s</a></span>',
  1333. apply_filters('the_permalink', get_permalink()) . '#respond',
  1334. sprintf( esc_attr__('Comment on %s', 'thematic'), the_title_attribute( 'echo=0' ) ),
  1335. /* translators: number of comments and trackbacks */
  1336. sprintf( _n('%s Response', '%s Responses', $postcommentnumber, 'thematic'), number_format_i18n( $postcommentnumber ) ) );
  1337. } else {
  1338. $postcomments = sprintf('<span class="comments-link"><a href="%s" title="%s" rel="bookmark">%s</a></span>',
  1339. apply_filters('the_permalink', get_permalink()) . '#respond',
  1340. sprintf( esc_attr__('Comment on %s', 'thematic'), the_title_attribute( 'echo=0' ) ),
  1341. __('Leave a comment', 'thematic'));
  1342. }
  1343. } else {
  1344. $postcomments = '<span class="comments-link comments-closed-link">' . __('Comments closed', 'thematic') .'</span>';
  1345. }
  1346. return apply_filters('thematic_postfooter_postcomments',$postcomments);
  1347. }
  1348. } // end postfooter_postcomments
  1349. if (function_exists('childtheme_override_postfooter_postconnect')) {
  1350. /**
  1351. * @ignore
  1352. */
  1353. function thematic_postfooter_postconnect() {
  1354. return childtheme_override_postfooter_postconnect();
  1355. }
  1356. } else {
  1357. /**
  1358. * Create the comments link for the post footer on single posts
  1359. *
  1360. * Override: childtheme_override_postfooter_postconnect <br>
  1361. * Filter: thematic_postfooter_postconnect
  1362. */
  1363. function thematic_postfooter_postconnect() {
  1364. if ((comments_open()) && (pings_open())) { /* Comments are open */
  1365. $postconnect = sprintf( _x('%1$sPost a comment%2$s or leave a trackback: %3$s', '1s and 2s are the a href link wrappers, do not reverse them. 3s is trackback url.', 'thematic'),
  1366. sprintf('<a class="comment-link" title="%s" href="#respond">', esc_attr__('Post a comment', 'thematic')),
  1367. '</a>' ,
  1368. sprintf('<a class="trackback-link" href="%s" title ="%s" rel="trackback">%s</a>.',
  1369. get_trackback_url(),
  1370. esc_attr__('Trackback URL for your post', 'thematic'),
  1371. __('Trackback URL', 'thematic'))
  1372. );
  1373. } elseif (!(comments_open()) && (pings_open())) { /* Only trackbacks are open */
  1374. $postconnect = sprintf( _x('Comments are closed, but you can leave a trackback: %s', '%s is trackback url, wrapped in link tags', 'thematic'),
  1375. sprintf('<a class="trackback-link" href="%s" title="%s" rel="trackback">%s</a>.',
  1376. get_trackback_url(),
  1377. esc_attr__('Trackback URL for your post', 'thematic'),
  1378. __('Trackback URL', 'thematic'))
  1379. );
  1380. } elseif ((comments_open()) && !(pings_open())) { /* Only comments open */
  1381. $postconnect = sprintf( _x('Trackbacks are closed, but you can %1$spost a comment%2$s.', '1s and 2s are the a href link wrappers, do not reverse them', 'thematic'), sprintf('<a class="comment-link" title="%s" href="#respond">', esc_attr__('Post a comment', 'thematic')), '</a>');
  1382. } elseif (!(comments_open()) && !(pings_open())) { /* Comments and trackbacks closed */
  1383. $postconnect = __('Both comments and trackbacks are currently closed.', 'thematic');
  1384. }
  1385. return apply_filters('thematic_postfooter_postconnect',$postconnect);
  1386. }
  1387. } // end postfooter_postconnect
  1388. // Action to create the below navigation
  1389. if (function_exists('childtheme_override_nav_below')) {
  1390. /**
  1391. * @ignore
  1392. */
  1393. function thematic_nav_below() {
  1394. childtheme_override_nav_below();
  1395. }
  1396. } else {
  1397. /**
  1398. * Create the below navigation
  1399. *
  1400. * Provides compatibility with WP-PageNavi plugin
  1401. *
  1402. * Override: childtheme_override_nav_below
  1403. *
  1404. * @link http://wordpress.org/extend/plugins/wp-pagenavi/ WP-PageNavi Plugin Page
  1405. */
  1406. function thematic_nav_below() {
  1407. if ( is_single() ) { ?>
  1408. <nav id="nav-below" class="navigation" role="navigation">
  1409. <div class="nav-previous"><?php thematic_previous_post_link() ?></div>
  1410. <div class="nav-next"><?php thematic_next_post_link() ?></div>
  1411. </nav>
  1412. <?php
  1413. } else { ?>
  1414. <nav id="nav-below" class="navigation" role="navigation">
  1415. <?php if(function_exists('wp_pagenavi')) { ?>
  1416. <?php wp_pagenavi(); ?>
  1417. <?php } else { ?>

Large files files are truncated, but you can click here to view the full file