[gnomeweb-wp] Changes in single.php to separate the code according to the post type.



commit e0362ae3db1044a2c0f610813ae9eb3fb08764b3
Author: Vinicius Depizzol <vdepizzol gmail com>
Date:   Thu Sep 9 01:32:06 2010 -0300

    Changes in single.php to separate the code according to the post type.

 wp-content/themes/gnome-grass/news.php   |   44 +++++++++++++++++++++++++++
 wp-content/themes/gnome-grass/single.php |   48 ++++++++---------------------
 2 files changed, 57 insertions(+), 35 deletions(-)
---
diff --git a/wp-content/themes/gnome-grass/news.php b/wp-content/themes/gnome-grass/news.php
new file mode 100644
index 0000000..85a483b
--- /dev/null
+++ b/wp-content/themes/gnome-grass/news.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package GNOME Website
+ * @subpackage Grass Theme
+ */
+
+require_once("header.php"); ?>
+
+    <!-- container -->
+    <div id="container" class="two_columns">
+        <div class="container_12">
+        
+            <div class="page_title">
+                <h1><a href="#">News</a></h1>
+            </div>
+            
+            <div class="content">
+            <?php while ( have_posts() ) : the_post(); ?>
+                <div class="news_title">
+                    <p class="date"><?php the_date(); ?></p>
+                    <h1><?php the_title(); ?></h1>
+                </div>
+                <?php the_content(); ?>
+            <?php endwhile; // End the loop. Whew. ?>
+                <br />
+                <div class="clear"></div>
+            </div>
+            
+            <div class="sidebar">
+                
+                    <p>For more GNOME news, check out the <a href="#">Planet GNOME</a>.</p>
+                    
+                    <p>FIXME</p>
+                      
+            </div>
+            <?php require_once("footer_art.php"); ?>
+        </div>
+    </div>
+    
+    <div class="clearfix"></div>
+    
+    <?php require_once("footer.php"); ?>
+</body>
+</html>
diff --git a/wp-content/themes/gnome-grass/single.php b/wp-content/themes/gnome-grass/single.php
index 0067373..deb95d7 100644
--- a/wp-content/themes/gnome-grass/single.php
+++ b/wp-content/themes/gnome-grass/single.php
@@ -4,41 +4,19 @@
  * @subpackage Grass Theme
  */
 
-require_once("header.php"); ?>
 
-    <!-- container -->
-    <div id="container" class="two_columns">
-        <div class="container_12">
-        
-            <div class="page_title">
-                <h1><a href="#">News</a></h1>
-            </div>
-            
-            <div class="content">
-            <?php while ( have_posts() ) : the_post(); ?>
-                <div class="news_title">
-                    <p class="date"><?php the_date(); ?></p>
-                    <h1><?php the_title(); ?></h1>
-                </div>
-                <?php the_content(); ?>
-            <?php endwhile; // End the loop. Whew. ?>
-                <br />
-                <div class="clear"></div>
-            </div>
-            
-            <div class="sidebar">
-                
-                    <p>For more GNOME news, check out the <a href="#">Planet GNOME</a>.</p>
-                    
-                    <p>There's also a </p>
-                      
-            </div>
-            <?php require_once("footer_art.php"); ?>
-        </div>
-    </div>
+$post_type = get_post_type();
+
+if($post_type == 'post') {
+
+    require_once('news.php');
     
-    <div class="clearfix"></div>
+} elseif($post_type == 'banner') {
+
+    //require_once('banner.php');
+    echo 'FIXME';
     
-    <?php require_once("footer.php"); ?>
-</body>
-</html>
+}
+
+
+?>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]