[gnomeweb-wp] get banner from banner custom_post
- From: Vinicius Scopel Depizzol <vdepizzol src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnomeweb-wp] get banner from banner custom_post
- Date: Tue, 5 Apr 2011 00:25:34 +0000 (UTC)
commit 584704e750a71e948634db5ef3fd4e26a6531527
Author: Vinicius Depizzol <vdepizzol gmail com>
Date: Mon Apr 4 21:25:23 2011 -0300
get banner from banner custom_post
wp-content/themes/gnome-grass/page-home.php | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/wp-content/themes/gnome-grass/page-home.php b/wp-content/themes/gnome-grass/page-home.php
index 531380d..10342a4 100644
--- a/wp-content/themes/gnome-grass/page-home.php
+++ b/wp-content/themes/gnome-grass/page-home.php
@@ -8,12 +8,29 @@ add_action('wp_head', function() {
require_once("header.php"); ?>
+ <?php
+
+ $temp_query = clone $wp_query;
+
+ query_posts(array('post_type' => 'banner', 'posts_per_page' => 1));
+ $home_link = get_post_meta($post->ID, 'link', true);
+
+ ?>
<!-- home banner -->
<div id="home_banner">
- <img src="#" alt="" />
+ <?php
+ while ( have_posts() ) : the_post();
+ if($home_link != '') {echo '<a href="'.$home_link.'">'; }
+ the_post_thumbnail(array(940, 350), array('alt' => get_the_excerpt($post->ID), 'title' => get_the_title($post->ID)));
+ if($home_link != '') {echo '</a>'; }
+ endwhile;
+ ?>
</div>
+ <?php
+ $wp_query = clone $temp_query;
+ ?>
<!-- container -->
<div id="container" class="two_columns">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]