Skip to content

Commit

Permalink
New: Enable single column for posts on Homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
nullin committed Jul 30, 2010
1 parent e35ed1d commit 9977038
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 35 deletions.
1 change: 1 addition & 0 deletions README
Expand Up @@ -10,6 +10,7 @@ Release Notes
* Change: Moved open/close navigation button below the nav bar and made it's position absolute
* Removed: Suckerfish plugin support
* New: Enable use of WP 3.0 menus
* New: Enable single column for posts on Homepage

### v1.7.1 (7/25/2010)

Expand Down
24 changes: 11 additions & 13 deletions functions.php
Expand Up @@ -37,7 +37,7 @@ function get_excerpt(){
}

// If they've manually put in an excerpt, and allowed it to be used let it go!
if ($post->post_excerpt && $hemingwayEx_options['use_WP_excerpt']!=0) {
if ($post->post_excerpt && $hemingwayEx_options['use_WP_excerpt'] != 0) {
return $post->post_excerpt;
}
// Check to see if it's a password protected post
Expand Down Expand Up @@ -83,8 +83,7 @@ function get_excerpt(){
'paging_enabled' => 0,
'use_WP_excerpt' => 1,
'reddit_button'=> 0,
'drop-down'=> 0,
'nav_categories'=> 0,
'homepage_layout'=> 0,
);
if (!get_option('hem_version') || get_option('hem_version') < $hemingwayEx->version){
// HemingwayEx isn't installed, so we'll need to add options
Expand Down Expand Up @@ -148,8 +147,7 @@ function menu() {
$hemingwayEx_options['paging_enabled'] = $_POST['paging_enabled'];
$hemingwayEx_options['use_WP_excerpt'] = $_POST['use_WP_excerpt'];
$hemingwayEx_options['reddit_button'] = $_POST['reddit_button'];
$hemingwayEx_options['drop-down'] = $_POST['drop-down'];
$hemingwayEx_options['nav_categories'] = $_POST['nav_categories'];
$hemingwayEx_options['homepage_layout'] = $_POST['homepage_layout'];
update_option('hem_options', $hemingwayEx_options);

wp_cache_flush();
Expand Down Expand Up @@ -195,9 +193,16 @@ function menu() {
</select>
<input type="submit" value="Save" />
</form>
<h3><?php _e('Miscellaneous Options','hemingwayex') ?></h3>
<h3><?php _e('Layout Options','hemingwayex') ?></h3>
<form name="dofollow" action="" method="post">
<input type="hidden" name="misc_options" value="1" />
<h4><?php _e('Homepage Layout','hemingwayex') ?></h4>
<p>
<label><input type="radio" value="0" name="homepage_layout" <?php if ($hemingwayEx_options['homepage_layout'] == 0) echo "checked=\"checked\""; ?> /> <?php _e('Two columns, one post each','hemingwayex') ?></label>
</p>
<p>
<label><input type="radio" value="1" name="homepage_layout" <?php if ($hemingwayEx_options['homepage_layout'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Single column','hemingwayex') ?></label>
</p>
<h4><?php _e('Sidebars','hemingwayex') ?></h4>
<p>
<label><input type="checkbox" value="1" name="slidebar_enabled" <?php if ($hemingwayEx_options['slidebar_enabled'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Enable Slidebar','hemingwayex') ?></label>
Expand All @@ -221,13 +226,6 @@ function menu() {
<p>
<label><input type="checkbox" value="1" name="page_comments" <?php if ($hemingwayEx_options['page_comments'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Display comments section on static pages','hemingwayex') ?></label>
</p>
<h4><?php _e('Navigation Bar','hemingwayex') ?></h4>
<p>
<label><input type="checkbox" value="1" name="drop-down" <?php if ($hemingwayEx_options['drop-down'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Do you wish to have a drop-down menu on your navbar (useful if you have a lot of subpages)','hemingwayex') ?></label>
</p>
<p>
<label><input type="checkbox" value="1" name="nav_categories" <?php if ($hemingwayEx_options['nav_categories'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Should your categories be visible on the navbar as a drop-down list (only active if the drop-down option is active)','hemingwayex') ?></label>
</p>
<h4><?php _e('Misc Options','hemingwayex') ?></h4>
<p>
<label><input type="checkbox" value="1" name="international_dates" <?php if ($hemingwayEx_options['international_dates'] == 1) echo "checked=\"checked\""; ?> /> <?php _e('Use international dates? (day/month/year)','hemingwayex') ?></label>
Expand Down
33 changes: 18 additions & 15 deletions index.php
@@ -1,24 +1,26 @@
<?php get_header(); ?>
<div id="primary" class="twocol-stories">
<div id="primary" class="<?php if ($hemingwayEx_options['homepage_layout'] == 0) echo 'two'; else echo 'one'; ?>col-stories" >
<div class="inside">
<?php
// Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
//query_posts('showposts=2');
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('showposts=2'.'&paged='.$paged);
if ($hemingwayEx_options['homepage_layout'] == 0) {
// Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
//query_posts('showposts=2');
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('showposts=2'.'&paged='.$paged);
}
?>
<?php if ($wp_query->have_posts()) : ?>
<?php $first = true; ?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div class="story<?php if($first == true) echo " first" ?>">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','hemingwayex'),the_title()); ?>"><?php the_title(); ?></a></h3>
<?php if ($hemingwayEx_options['excerpt_enabled'] == 1){ ?>
<?php $hemingwayEx->excerpt() ?><span class="read-on"><a href="<?php the_permalink() ?>"><?php _e('read on','hemingwayex') ?></a></span>
<?php } else {
the_content('<p class="serif">'. __('Read the rest of this entry &raquo;','hemingwayex') .'</p>');
} ?>
<?php if ($hemingwayEx_options['excerpt_enabled'] == 1) { ?>
<?php $hemingwayEx->excerpt() ?><span class="read-on"><a href="<?php the_permalink() ?>"><?php _e('read on','hemingwayex') ?></a></span>
<?php } else {
the_content('<span class="read-on">'. __('read on','hemingwayex') .'</span>');
} ?>
<div class="details">
<?php _e('Posted at','hemingwayex') ?> <?php the_time('ga \o\n ' . $hemingwayEx->date_format(true) . '/y') ?> | <?php comments_popup_link(__('No Comments &#187;', 'hemingwayex'), __('1 Comment &#187;', 'hemingwayex'), __ngettext('% comment', '% comments', get_comments_number (), 'hemingwayex')); ?> | <?php _e('Filed Under: ','hemingwayex'); the_category(', ') ?>
<?php if ($hemingwayEx_options['excerpt_enabled'] == 0) { ?>
Expand All @@ -31,9 +33,10 @@
<?php if ($hemingwayEx_options['paging_enabled'] == 1) : ?>
<div class="clear"></div>
<div id="paging">
<?php previous_posts_link(' &nbsp;&laquo; ') ?>
<?php echo '&nbsp;' ?>
<?php next_posts_link(' &nbsp;Next &raquo;&nbsp; ') ?>
<?php previous_posts_link(' &nbsp;&laquo; ');
echo '&nbsp;';
next_posts_link(' &nbsp;Next &raquo;&nbsp; ');
?>
</div>
<?php endif; $wp_query = null; $wp_query = $temp; ?>
</div>
Expand Down
15 changes: 8 additions & 7 deletions style.css
@@ -1,9 +1,9 @@
/*
Theme Name: HemingwayEx
Theme URI: http://nalinmakar.com/hemingwayex
Description: HemingwayEx is a simple weblog theme by <a href="http://nalinmakar.com">NULL.in</a> and further modified by <a href="http://dbzer0.com">Db0</a> created by modifing the very popular <a href="http://warpspire.com/hemingway">Hemingway</a>. If you'd like to learn more about HemingwayEx, <a href="http://nalinmakar.com/hemingwayex">head on over to my site</a>.
Version: 1.7.1
Author: NULL.in
Description: HemingwayEx is a simple weblog theme by <a href="http://nalinmakar.com">Nalin Makar</a> and further modified by <a href="http://dbzer0.com">Db0</a> created by modifing the very popular <a href="http://warpspire.com/hemingway">Hemingway</a>. If you'd like to learn more about HemingwayEx, <a href="http://nalinmakar.com/hemingwayex">head on over to my site</a>.
Version: 1.8
Author: Nalin Makar
Author URI: http://nalinmakar.com
*/

Expand Down Expand Up @@ -197,7 +197,7 @@ table caption{
-----------------------------------------------------------------------------------------------*/
#silderButtonNav a{
display:block;
padding:3px 5px 5px 6px;
padding:3px;
font-size:.8em;
background:#393939;
color:#fff;
Expand All @@ -207,9 +207,9 @@ table caption{
text-decoration:none;
position:absolute;
width:80px;
min-height:12px;
min-height:10px;
height:auto !important;
height:12px;
height:10px;
top:25px;
right:5%;
text-align:center;
Expand Down Expand Up @@ -370,9 +370,10 @@ table caption{
padding:0.2em 0.2em 0.2em 1em;
margin:1em 5% 0 5%;
}
#paging{
#paging {
text-align:right;
margin-top:0.5em;
margin-bottom:1em;
}
#paging a {
border:1px solid #333;
Expand Down

0 comments on commit 9977038

Please sign in to comment.