PageRenderTime 46ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/eclipse/core/actions/search-actions.php

https://github.com/Bochet/festival_lgbt
PHP | 82 lines | 36 code | 20 blank | 26 comment | 6 complexity | d67aa3030245aff7d589ae2e5d30cc40 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * Search actions used by response.
  4. *
  5. * Author: Tyler Cunningham
  6. * Copyright: Š 2012
  7. * {@link http://cyberchimps.com/ CyberChimps LLC}
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package response
  15. * @since 1.0
  16. */
  17. /**
  18. * response search actions
  19. */
  20. add_action( 'response_search', 'response_search_content' );
  21. /**
  22. * Search results output
  23. *
  24. * @since 1.0
  25. */
  26. function response_search_content() {
  27. global $options, $ec_themeslug;
  28. $results = apply_filters( 'response_search_results_message', 'Search Results For: %s' );
  29. $noresults = apply_filters( 'response_no_search_results_message', 'No posts found.' ); ?>
  30. <div id="content_left">
  31. <div class="content_padding">
  32. <?php if (have_posts()) : ?>
  33. <h3><?php printf( $results, '<span>' . get_search_query() . '</span>' ); ?></h3><br />
  34. <?php while (have_posts()) : the_post(); ?>
  35. <div class="post_container">
  36. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  37. <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  38. <?php get_template_part('meta', 'search' ); ?>
  39. <div class="entry">
  40. <?php
  41. if ($options->get($ec_themeslug.'_search_show_excerpts') == '1') {
  42. the_excerpt();
  43. }
  44. else {
  45. the_content();
  46. }
  47. ?>
  48. </div>
  49. </div>
  50. </div><!--end post_container-->
  51. <?php endwhile; ?>
  52. <?php response_pagination(); ?>
  53. <?php else : ?>
  54. <h2><?php echo $noresults; ?></h2>
  55. <?php endif; ?>
  56. </div><!--end content_padding-->
  57. </div><!--end content_left--><?php
  58. }
  59. /**
  60. * End
  61. */
  62. ?>