fixing search.php
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 Feb 2016 18:40:05 +0000 (13:40 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 Feb 2016 18:40:05 +0000 (13:40 -0500)
search.php

index 7c13e4f..61a5380 100644 (file)
             </div><!-- /#post-404 -->
             <?php endif;?>
         </div>
+        <div id="blog-side-info-wrapper" class="small-11 small-only-text-center medium-3 columns">
+            <div id="blog-side-info">
+                <form id="searchform" action="<?php bloginfo('url'); ?>" method="get">
+                    <div><input id="s" class="text" type="text" name="s" value="" />
+                    <input class="submit blogbutton" type="submit" name="submit" value="Search" />
+                    <input type="hidden" name="searchType" value="blog" /> </div>
+                </form>
+                <p>Recent Posts</p>
+                <ul>
+                <?php
+                        $args = array( 'numberposts' => '5' );
+                        $recent_posts = wp_get_recent_posts( $args );
+                        foreach( $recent_posts as $recent ){
+                                echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </li> ';
+                        }
+                ?>
+                </ul>
+                <p>Archive</p>
+                <ul><?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12 ) ); ?></ul>
+                <p>Categories</p>
+                <ul>
+                    <?php
+                    $args = array(
+                    'orderby' => 'name',
+                    'order' => 'ASC'
+                    );
+                  $categories = get_categories($args);
+                    foreach($categories as $category) {
+                      echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  }
+                    ?>
+                </ul>
+            </div>
+            <?php } ?> <!-- end empty query check -->
+        </div>
     </div>
     <?php get_footer(); ?>