StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-28-2009, 03:58 AM
sketpaal sketpaal is offline
Registered User
Genesis Member
 
Join Date: Jun 2009
Posts: 7
Default Church v4 theme options not saving

When I try to change something in Appearance->Church Theme Options the settings are not saved and nothing changes.
I tried to chmod the tools and cahce folder to 777 but this doesn't help.

The strange thing is that when I change the code still nothing happens?
This is the options.php code
Code:
<?php
/*
Plugin Name: Theme Options
Author: Nathan Rice
Author URI: http://www.nathanrice.net/

NOTE: this file requires WordPress 2.7+ to function
*/
$settings = 'mods_'.get_current_theme(); // do not change!

$defaults = array( // define our defaults
		'header_blog_title' => 'Image',
		'featured_top_left' => 2,
		'featured_top_left_num' => 3,
		'featured_top_left_thumb_width' => 70,
		'featured_top_left_thumb_height' => 70,
		'featured_top_right' => 2,
		'featured_top_right_num' => 3,
		'featured_top_right_thumb_width' => 70,
		'featured_top_right_thumb_height' => 70,
		'featured_bottom' => 2,
		'featured_bottom_num' => 3,
		'featured_bottom_thumb_width' => 110,
		'featured_bottom_thumb_height' => 110,
		'enews' => 'Yes',
		'blog_cat' => 1,
		'blog_cat_num' => 5 // <-- no comma after the last option
);

//	push the defaults to the options database,
//	if options don't yet exist there.
add_option($settings, $defaults, '', 'yes');

