Skip to content
Browse files

add default post display primary theme option

  • Loading branch information...
1 parent 74931e7 commit 6a1df4b01329f048e7b0d339a3d5ec0d37bfc03e @marpa committed Jun 9, 2012
Showing with 28 additions and 4 deletions.
  1. +1 −1 config-sample.php
  2. +8 −0 functions/theme-options.php
  3. +2 −2 loop.php
  4. +10 −1 template-options.php
  5. +7 −0 variations/default/variation.php
View
2 config-sample.php
@@ -114,7 +114,7 @@
$translucence_config['search-single-sidebar'] = "right01";
$translucence_config['archives-single-sidebar'] = "right01";
-$translucence_config['default-post-display'] = "titles";
+$translucence_config['default-post-display'] = "title-excerpt";
/******************************************************************************
* Preset Widgets
View
8 functions/theme-options.php
@@ -364,6 +364,14 @@ function translucence_validate_options($input) {
$input[$option] = null;
$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;
+ }
}
}
View
4 loop.php
@@ -161,11 +161,11 @@
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
- <?php if ( $translucence_options['default-post-display'] == "excerpt") : ?>
+ <?php if ( $translucence_options['default-post-display'] == "title-excerpt") : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
- <?php elseif ( $translucence_options['default-post-display'] != "titles") : ?>
+ <?php elseif ( $translucence_options['default-post-display'] != "title") : ?>
<div class="entry-content">
<?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>' ) ); ?>
View
11 template-options.php
@@ -939,6 +939,7 @@ function translucence_get_global_options() {
// if not in active_options print out as hidden fields
} 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."[headermeta]' value='".$translucence_options['headermeta']."'/>";
}
print "<div style='font-size: 10px;'>";
@@ -1059,7 +1060,13 @@ function translucence_get_layout_options() {
print "</td>";
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
print "<td style='text-align: right;'>";
print "<div>".__( '2nd Right Sidebar', '2010-translucence')."</div>\n";
@@ -1737,6 +1744,7 @@ function translucence_get_active_options($translucence_options_mode) {
$active_options[] = 'left01-width';
$active_options[] = 'right01-width';
$active_options[] = 'right02-width';
+ $active_options[] = 'default-post-display';
$active_options[] = 'top-border-style';
$active_options[] = 'content-border-style';
$active_options[] = 'left01-border-style';
@@ -1814,6 +1822,7 @@ function translucence_get_active_options($translucence_options_mode) {
$active_options[] = 'description-box-color';
$active_options[] = 'description-box-opacity';
$active_options[] = 'header_meta_left_options';
+ // $active_options[] = 'headermeta';
//$active_options[] = '';
View
7 variations/default/variation.php
@@ -379,4 +379,11 @@
'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.
Something went wrong with that request. Please try again.