Skip to content

Commit

Permalink
add default post display primary theme option
Browse files Browse the repository at this point in the history
  • Loading branch information
marpa committed Jun 9, 2012
1 parent 74931e7 commit 6a1df4b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config-sample.php
Expand Up @@ -114,7 +114,7 @@
$translucence_config['search-single-sidebar'] = "right01"; $translucence_config['search-single-sidebar'] = "right01";
$translucence_config['archives-single-sidebar'] = "right01"; $translucence_config['archives-single-sidebar'] = "right01";


$translucence_config['default-post-display'] = "titles"; $translucence_config['default-post-display'] = "title-excerpt";


/****************************************************************************** /******************************************************************************
* Preset Widgets * Preset Widgets
Expand Down
8 changes: 8 additions & 0 deletions functions/theme-options.php
Expand Up @@ -364,6 +364,14 @@ function translucence_validate_options($input) {
$input[$option] = null; $input[$option] = null;
$not_validated[] = $option; $not_validated[] = $option;
} }
} else if (preg_match("/default-post-display/", $option)) {
if (in_array($value, $translucence_options_values['post-display'])) {
$input[$option] = $value;
$validated[] = $option;
} else {
$input[$option] = null;
$not_validated[] = $option;
}


} }
} }
Expand Down
4 changes: 2 additions & 2 deletions loop.php
Expand Up @@ -161,11 +161,11 @@
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div><!-- .entry-summary --> </div><!-- .entry-summary -->
<?php else : ?> <?php else : ?>
<?php if ( $translucence_options['default-post-display'] == "excerpt") : ?> <?php if ( $translucence_options['default-post-display'] == "title-excerpt") : ?>
<div class="entry-summary"> <div class="entry-summary">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div><!-- .entry-summary --> </div><!-- .entry-summary -->
<?php elseif ( $translucence_options['default-post-display'] != "titles") : ?> <?php elseif ( $translucence_options['default-post-display'] != "title") : ?>
<div class="entry-content"> <div class="entry-content">
<?php the_content( __( 'More <span class="meta-nav">&rarr;</span>', '2010-translucence' ) ); ?> <?php the_content( __( 'More <span class="meta-nav">&rarr;</span>', '2010-translucence' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '2010-translucence' ), 'after' => '</div>' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '2010-translucence' ), 'after' => '</div>' ) ); ?>
Expand Down
11 changes: 10 additions & 1 deletion template-options.php
Expand Up @@ -939,6 +939,7 @@ function translucence_get_global_options() {
// if not in active_options print out as hidden fields // if not in active_options print out as hidden fields
} else { } else {
print "<input type='hidden' name='".$translucence_options_id."[header-meta-left]' value='".$translucence_options['header-meta-left']."'/>"; print "<input type='hidden' name='".$translucence_options_id."[header-meta-left]' value='".$translucence_options['header-meta-left']."'/>";
//print "<input type='hidden' name='".$translucence_options_id."[headermeta]' value='".$translucence_options['headermeta']."'/>";
} }


print "<div style='font-size: 10px;'>"; print "<div style='font-size: 10px;'>";
Expand Down Expand Up @@ -1059,7 +1060,13 @@ function translucence_get_layout_options() {
print "</td>"; print "</td>";
print "</tr>"; print "</tr>";
print "<tr>"; print "<tr>";
print "<td></td>";
// Default Post Display
print "<td>";
print "<div>".__( 'Default Post Display', '2010-translucence')."</div>\n";
translucence_get_option_selector ("", "default-post-display", $translucence_options_values['post-display']);
print "</td>";

// 2nd Right sidebar // 2nd Right sidebar
print "<td style='text-align: right;'>"; print "<td style='text-align: right;'>";
print "<div>".__( '2nd Right Sidebar', '2010-translucence')."</div>\n"; print "<div>".__( '2nd Right Sidebar', '2010-translucence')."</div>\n";
Expand Down Expand Up @@ -1737,6 +1744,7 @@ function translucence_get_active_options($translucence_options_mode) {
$active_options[] = 'left01-width'; $active_options[] = 'left01-width';
$active_options[] = 'right01-width'; $active_options[] = 'right01-width';
$active_options[] = 'right02-width'; $active_options[] = 'right02-width';
$active_options[] = 'default-post-display';
$active_options[] = 'top-border-style'; $active_options[] = 'top-border-style';
$active_options[] = 'content-border-style'; $active_options[] = 'content-border-style';
$active_options[] = 'left01-border-style'; $active_options[] = 'left01-border-style';
Expand Down Expand Up @@ -1814,6 +1822,7 @@ function translucence_get_active_options($translucence_options_mode) {
$active_options[] = 'description-box-color'; $active_options[] = 'description-box-color';
$active_options[] = 'description-box-opacity'; $active_options[] = 'description-box-opacity';
$active_options[] = 'header_meta_left_options'; $active_options[] = 'header_meta_left_options';
// $active_options[] = 'headermeta';
//$active_options[] = ''; //$active_options[] = '';




Expand Down
7 changes: 7 additions & 0 deletions variations/default/variation.php
Expand Up @@ -379,4 +379,11 @@
'No Sidebars' => 'none', 'No Sidebars' => 'none',
); );


$translucence_options_values['post-display'] = array(
'Title Only' => 'title',
'Title & Excerpt' => 'title-excerpt',
'Title & Full Post' => 'title-full'
);


?> ?>

0 comments on commit 6a1df4b

Please sign in to comment.