/*
///////////////////////////////////////////////
This section hooks the proper functions
to the proper actions in WordPress
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/
//	this function registers our settings in the db
add_action('admin_init', 'register_theme_settings');
function register_theme_settings() {
	global $settings;
	register_setting($settings, $settings);
}
//	this function adds the settings page to the Appearance tab
add_action('admin_menu', 'add_theme_options_menu');
function add_theme_options_menu() {
	add_submenu_page('themes.php', 'Church Theme Options', 'Church Theme Options', 8, 'theme-options', 'theme_settings_admin');
}

/*
///////////////////////////////////////////////
This section handles all the admin page
output (forms, update notifications, etc.)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/
function theme_settings_admin() { ?>
<?php theme_options_css_js(); ?>
<div class="wrap">
<?php
	// display the proper notification if Saved/Reset
	global $settings, $defaults;
	if(get_theme_mod('reset')) {
		echo '<div class="updated fade" id="message">

'.__('Theme Options', 'studiopress').' '.__('RESET TO DEFAULTS', 'studiopress').'</p></div>';
		update_option($settings, $defaults);
	} elseif($_REQUEST['updated'] == 'true') {
		echo '<div class="updated fade" id="message">

'.__('Theme Options', 'studiopress').' '.__('SAVED', 'studiopress').'</p></div>';
	}
	// display icon next to page title
	screen_icon('options-general');
?>
	<h2><?php echo get_current_theme() . ' '; _e('Theme Options', 'studiopress'); ?></h2>
	<form method="post" action="options.php">
	<?php settings_fields($settings); // important! ?>
	
	
	<div class="metabox-holder">
    
		<div class="postbox">
		<h3><?php _e("StudioPress QuickDash", 'studiopress'); ?></h3>
			<div class="inside">
				

Do you want access to all StudioPress Themes? 
 Upgrade to the Pro-Plus package for only $140. (Use PPUPG as the discount code.)</p>
                

Subscribe to RSS</a>Subscribe via Email</p>
			</div>
		</div>
        
		<div class="postbox">
		<h3><?php _e("Header Blog Title", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Select from the following", 'studiopress'); ?>:

				<select name="<?php echo $settings; ?>[header_blog_title]">
					<option style="padding-right:10px;" value="Image" <?php selected('Image', get_theme_mod('header_blog_title')); ?>><?php _e("Use an image logo", 'studiopress'); ?></option>
					<option style="padding-right:10px;" value="Text" <?php selected('Text', get_theme_mod('header_blog_title')); ?>><?php _e("Use dynamic text", 'studiopress'); ?></option>
				</select></p>
			</div>
		</div>
		
		<div class="postbox">
		<h3><?php _e("Homepage Featured Top Left", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Select which category you want displayed", 'studiopress'); ?>:

    			<?php wp_dropdown_categories(array('selected' => get_theme_mod('featured_top_left'), 'name' => $settings.'[featured_top_left]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?></p>
				
				

<?php _e("Number of posts to show", 'studiopress'); ?>:

				<input type="text" name="<?php echo $settings; ?>[featured_top_left_num]" value="<?php echo get_theme_mod('featured_top_left_num'); ?>" size="3" /></p>
				
				

<?php _e("Thumbnail dimensions", 'studiopress'); ?> (<?php _e("Width x Height", 'studiopress'); ?>)

				<input type="text" name="<?php echo $settings; ?>[featured_top_left_thumb_width]" value="<?php echo get_theme_mod('featured_top_left_thumb_width'); ?>" size="3" /> x <input type="text" name="<?php echo $settings; ?>[featured_top_left_thumb_height]" value="<?php echo get_theme_mod('featured_top_left_thumb_height'); ?>" size="3" /></p>
			</div>
		</div>
		
		<div class="postbox">
		<h3><?php _e("Homepage Featured Top Right", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Select which category you want displayed", 'studiopress'); ?>:

    			<?php wp_dropdown_categories(array('selected' => get_theme_mod('featured_top_right'), 'name' => $settings.'[featured_top_right]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?></p>
				
				

<?php _e("Number of posts to show", 'studiopress'); ?>:

				<input type="text" name="<?php echo $settings; ?>[featured_top_right_num]" value="<?php echo get_theme_mod('featured_top_right_num'); ?>" size="3" /></p>
				
				

<?php _e("Thumbnail dimensions", 'studiopress'); ?> (<?php _e("Width x Height", 'studiopress'); ?>)

				<input type="text" name="<?php echo $settings; ?>[featured_top_right_thumb_width]" value="<?php echo get_theme_mod('featured_top_right_thumb_width'); ?>" size="3" /> x <input type="text" name="<?php echo $settings; ?>[featured_top_right_thumb_height]" value="<?php echo get_theme_mod('featured_top_right_thumb_height'); ?>" size="3" /></p>
			</div>
		</div>

		<div class="postbox">
		<h3><?php _e("Homepage Featured Bottom", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Select which category you want displayed", 'studiopress'); ?>:

    			<?php wp_dropdown_categories(array('selected' => get_theme_mod('featured_bottom'), 'name' => $settings.'[featured_bottom]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?></p>
				
				

<?php _e("Number of posts to show", 'studiopress'); ?>:

				<input type="text" name="<?php echo $settings; ?>[featured_bottom_num]" value="<?php echo get_theme_mod('featured_bottom_num'); ?>" size="3" /></p>
				
				

<?php _e("Thumbnail dimensions", 'studiopress'); ?> (<?php _e("Width x Height", 'studiopress'); ?>)

				<input type="text" name="<?php echo $settings; ?>[featured_bottom_thumb_width]" value="<?php echo get_theme_mod('featured_bottom_thumb_width'); ?>" size="3" /> x <input type="text" name="<?php echo $settings; ?>[featured_bottom_thumb_height]" value="<?php echo get_theme_mod('featured_bottom_thumb_height'); ?>" size="3" /></p>
			</div>
		</div>
	</div>
	
	
	
	<div class="metabox-holder">
    
		<div class="postbox">
		<h3><?php _e("Sidebar eNews &amp; Updates", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Include the eNews &amp; Updates section?", 'studiopress'); ?>

				<select name="<?php echo $settings; ?>[enews]">
					<option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('enews')); ?>><?php _e("Yes", 'studiopress'); ?></option>
					<option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('enews')); ?>><?php _e("No", 'studiopress'); ?></option>
				</select></p>
                
				

<?php _e("Google/Feedburner Feed ID:", 'studiopress'); ?>

				<input type="text" name="<?php echo $settings; ?>[enews_id]" value="<?php echo get_theme_mod('enews_id'); ?>" size="20" /></p>
                

<?php _e("Learn how to find your Google/Feedburner ID", 'studiopress'); ?> <?php _e("here", 'studiopress'); ?>.</p>
            </div>
		</div>
        
		<div class="postbox">
		<h3><?php _e("468x60 Ad Block", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Display an ad between the post and comments?", 'studiopress'); ?>

				<select name="<?php echo $settings; ?>[468_ad]">
					<option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('468_ad')); ?>><?php _e("Yes", 'studiopress'); ?></option>
					<option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('468_ad')); ?>><?php _e("No", 'studiopress'); ?></option>
				</select></p>
                
				

<?php _e("Enter your ad code:", 'studiopress'); ?>

				<textarea name="<?php echo $settings; ?>[468_code]" cols=35 rows=5><?php echo stripslashes(get_theme_mod('468_code')); ?></textarea></p>
            </div>
		</div>        
        
		<div class="postbox">
		<h3><?php _e("Blog Page Template", 'studiopress'); ?></h3>
			<div class="inside">
				

<?php _e("Select which category you want displayed", 'studiopress'); ?>:

    			<?php wp_dropdown_categories(array('selected' => get_theme_mod('blog_cat'), 'name' => $settings.'[blog_cat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'show_option_all' => __("All Categories", 'studiopress'), 'hide_empty' => '0' )); ?></p>
				
				

<?php _e("Number of Posts to Show", 'studiopress'); ?>:

				<input type="text" name="<?php echo $settings; ?>[blog_cat_num]" value="<?php echo get_theme_mod('blog_cat_num'); ?>" size="3" /></p>
			</div>
		</div>
		
		<p class="submit">
		<input type="submit" class="button-primary" value="<?php _e('Save Settings', 'studiopress') ?>" />
		<input type="submit" class="button-highlighted" name="<?php echo $settings; ?>[reset]" value="<?php _e('Reset Settings', 'studiopress'); ?>" />
		</p>

	</div>
	
	</form>

</div>
<?php }

// add CSS and JS if necessary
function theme_options_css_js() {
echo <<<CSS

<style type="text/css">
	.metabox-holder { 
		width: 350px; float: left;
		margin: 0; padding: 0 10px 0 0;
	}
	.metabox-holder .postbox .inside {
		padding: 0 10px;
	}
</style>

CSS;
echo <<<JS

<script type="text/javascript">
jQuery(document).ready(function($) {
	$(".fade").fadeIn(1000).fadeTo(1000, 1).fadeOut(1000);
});
</script>

JS;
}
?>
and this the functions.php
Code:
<?php

// Uncomment this to test your localization, make sure to enter the right language code.
// function test_localization( $locale ) {
// 	return "de_DE";
// }
// add_filter('locale','test_localization');

load_theme_textdomain('studiopress', TEMPLATEPATH.'/languages/');

add_filter('comments_template', 'legacy_comments');

function legacy_comments($file) {

	if(!function_exists('wp_list_comments')) : // WP 2.7-only check
		$file = TEMPLATEPATH . '/legacy.comments.php';
	endif;

	return $file;
}

// Turn a category ID to a Name
function cat_id_to_name($id) {
	foreach((array)(get_categories()) as $category) {
    	if ($id == $category->cat_ID) { return $category->cat_name; break; }
	}
}

// include the breadcrumb nav tool
include(TEMPLATEPATH."/tools/breadcrumbs.php");

// include the theme options
include(TEMPLATEPATH."/tools/theme-options.php");

// include the dashboard widget
include(TEMPLATEPATH."/tools/sp_dashboard_widget.php");

if ( function_exists('register_sidebars') )
	register_sidebar(array('name'=>'Sidebar Top','before_title'=>'<h3>','after_title'=>'</h3>'));
	register_sidebar(array('name'=>'Sidebar Bottom Left','before_title'=>'<h3>','after_title'=>'</h3>'));
	register_sidebar(array('name'=>'Sidebar Bottom Right','before_title'=>'<h3>','after_title'=>'</h3>'));
	register_sidebar(array('name'=>'468x60 Header Banner','before_title'=>'<h4>','after_title'=>'</h4>'));

function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
    $content = strip_tags($content);

   if (strlen($_GET['p']) > 0) {
      echo "

";
      echo $content;
      echo "<a href='";
      the_permalink();
      echo "'>".__("Read More", 'studiopress')." &rarr;</a>";
      echo "</p>";
   }
   else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
        $content = substr($content, 0, $espacio);
        $content = $content;
        echo "

";
        echo $content;
        echo "...";
        echo "<a href='";
        the_permalink();
        echo "'>".$more_link_text."</a>";
        echo "</p>";
   }
   else {
      echo "

";
      echo $content;
      echo "<a href='";
      the_permalink();
      echo "'>".__("Read More", 'studiopress')." &rarr;</a>";
      echo "</p>";
   }
}
?>

http://www.charlylownoise.com/de
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Agent Theme 3 - Theme Options Not Saving Information Changed hometourjay General Discussion 2 02-24-2011 06:35 AM
Help! Theme Options Not Saving digitalnomad General Discussion 3 11-15-2010 06:46 AM
Theme Options Not Saving in WordPress MU acbleser General Discussion 5 02-25-2010 03:50 AM
Theme options not saving mkjones General Discussion 8 01-05-2010 07:46 AM
Theme Options not Saving bdusablon General Discussion 6 10-02-2009 12:48 PM


All times are GMT -5. The time now is 12:14 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.