[wptest-www: 3/27] change home page to show 940x240 banner followed by title and headline
- From: Andrea Veri <av src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [wptest-www: 3/27] change home page to show 940x240 banner followed by title and headline
- Date: Sun, 12 Feb 2012 21:44:37 +0000 (UTC)
commit 2440d865b99cf2e9b3ca582646a9fa883a40ff24
Author: Vinicius Depizzol <vdepizzol gmail com>
Date: Tue Sep 27 18:33:51 2011 -0300
change home page to show 940x240 banner followed by title and headline
theme/functions.php | 9 ++++---
theme/page-home.php | 56 +++++++++++++++++++++++++++++---------------------
2 files changed, 37 insertions(+), 28 deletions(-)
---
diff --git a/theme/functions.php b/theme/functions.php
index 4e670b0..f669f31 100644
--- a/theme/functions.php
+++ b/theme/functions.php
@@ -4,6 +4,7 @@
* @subpackage Default_Theme
*/
+
add_editor_style("editor_style.css");
/*
@@ -23,7 +24,7 @@ if (is_admin ()) {
}
-set_post_thumbnail_size(940, 320);
+set_post_thumbnail_size(940, 240);
/*
* Media sizes for applications icons
@@ -45,7 +46,7 @@ add_image_size( 'thumbnail-small', 120, 80, false);
add_action( 'init', function() {
- register_post_type( 'banner',
+ register_post_type( 'banners',
array(
'labels' => array(
'name' => 'Banners',
@@ -62,12 +63,12 @@ add_action( 'init', function() {
'not_found_in_trash' => 'No banners found in Trash',
'parent' => 'Parent Banner',
),
- 'public' => false,
+ 'public' => true,
'exclude_from_search' => true,
'supports' => array(
'title', 'thumbnail', 'excerpt', 'revisions', 'author'
),
- 'rewrite' => false
+ 'rewrite' => true
)
);
diff --git a/theme/page-home.php b/theme/page-home.php
index 7dd966c..b057543 100644
--- a/theme/page-home.php
+++ b/theme/page-home.php
@@ -16,34 +16,42 @@ 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 banner -->
- <div id="home_banner">
- <?php
- while ( have_posts() ) : the_post();
- $home_link = get_post_meta($post->ID, 'link', true);
- if($home_link != '') { echo '<a href="'.$home_link.'">'; }
- the_post_thumbnail(array(940, 320), 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">
<div class="container_12">
+
+ <div class="grid_12">
+
+ <?php
+
+ $temp_query = clone $wp_query;
+
+ query_posts(array('post_type' => 'banners', 'posts_per_page' => 1));
+
+ ?>
+
+ <!-- home banner -->
+ <div id="home_banner">
+ <?php
+ while ( have_posts() ) : the_post();
+
+ $home_link = get_post_meta($post->ID, 'link', true);
+ if($home_link != '') { echo '<a href="'.$home_link.'">'; }
+ the_post_thumbnail(array(940, 240), array('alt' => get_the_excerpt($post->ID), 'title' => get_the_title($post->ID)));
+ if($home_link != '') { echo '</a>'; }
+
+ ?>
+ <h2><?php the_title(); ?></h2>
+ <p class="main_feature"><?php the_excerpt(); ?></p>
+ <?php endwhile; ?>
+ </div>
+
+ <?php
+ $wp_query = clone $temp_query;
+ ?>
+
+ </div>
<div class="grid_12">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]