Add recent Press Release sidebar to its category display
authorLaury GvR <laury@gaslightmedia.com>
Tue, 20 Aug 2019 23:17:42 +0000 (19:17 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 20 Aug 2019 23:17:42 +0000 (19:17 -0400)
archive.php
home.php
parts/blog-sidebar-r.php
single.php

index 291e50c..5d1ce27 100644 (file)
             </div><!-- /#post-404 -->
             <?php endif;?>
         </div>
-        <?php 
-            if ( !is_category(219) ) {
-                get_template_part('parts/blog-sidebar-r');
-            }
-        ?>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
     </div>
     <?php get_footer(); ?>
index 9b134ff..64fa5f7 100644 (file)
--- a/home.php
+++ b/home.php
                 </div><!-- /#post-404 -->
                 <?php endif;?>
             </div>
-            <?php 
-                if ( !is_category(219) ) {
-                    get_template_part('parts/blog-sidebar-r'); 
-                }
-            ?>
+            <?php get_template_part('parts/blog-sidebar-r'); ?>
         </div>
         <?php get_footer(); ?>
 
index 3b0629a..e99e1a3 100644 (file)
@@ -1,5 +1,17 @@
         <div id="blog-side-info-wrapper" class="small-11 small-only-text-center medium-3 columns">
             <div id="blog-side-info">
+              <?php if ( is_category(219) ) { ?>
+                <p>Recent Releases</p>
+                <ul>
+                <?php
+                    $args = array( 'numberposts' => '5', 'post_status' => 'publish', 'category' => 219 );
+                    $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>
+              <?php } else { ?>
                 <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" />
@@ -35,4 +47,5 @@
                 </ul>
                
             </div>
+          <?php } ?>
         </div>
\ No newline at end of file
index 5cb8666..74f935f 100644 (file)
@@ -61,9 +61,7 @@
             </div><!-- /#post-404 -->
             <?php endif;?>
         </div>
-        <?php if (!is_post_type("ai1ec_event")) { ?>
-            <?php get_template_part('parts/blog-sidebar-r'); ?>
-        <?php } ?>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
 
     </div>
     <?php get_footer(); ?>