Guest User

Search page

a guest
Jul 6th, 2016
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.86 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The main template file
  4.  *
  5.  * This is the most generic template file in a WordPress theme
  6.  * and one of the two required files for a theme (the other being style.css).
  7.  * It is used to display a page when nothing more specific matches a query.
  8.  * E.g., it puts together the home page when no home.php file exists.
  9.  *
  10.  * @link http://codex.wordpress.org/Template_Hierarchy
  11.  *
  12.  * @package WordPress
  13.  * @subpackage Twenty_Sixteen
  14.  * @since Twenty Sixteen 1.0
  15.  */
  16.  
  17. get_header(); ?>
  18.  
  19. <div id="primary" class="content-area">
  20.  
  21.     <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  22.         <label>
  23.             <span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'twentysixteen' ); ?></span>
  24.             <input type="hidden" name="post_type" value="charity_directory" />
  25.             <input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentysixteen' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
  26.         </label>
  27.         <?php
  28.  
  29.         wp_dropdown_categories(
  30.             array(
  31.                 'name' => 'cat_charities',
  32.                 'taxonomy' => 'zdca-cat-charities',
  33.                 'hide_if_empty' => 0,
  34.                 'show_option_all'=>'All ',
  35.                 'hierarchical' => 1,
  36.                 'hide_empty' => 0));
  37.        /* wp_dropdown_categories(
  38.             array(
  39.                 'name' => 'demographic_charities',
  40.                 'taxonomy' => 'zdca-demographic-charities',
  41.                 'hide_if_empty' => 0,
  42.                 'show_option_all'=>'All ',
  43.                 'hierarchical' => 1,
  44.                 'hide_empty' => 0));
  45.         wp_dropdown_categories(
  46.             array(
  47.                 'name' => 'intention_charities',
  48.                 'taxonomy' => 'zdca-intention-charities',
  49.                 'hide_if_empty' => 0,
  50.                 'show_option_all'=>'All ',
  51.                 'hierarchical' => 1,
  52.                 'hide_empty' => 0));
  53.         wp_dropdown_categories(
  54.             array(
  55.                 'name' => 'community_focus_charities',
  56.                 'taxonomy' => 'zdca-community-focus-charities',
  57.                 'hide_if_empty' => 0,
  58.                 'show_option_all'=>'All ',
  59.                 'hierarchical' => 1,
  60.                 'hide_empty' => 0));*/
  61.  
  62.         ?>
  63.         <button type="submit" class="search-submit"><span class="screen-reader-text"><?php echo _x( 'Search', 'submit button', 'twentysixteen' ); ?></span></button>
  64.     </form>
  65.  
  66.  
  67.     <main id="main" class="site-main" role="main">
  68.  
  69.         <?php if ( have_posts() ) : ?>
  70.  
  71.             <?php
  72.             // Start the loop.
  73.             while ( have_posts() ) : the_post();
  74.  
  75.                 /*
  76.                  * Include the Post-Format-specific template for the content.
  77.                  * If you want to override this in a child theme, then include a file
  78.                  * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  79.                  */
  80.                 get_template_part( 'template-parts/content', get_post_format() );
  81.  
  82.                 // End the loop.
  83.             endwhile;
  84.  
  85.             // Previous/next page navigation.
  86.             the_posts_pagination( array(
  87.                 'prev_text'          => __( 'Previous page', 'twentysixteen' ),
  88.                 'next_text'          => __( 'Next page', 'twentysixteen' ),
  89.                 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
  90.             ) );
  91.  
  92.         // If no content, include the "No posts found" template.
  93.         else :
  94.             get_template_part( 'template-parts/content', 'none' );
  95.  
  96.         endif;
  97.         ?>
  98.  
  99.     </main><!-- .site-main -->
  100. </div><!-- .content-area -->
  101.  
  102. <?php get_sidebar(); ?>
  103. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment