Skip to content
Permalink
Browse files

Fixed and tidied convoluted display of theme options

  • Loading branch information...
splorp committed Sep 10, 2019
1 parent 6bb4a88 commit ce6f0cf6b2eed67f78615589cf0ae99f9c83cbf3
Showing with 13 additions and 28 deletions.
  1. +3 −10 footer.php
  2. +6 −9 header.php
  3. +4 −9 sidebar.php
@@ -4,20 +4,13 @@
* @subpackage Tersus
*/
?>

<?php
global $options;
foreach ($options as $value) {
if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); }
}
?>

<footer>
<?php
if ($tersus_footer_display == "1"):
if (get_option('tersus_footer_display') == "1"):
$tersus_footer_text = get_option('tersus_footer_text');
echo (stripslashes($tersus_footer_text));
endif;
if ($tersus_theme_information == "1"): ?>
if (get_option('tersus_theme_information') == "1"): ?>
<ul>
<li>Powered by <a href="http://wordpress.org/" rel="external" title="Code is poetry.">WordPress <?php bloginfo('version'); ?></a></li>
<li>Themed by <a href="<?php echo THEME_URI; ?>" rel="external" title="<?php echo THEME_DESCRIPTION; ?>"><?php echo THEME_NAME; ?> <?php echo THEME_VERSION; ?></a></li>
@@ -9,12 +9,6 @@
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<title><?php wp_title('&mdash;', true, 'right'); ?></title>
<?php
global $options;
foreach ($options as $value) {
if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); }
}
?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
@@ -49,16 +43,19 @@

<body <?php body_class(); ?>>
<header>
<?php if ($tersus_announcement_display == "1"): ?>
<?php if (get_option('tersus_announcement_display') == "1"): ?>
<section id="announcement">
<?php echo (stripslashes($tersus_announcement)); ?>
<?php
$tersus_announcement = get_option('tersus_announcement');
echo (stripslashes($tersus_announcement));
?>
</section>
<?php endif; ?>
<h1><a href="<?php echo home_url(); ?>/" title="Back to the home page"><?php bloginfo('name'); ?></a></h1>
<p><?php bloginfo('description'); ?></p>
</header>

<?php if ($tersus_navigation_display == "1"): ?>
<?php if (get_option('tersus_navigation_display') == "1"): ?>
<nav role="navigation">
<?php
$menuParameters = array(
@@ -80,25 +80,20 @@
if ( ! function_exists('dynamic_sidebar') || ! dynamic_sidebar('sidebar1') ) :
// Otherwise insert default sidebar elements
global $options;
foreach ($options as $value) {
if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] );
}
}
// Display a list of pages
if ($tersus_page_depth == "1") $depth = '0'; else $depth = '1';
if (get_option('tersus_page_depth') == "1") $depth = '0'; else $depth = '1';
wp_list_pages('depth=' . $depth . '&title_li=<h2>Pages</h2>' );
// Display a list of categories
if ($tersus_category_count == "1") $category_count = '1'; else $category_count = '0';
if (get_option('tersus_category_count') == "1") $category_count = '1'; else $category_count = '0';
wp_list_categories('show_count=' . $category_count . '&title_li=<h2>Categories</h2>');
?>
<li><h2>Archives</h2>
<ul>
<?php
// Display a list of monthly archives
if ($tersus_archive_count == "1") $archive_count = '1'; else $archive_count = '0';
if (get_option('tersus_archive_count') == "1") $archive_count = '1'; else $archive_count = '0';
wp_get_archives('show_post_count=' . $archive_count . '&type=monthly');
?>
</ul>
@@ -107,4 +102,4 @@
endif;
?>
</ul>
</aside>
</aside>

0 comments on commit ce6f0cf

Please sign in to comment.
You can’t perform that action at this time.