Permalink
Browse files

Techozoic 2.0.4

Changes
- Added two new navigation styles, Ribbon and Square.
- Added more color choices for navigation menus.
- Added option to specify width of navigation menu sub menus.
- Added ability to specify two Google Web fonts.
- Romanian Translation ,<img src="http://mobirout.com/uploads/ro.gif" alt="Romanian translation" /> Web Geek Science  (<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>)
- New post author block on single post screens, if user bio is filled out on profile page it is displayed along with gravatar.
  • Loading branch information...
1 parent 34b25c1 commit ee4ac30061eff5eacc628b6d9758651d7442269b @jeremyclark13 committed Apr 12, 2012
View
31 admin/css/admin-style.css
@@ -12,6 +12,9 @@
max-width:780px;
background:#fff;
}
+#optionsframework h3 {
+ cursor: default;
+}
#optionsframework p {
margin-bottom:0;
padding-bottom:10px;
@@ -50,6 +53,9 @@
min-width:125px;
width:125px
}
+#optionsframework .section-editor .explain{
+ max-width:100%;
+}
#optionsframework .controls input, #optionsframework .controls select, #optionsframework .controls textarea {
margin-bottom:10px;
width:100%;
@@ -152,6 +158,14 @@
#optionsframework .mini .explain {
max-width:74%;
}
+
+/* Editor */
+
+#optionsframework .section-editor .explain {
+ float:none;
+ margin-bottom:5px;
+}
+
/* Image Uploader */
#optionsframework .controls input.upload {
@@ -220,16 +234,13 @@
#optionsframework .button-primary {
float:right;
}
-/* Backup Settings */
-.import, .export {
- margin: 20px 0;
- padding: 0 0 20px 10px;
- border: 1px solid #ECECEC;
- background-color: #f9f9f9;
-}
+/* Bottom Section */
-.import label {
- display:block;
- padding: 0 0 5px 0;
+#optionsframework .section:before, #optionsframework .section:after {
+ content: "";
+ display: table;
+}
+#optionsframework .section:after {
+ clear: both;
}
View
89 admin/options-framework.php
@@ -1,12 +1,10 @@
<?php
/*
-Plugin Name: Options Framework
-Plugin URI: http://www.wptheming.com
Description: A framework for building theme options.
-Version: 0.8
Author: Devin Price
Author URI: http://www.wptheming.com
License: GPLv2
+Version: 1.0
*/
/*
@@ -25,14 +23,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-/* Basic plugin definitions */
-
-define('OPTIONS_FRAMEWORK_VERSION', '0.9');
-
/* Make sure we don't expose any info if called directly */
if ( !function_exists( 'add_action' ) ) {
- echo "Hi there! I'm just a little plugin, don't mind me.";
+ echo "Hi there! I'm just a little extension, don't mind me.";
exit;
}
@@ -46,6 +40,7 @@ function optionsframework_rolescheck () {
add_action( 'admin_menu', 'optionsframework_add_page');
add_action( 'admin_init', 'optionsframework_init' );
add_action( 'admin_init', 'optionsframework_mlu_init' );
+ add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
}
}
@@ -54,7 +49,7 @@ function optionsframework_rolescheck () {
add_action('init', 'optionsframework_load_backup' );
function optionsframework_load_backup() {
- require_once dirname( __FILE__ ) . '/options-backup.php';
+ require_once dirname( __FILE__ ) . '/options-backup.php';
}
/* Loads the file for option sanitization */
@@ -113,6 +108,18 @@ function optionsframework_init() {
}
}
+/**
+ * Ensures that a user with the 'edit_theme_options' capability can actually set the options
+ * See: http://core.trac.wordpress.org/ticket/14365
+ *
+ * @param string $capability The capability used for the page, which is manage_options by default.
+ * @return string The capability to actually use.
+ */
+
+function optionsframework_page_capability( $capability ) {
+ return 'edit_theme_options';
+}
+
/*
* Adds default options to the database if they aren't already present.
* May update this later to load only on plugin activation, or theme
@@ -165,16 +172,16 @@ function optionsframework_setdefaults() {
/* Add a subpage called "Theme Options" to the appearance menu. */
if ( !function_exists( 'optionsframework_add_page' ) ) {
-function optionsframework_add_page() {
- $of_page = add_theme_page(__('Techozoic Setting','techozoic'), __('Techozoic Setting','techozoic'), 'edit_theme_options', 'options-framework','optionsframework_page');
-
- // Adds actions to hook in the required css and javascript
- add_action("admin_print_styles-$of_page",'optionsframework_load_styles');
- add_action("admin_print_scripts-$of_page", 'optionsframework_load_scripts');
+ function optionsframework_add_page() {
+ $of_page = add_theme_page('Techozoic Settings', 'Techozoic Settings', 'edit_theme_options', 'options-framework','optionsframework_page');
+
+ // Load the required CSS and javscript
+ add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
+ add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
+ }
}
-}
/* Loads the CSS */
@@ -185,15 +192,18 @@ function optionsframework_load_styles() {
/* Loads the javascript */
-function optionsframework_load_scripts() {
+function optionsframework_load_scripts($hook) {
- // Inline scripts from options-interface.php
- add_action('admin_head', 'of_admin_head');
+ if ( 'appearance_page_options-framework' != $hook )
+ return;
// Enqueued scripts
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'js/colorpicker.js', array('jquery'));
wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_DIRECTORY.'js/options-custom.js', array('jquery'));
+
+ // Inline scripts from options-interface.php
+ add_action('admin_head', 'of_admin_head');
}
function of_admin_head() {
@@ -215,25 +225,24 @@ function of_admin_head() {
*/
if ( !function_exists( 'optionsframework_page' ) ) {
-function optionsframework_page() {
- $options = optionsframework_options();
- $return = optionsframework_fields();
- settings_errors();
- ?>
-
+ function optionsframework_page() {
+ settings_errors();
+?>
+
<div class="wrap">
<?php screen_icon( 'themes' ); ?>
<h2 class="nav-tab-wrapper">
- <?php echo $return[1]; ?>
+ <?php echo optionsframework_tabs(); ?>
</h2>
-
+
<div class="metabox-holder">
<div id="optionsframework" class="postbox">
<form action="options.php" method="post">
<?php settings_fields('optionsframework'); ?>
- <?php echo $return[0]; /* Settings */ ?>
- <div id="optionsframework-submit">
+ <?php optionsframework_fields(); /* Settings */ ?>
+
+ <div id="optionsframework-submit">
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options','techozoic' ); ?>" />
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults','techozoic' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!','techozoic' ) ); ?>' );" />
<div class="clear"></div>
@@ -244,7 +253,7 @@ function optionsframework_page() {
</div> <!-- / .wrap -->
<?php
-}
+ }
}
/**
@@ -376,9 +385,9 @@ function of_get_default_values() {
$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $prev_settings[$option['id']], $option);
}
} else{
- $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
- }
- }
+ $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
+ }
+ }
if ($option['type'] == 'color' && $prev_settings) {
$output[$option['id']] = '#' . $prev_settings[$option['id']];
}
@@ -392,19 +401,17 @@ function of_get_default_values() {
/**
* Add Theme Options menu item to Admin Bar.
*/
-
-add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
function optionsframework_adminbar() {
-
+
global $wp_admin_bar;
-
+
$wp_admin_bar->add_menu( array(
- 'parent' => 'appearance',
- 'id' => 'of_theme_options',
+ 'parent' => 'appearance',
+ 'id' => 'of_theme_options',
'title' => __( 'Techozoic Settings','techozoic' ),
- 'href' => admin_url( 'themes.php?page=options-framework' )
- ));
+ 'href' => admin_url( 'themes.php?page=options-framework' )
+ ));
}
if ( ! function_exists( 'of_get_option' ) ) {
View
258 admin/options-interface.php
@@ -1,46 +1,60 @@
<?php
/**
+ * Generates the tabs that are used in the options menu
+ */
+
+function optionsframework_tabs() {
+
+ $optionsframework_settings = get_option('optionsframework');
+ $options = optionsframework_options();
+ $menu = '';
+
+ foreach ($options as $value) {
+ // Heading for Navigation
+ if ($value['type'] == "heading") {
+ $jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['name']) );
+ $jquery_click_hook = "of-option-" . $jquery_click_hook;
+ $menu .= '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" class="nav-tab" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a>';
+ }
+ }
+
+ return $menu;
+}
+
+/**
* Generates the options fields that are used in the form.
*/
function optionsframework_fields() {
global $allowedtags;
- $allowedtags['br'] = array();
- $allowedtags['img'] = array(
- "src" => array()
- );
- $optionsframework_settings = get_option('optionsframework');
-
- // Get the theme name so we can display it up top
- $themename = get_theme_data(STYLESHEETPATH . '/style.css');
- $themename = $themename['Name'];
+ $optionsframework_settings = get_option('optionsframework');
// Gets the unique option id
- if (isset($optionsframework_settings['id'])) {
+ if ( isset( $optionsframework_settings['id'] ) ) {
$option_name = $optionsframework_settings['id'];
}
else {
$option_name = 'optionsframework';
};
$settings = get_option($option_name);
- $options = optionsframework_options();
+ $options = optionsframework_options();
- $counter = 0;
+ $counter = 0;
$menu = '';
- $output = '';
-
- foreach ($options as $value) {
-
+
+ foreach ( $options as $value ) {
+
$counter++;
$val = '';
$select_value = '';
$checked = '';
-
+ $output = '';
+
// Wrap all options
- if ( ($value['type'] != "heading") && ($value['type'] != "info") ) {
+ if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) {
// Keep all ids lowercase with no spaces
$value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['id']) );
@@ -56,80 +70,85 @@ function optionsframework_fields() {
}
$output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
- $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
- $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
- }
-
+ if ( isset( $value['name'] ) ) {
+ $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
+ }
+ if ( $value['type'] != 'editor' ) {
+ $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
+ }
+ else {
+ $output .= '<div class="option">' . "\n" . '<div>' . "\n";
+ }
+ }
+
// Set default value to $val
- if ( isset( $value['std']) ) {
+ if ( isset( $value['std'] ) ) {
$val = $value['std'];
}
-
+
// If the option is already saved, ovveride $val
- if ( ($value['type'] != 'heading') && ($value['type'] != 'info')) {
- if ( isset($settings[($value['id'])]) ) {
- $val = $settings[($value['id'])];
- // Striping slashes of non-array options
- if (!is_array($val)) {
- $val = stripslashes($val);
- }
+ if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') ) {
+ if ( isset( $settings[($value['id'])]) ) {
+ $val = $settings[($value['id'])];
+ // Striping slashes of non-array options
+ if ( !is_array($val) ) {
+ $val = stripslashes( $val );
+ }
}
}
-
+
// If there is a description save it for labels
$explain_value = '';
if ( isset( $value['desc'] ) ) {
$explain_value = $value['desc'];
}
-
+
switch ( $value['type'] ) {
-
+
// Basic text input
case 'text':
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" type="text" value="' . esc_attr( $val ) . '" />';
- break;
-
+ break;
+
// Textarea
case 'textarea':
- $cols = '8';
- $ta_value = '';
-
- if(isset($value['options'])){
- $ta_options = $value['options'];
- if(isset($ta_options['cols'])){
- $cols = $ta_options['cols'];
- } else { $cols = '8'; }
+ $rows = '8';
+
+ if ( isset( $value['settings']['rows'] ) ) {
+ $custom_rows = $value['settings']['rows'];
+ if ( is_numeric( $custom_rows ) ) {
+ $rows = $custom_rows;
+ }
}
-
+
$val = stripslashes( $val );
-
- $output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" cols="'. esc_attr( $cols ) . '" rows="8">' . esc_textarea( $val ) . '</textarea>';
- break;
-
+ $output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" rows="' . $rows . '">' . esc_textarea( $val ) . '</textarea>';
+ break;
+
// Select Box
case ($value['type'] == 'select'):
$output .= '<select class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '">';
-
+
foreach ($value['options'] as $key => $option ) {
$selected = '';
- if( $val != '' ) {
- if ( $val == $key) { $selected = ' selected="selected"';}
- }
- $output .= '<option'. $selected .' value="' . esc_attr( $key ) . '">' . esc_html( $option ) . '</option>';
- }
- $output .= '</select>';
- break;
-
-
+ if ( $val != '' ) {
+ if ( $val == $key) { $selected = ' selected="selected"';}
+ }
+ $output .= '<option'. $selected .' value="' . esc_attr( $key ) . '">' . esc_html( $option ) . '</option>';
+ }
+ $output .= '</select>';
+ break;
+
+
// Radio Box
case "radio":
$name = $option_name .'['. $value['id'] .']';
foreach ($value['options'] as $key => $option) {
$id = $option_name . '-' . $value['id'] .'-'. $key;
$output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label>';
}
- break;
-
+ break;
+
// Image Selectors
case "images":
$name = $option_name .'['. $value['id'] .']';
@@ -146,14 +165,14 @@ function optionsframework_fields() {
$output .= '<div class="of-radio-img-label">' . esc_html( $key ) . '</div>';
$output .= '<img src="' . esc_url( $option ) . '" alt="' . $option .'" class="of-radio-img-img' . $selected .'" onclick="document.getElementById(\''. esc_attr($value['id'] .'_'. $key) .'\').checked=true;" />';
}
- break;
-
+ break;
+
// Checkbox
case "checkbox":
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" '. checked( $val, 1, false) .' />';
$output .= '<label class="explain" for="' . esc_attr( $value['id'] ) . '">' . wp_kses( $explain_value, $allowedtags) . '</label>';
- break;
-
+ break;
+
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
@@ -164,115 +183,134 @@ function optionsframework_fields() {
$id = $option_name . '-' . $value['id'] . '-'. $option;
$name = $option_name . '[' . $value['id'] . '][' . $option .']';
- if ( isset($val[$option]) ) {
+ if ( isset($val[$option]) ) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label>';
}
- break;
-
+ break;
+
// Color picker
case "color":
$output .= '<div id="' . esc_attr( $value['id'] . '_picker' ) . '" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $val ) . '"></div></div>';
$output .= '<input class="of-color" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '" type="text" value="' . esc_attr( $val ) . '" />';
- break;
-
+ break;
+
// Uploader
case "upload":
- $output .= optionsframework_medialibrary_uploader( $value['id'], $val, null ); // New AJAX Uploader using Media Library
- break;
-
+ $output .= optionsframework_medialibrary_uploader( $value['id'], $val, null );
+ break;
+
// Typography
- case 'typography':
-
+ case 'typography':
+
$typography_stored = $val;
-
+
// Font Size
$output .= '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
- for ($i = 9; $i < 71; $i++) {
+ for ($i = 9; $i < 71; $i++) {
$size = $i . 'px';
$output .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
}
$output .= '</select>';
-
+
// Font Face
$output .= '<select class="of-typography of-typography-face" name="' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '" id="' . esc_attr( $value['id'] . '_face' ) . '">';
-
+
$faces = of_recognized_font_faces();
foreach ( $faces as $key => $face ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';
- }
-
- $output .= '</select>';
+ }
+
+ $output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
- /* Font Style */
+ // Font Style
$styles = of_recognized_font_styles();
foreach ( $styles as $key => $style ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
}
$output .= '</select>';
- // Font Color
+ // Font Color
$output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" />';
- break;
-
+ break;
+
// Background
case 'background':
-
+
$background = $val;
-
- // Background Color
+
+ // Background Color
$output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $background['color'] ) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $background['color'] ) . '" />';
-
+
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
-
+
$output .= optionsframework_medialibrary_uploader( $value['id'], $background['image'], null, '',0,'image');
$class = 'of-background-properties';
if ( '' == $background['image'] ) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr( $class ) . '">';
-
+
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr( $option_name . '[' . $value['id'] . '][repeat]' ) . '" id="' . esc_attr( $value['id'] . '_repeat' ) . '">';
$repeats = of_recognized_background_repeat();
-
+
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['repeat'], $key, false ) . '>'. esc_html( $repeat ) . '</option>';
}
$output .= '</select>';
-
+
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr( $option_name . '[' . $value['id'] . '][position]' ) . '" id="' . esc_attr( $value['id'] . '_position' ) . '">';
$positions = of_recognized_background_position();
-
+
foreach ($positions as $key=>$position) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['position'], $key, false ) . '>'. esc_html( $position ) . '</option>';
}
$output .= '</select>';
-
+
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr( $option_name . '[' . $value['id'] . '][attachment]' ) . '" id="' . esc_attr( $value['id'] . '_attachment' ) . '">';
$attachments = of_recognized_background_attachment();
-
+
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['attachment'], $key, false ) . '>' . esc_html( $attachment ) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
-
- break;
-
+
+ break;
+
+ // Editor
+ case 'editor':
+ $output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
+ echo $output;
+ $textarea_name = esc_attr( $option_name . '[' . $value['id'] . ']' );
+ $default_editor_settings = array(
+ 'textarea_name' => $textarea_name,
+ 'media_buttons' => false,
+ 'tinymce' => array( 'plugins' => 'wordpress' )
+ );
+ $editor_settings = array();
+ if ( isset( $value['settings'] ) ) {
+ $editor_settings = $value['settings'];
+ }
+ $editor_settings = array_merge($editor_settings, $default_editor_settings);
+ wp_editor( $val, $value['id'], $editor_settings );
+ $output = '';
+ break;
+
// Info
case "info":
$class = 'section';
@@ -290,13 +328,13 @@ function optionsframework_fields() {
if ( $value['desc'] ) {
$output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n";
}
- $output .= '<div class="clear"></div></div>' . "\n";
- break;
-
+ $output .= '</div>' . "\n";
+ break;
+
// Heading for Navigation
case "heading":
if ($counter >= 2) {
- $output .= '</div>'."\n";
+ $output .= '</div>'."\n";
}
$jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['name']) );
$jquery_click_hook = "of-option-" . $jquery_click_hook;
@@ -307,16 +345,14 @@ function optionsframework_fields() {
}
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) {
- if ( $value['type'] != "checkbox" ) {
- $output .= '<br/>';
- }
$output .= '</div>';
- if ( $value['type'] != "checkbox" ) {
+ if ( ( $value['type'] != "checkbox" ) && ( $value['type'] != "editor" ) ) {
$output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
}
- $output .= '<div class="clear"></div></div></div>'."\n";
+ $output .= '</div></div>'."\n";
}
+
+ echo $output;
}
- $output .= '</div>';
- return array($output,$menu);
+ echo '</div>';
}
View
8 admin/options-medialibrary-uploader.php
@@ -23,7 +23,7 @@
function optionsframework_mlu_init () {
register_post_type( 'optionsframework', array(
'labels' => array(
- 'name' => __( 'Options Framework Internal Container','techozoic' ),
+ 'name' => __( 'Options Framework Internal Container' ),
),
'public' => true,
'show_ui' => false,
@@ -125,7 +125,7 @@ function optionsframework_medialibrary_uploader( $_id, $_value, $_mode = 'full',
if ( $value ) { $class = ' has-file'; }
$output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="'.$name.'" value="' . $value . '" />' . "\n";
- $output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __( 'Upload','techozoic' ) . '" rel="' . $int . '" />' . "\n";
+ $output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __( 'Upload' ) . '" rel="' . $int . '" />' . "\n";
if ( $_desc != '' ) {
$output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
@@ -134,7 +134,7 @@ function optionsframework_medialibrary_uploader( $_id, $_value, $_mode = 'full',
$output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
if ( $value != '' ) {
- $remove = '<a href="javascript:(void);" class="mlu_remove button">' . __('Remove','techozoic') . '</a>';
+ $remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value );
if ( $image ) {
$output .= '<img src="' . $value . '" alt="" />'.$remove.'';
@@ -285,7 +285,7 @@ function optionsframework_mlu_js_popup () {
if ( ! function_exists( 'optionsframework_mlu_modify_tabs' ) ) {
function optionsframework_mlu_modify_tabs ( $tabs ) {
- $tabs['gallery'] = str_replace( __( 'Gallery','techozoic' ), __( 'Previously Uploaded','techozoic' ), $tabs['gallery'] );
+ $tabs['gallery'] = str_replace( __( 'Gallery', 'optionsframework' ), __( 'Previously Uploaded', 'optionsframework' ), $tabs['gallery'] );
return $tabs;
}
}
View
28 admin/options-sanitize.php
@@ -14,10 +14,6 @@ function of_sanitize_textarea($input) {
add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
-/* Info */
-
-add_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' );
-
/* Select */
add_filter( 'of_sanitize_select', 'of_sanitize_enum', 10, 2);
@@ -34,9 +30,9 @@ function of_sanitize_textarea($input) {
function of_sanitize_checkbox( $input ) {
if ( $input ) {
- $output = "1";
+ $output = '1';
} else {
- $output = "0";
+ $output = '0';
}
return $output;
}
@@ -84,8 +80,6 @@ function of_sanitize_allowedtags($input) {
return $output;
}
-add_filter( 'of_sanitize_info', 'of_sanitize_allowedtags' );
-
/* Allowed Post Tags */
function of_sanitize_allowedposttags($input) {
@@ -158,23 +152,31 @@ function of_sanitize_background_attachment( $value ) {
/* Typography */
-function of_sanitize_typography( $input ) {
+function of_sanitize_typography( $input, $option ) {
+
$output = wp_parse_args( $input, array(
'size' => '',
'face' => '',
'style' => '',
'color' => ''
) );
+
+ if ( isset( $option['options']['faces'] ) ) {
+ if ( array_key_exists( $input['face'], $option['options']['faces'] ) ) {
+ $output['face'] = $input['face'];
+ }
+ }
+ else {
+ $output['face'] = apply_filters( 'of_font_face', $output['face'] );
+ }
$output['size'] = apply_filters( 'of_font_size', $output['size'] );
- $output['face'] = apply_filters( 'of_font_face', $output['face'] );
$output['style'] = apply_filters( 'of_font_style', $output['style'] );
$output['color'] = apply_filters( 'of_color', $output['color'] );
return $output;
}
-add_filter( 'of_sanitize_typography', 'of_sanitize_typography' );
-
+add_filter( 'of_sanitize_typography', 'of_sanitize_typography', 10, 2 );
function of_sanitize_font_size( $value ) {
$recognized = of_recognized_font_sizes();
@@ -184,7 +186,7 @@ function of_sanitize_font_size( $value ) {
}
return (int) apply_filters( 'of_default_font_size', $recognized );
}
-add_filter( 'of_font_face', 'of_sanitize_font_face' );
+add_filter( 'of_font_face', 'of_sanitize_font_size' );
function of_sanitize_font_style( $value ) {
View
8 archive.php
@@ -9,7 +9,7 @@
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
- <h2 class="pagetitle"><?php printf(__('Archive for the %s Category','techozoic'), single_cat_title('',false)); ?></h2>
+ <h2 class="pagetitle"><?php printf(__('%s Archive','techozoic'), single_cat_title('',false)); ?></h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="pagetitle"><?php printf(__('Archive for %s' ,'techozoic'), get_the_time('F jS, Y')); ?></h2>
@@ -32,9 +32,9 @@
<?php }
}?>
<div class="navigation">
-<div class="alignleft"><?php posts_nav_link(' ',' ',__('&laquo; Older Entries' , 'techozoic')) ?></div>
-<div class="alignright"><?php posts_nav_link(' ',__('Newer Entries &raquo;' , 'techozoic'),' ') ?></div>
- </div>
+ <div class="alignleft"><?php next_posts_link(__('&laquo; Older Entries' , 'techozoic')) ?></div>
+ <div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;' , 'techozoic')) ?></div>
+</div>
<?php get_template_part( 'loop' , 'archive'); ?>
</div>
View
7 changelog.php
@@ -4,6 +4,13 @@
<p>
<br />
<h2>Change Log</h2>
+<h3>Version 2.0.4</h3><br />
+- Added two new navigation styles, Ribbon and Square. <br />
+- Added more color choices for navigation menus. <br />
+- Added option to specify width of navigation menu sub menus. <br />
+- Added ability to specify two Google Web fonts. <br />
+- Romanian Translation ,<img src="http://mobirout.com/uploads/ro.gif" alt="Romanian translation" /> Web Geek Science (<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>)<br />
+- New post author block on single post screens, if user bio is filled out on profile page it is displayed along with gravatar. <br />
<h3>Version 2.0.3</h3><br />
- Updated Social Media icons to GPL licensed - Elegant Media Icons. <br />
- Cleaned out old unused images and files.<br />
View
165 functions.php
@@ -53,7 +53,7 @@
*/
function techozoic_setup() {
- global $content_width;
+ global $content_width, $wp_version;
load_theme_textdomain( 'techozoic', get_template_directory() . '/languages');
$locale = get_locale();
$locale_file = get_template_directory() . "/languages/$locale.php";
@@ -76,41 +76,66 @@ function techozoic_setup() {
'footer' => __('Footer Navigation', 'techozoic'),
) );
//WP Navigation Menu
- add_theme_support( 'custom-header', array( 'random-default' => true ) );
- //WP Custom Header - random roation by default
- define( 'HEADER_TEXTCOLOR', '' );
- define( 'HEADER_IMAGE', '' );
- define( 'HEADER_IMAGE_HEIGHT', of_get_option('header_height','200') );
- define( 'HEADER_IMAGE_WIDTH', of_get_option('header_width','1000') );
- define('NO_HEADER_TEXT', true );
- add_custom_image_header( 'techozoic_header_style', 'techozoic_admin_header_style', 'techozoic_admin_header_image' );
+ if (version_compare($wp_version, '3.4' , '>=')){
+ add_theme_support( 'custom-header', array(
+ // Header image default
+ 'default-image' => get_template_directory_uri() . '/images/headers/Grunge.jpg',
+ // Header text display default
+ 'header-text' => false,
+ // Header text color default
+ 'default-text-color' => '000',
+ // Header image width (in pixels)
+ 'width' => of_get_option('header_width','1000'),
+ 'flex-width' => true,
+ // Header image height (in pixels)
+ 'height' => of_get_option('header_height','200'),
+ 'flex-height' => true,
+ // Header image random rotation default
+ 'random-default' => true,
+ // Template header style callback
+ 'wp-head-callback' => 'techozoic_header_style',
+ // Admin header style callback
+ 'admin-head-callback' => 'techozoic_admin_header_style',
+ // Admin preview style callback
+ 'admin-preview-callback' => 'techozoic_admin_header_image'
+ ) );
+ } else {
+ add_theme_support( 'custom-header', array( 'random-default' => true ) );
+ //WP Custom Header - random roation by default
+ define( 'HEADER_TEXTCOLOR', '' );
+ define( 'HEADER_IMAGE', '' );
+ define( 'HEADER_IMAGE_HEIGHT', of_get_option('header_height','200') );
+ define( 'HEADER_IMAGE_WIDTH', of_get_option('header_width','1000') );
+ define('NO_HEADER_TEXT', true );
+ add_custom_image_header( 'techozoic_header_style', 'techozoic_admin_header_style', 'techozoic_admin_header_image' );
+ }
register_default_headers( array(
- 'grunge' => array(
- 'url' => '%s/images/headers/Grunge.jpg',
- 'thumbnail_url' => '%s/images/headers/Grunge-thumbnail.jpg',
- 'description' => __( 'Grunge', 'techozoic' )
- ),
- 'landscape' => array(
- 'url' => '%s/images/headers/Landscape.jpg',
- 'thumbnail_url' => '%s/images/headers/Landscape-thumbnail.jpg',
- 'description' => __( 'Landscape', 'techozoic' )
- ),
- 'random_lines_1' => array(
- 'url' => '%s/images/headers/Random_Lines_1.jpg',
- 'thumbnail_url' => '%s/images/headers/Random_Lines_1-thumbnail.jpg',
- 'description' => __( 'Random Lines 1', 'techozoic' )
- ),
- 'random_lines_2' => array(
- 'url' => '%s/images/headers/Random_Lines_2.jpg',
- 'thumbnail_url' => '%s/images/headers/Random_Lines_2-thumbnail.jpg',
- 'description' => __( 'Random Lines 2', 'techozoic' )
- ),
- 'technology' => array(
- 'url' => '%s/images/headers/Technology.jpg',
- 'thumbnail_url' => '%s/images/headers/Technology-thumbnail.jpg',
- 'description' => __( 'Technology', 'techozoic' )
- ),
- ) );
+ 'grunge' => array(
+ 'url' => '%s/images/headers/Grunge.jpg',
+ 'thumbnail_url' => '%s/images/headers/Grunge-thumbnail.jpg',
+ 'description' => __( 'Grunge', 'techozoic' )
+ ),
+ 'landscape' => array(
+ 'url' => '%s/images/headers/Landscape.jpg',
+ 'thumbnail_url' => '%s/images/headers/Landscape-thumbnail.jpg',
+ 'description' => __( 'Landscape', 'techozoic' )
+ ),
+ 'random_lines_1' => array(
+ 'url' => '%s/images/headers/Random_Lines_1.jpg',
+ 'thumbnail_url' => '%s/images/headers/Random_Lines_1-thumbnail.jpg',
+ 'description' => __( 'Random Lines 1', 'techozoic' )
+ ),
+ 'random_lines_2' => array(
+ 'url' => '%s/images/headers/Random_Lines_2.jpg',
+ 'thumbnail_url' => '%s/images/headers/Random_Lines_2-thumbnail.jpg',
+ 'description' => __( 'Random Lines 2', 'techozoic' )
+ ),
+ 'technology' => array(
+ 'url' => '%s/images/headers/Technology.jpg',
+ 'thumbnail_url' => '%s/images/headers/Technology-thumbnail.jpg',
+ 'description' => __( 'Technology', 'techozoic' )
+ ),
+ ) );
}
/**
@@ -213,6 +238,24 @@ function techozoic_theme_logo(){
}
/**
+ * Techozoic mobile css
+ *
+ * Enques mobile css if option is set will be incorparated into main style.css
+ * soon
+ *
+ * @access private
+ * @since 2.0.4
+ */
+if (of_get_option('mobile_css','0') == "1" ){
+ add_action('wp_enqueue_scripts','tech_enque_mobile');
+}
+
+function tech_enque_mobile() {
+ wp_register_style( 'tech-mobile', get_stylesheet_directory_uri() . '/mobile.css', false, 0.1 );
+ wp_enqueue_style( 'tech-mobile' );
+}
+
+/**
* Techozoic custom menu walker
*
* Outputs custom menu class if menu has children.
@@ -221,6 +264,7 @@ function techozoic_theme_logo(){
* @since 2.0
*/
+
class techozoic_menu_walker extends Walker_Nav_Menu {
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ){
@@ -268,6 +312,28 @@ function start_el(&$output, $item, $depth, $args) {
}
/**
+ * Techozoic change fonts
+ *
+ * Addes additional fonts to options framework for Google Web Fonts
+ *
+ * @access private
+ * @since 2.0.4
+ */
+add_action('admin_init','optionscheck_change_font', 10,2);
+
+function optionscheck_change_font(){
+ add_filter ( 'of_recognized_font_faces','tech_change_fonts');
+}
+
+function tech_change_fonts($fonts){
+ $google_fonts = array(
+ 'google1' => 'Google Font 1',
+ 'google2' => 'Google Font 2'
+ );
+ return array_merge($fonts, $google_fonts);
+}
+
+/**
* Techozoic change saniziation
*
* Removes standard options page filter and applies custom filter
@@ -557,15 +623,11 @@ function tech_excerpt_filter($text){
add_action('wp_enqueue_scripts','tech_google_font');
function tech_google_font() {
- global $tech;
- $font_name = of_get_option('google_font_family','');
- $tech_google_font = str_ireplace(' ', '+', $font_name);
- $tech_google_font_decoration = of_get_option('google_font_decoration','none');
- if ($tech_google_font_decoration != "none"){
- wp_enqueue_style('google_fonts' , "http://fonts.googleapis.com/css?family={$tech_google_font}:{$tech_google_font_decoration}", '', '', 'screen');
- } else {
- wp_enqueue_style('google_fonts' , "http://fonts.googleapis.com/css?family={$tech_google_font}", '', '', 'screen');
- }
+ $font_name1 = of_get_option('google_font_family','');
+ $tech_google_font1 = str_ireplace(' ', '+', $font_name1);
+ $font_name2 = of_get_option('google_font_family_2','');
+ $tech_google_font2 = str_ireplace(' ', '+', $font_name2);
+ wp_enqueue_style('google_fonts' , "http://fonts.googleapis.com/css?family={$tech_google_font1}|{$tech_google_font2}", '', '', 'screen');
}
@@ -702,6 +764,8 @@ function tech_footer_text(){
function tech_show_sidebar($loc) {
if (of_get_option('column','3') > 1) {
+ $left = 0;
+ $right = 0;
switch (of_get_option('sidebar_pos','3-col')) {
case "3-col":
$left = 1;
@@ -812,11 +876,11 @@ function tech_social_icons($home=true){
* @since 1.8.8
*/
-function tech_about_icons($fb=0,$my=0,$twitter=0){
- global $tech;
- $fb_profile = $tech['facebook_profile'];
- $my_profile = $tech['myspace_profile'];
- $twitter_profile = $tech['twitter_profile'];
+function tech_about_icons($fb=0,$my=0,$twitter=0,$google=0){
+ $fb_profile = of_get_option('facebook_profile','');
+ $my_profile = of_get_option('myspace_profile','');
+ $twitter_profile = of_get_option('twitter_profile', '');
+ $google_profile = of_get_option('google_profile', '');
$image = get_template_directory_uri() . "/images/icons";
if ($fb !=0){
echo "<li><a href=\"{$fb_profile}\" title=\"".__('Follow me on Facebook','techozoic')."\"><img src=\"{$image}/facebook_32.png\"></a></li>";
@@ -827,6 +891,9 @@ function tech_about_icons($fb=0,$my=0,$twitter=0){
if ($twitter !=0){
echo "<li><a href=\"{$twitter_profile}\" title=\"".__('Follow me on Twitter','techozoic')."\"><img src=\"{$image}/twitter_32.png\"></a></li>";
}
+ if ($google !=0){
+ echo "<li><a href=\"{$google_profile}\" title=\"".__('Follow me on Google+','techozoic')."\"><img src=\"{$image}/google_32.png\"></a></li>";
+ }
}
/**
View
2 functions/tech-comments-functions.php
@@ -23,7 +23,7 @@ function techozoic_comment($comment, $args, $depth) {
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID( ); ?>">
<div id="comment-<?php comment_ID( ); ?>">
- <div class="avatar_cont"><?php echo get_avatar( get_comment_author_email(), '50' ); ?></div>
+ <div class="avatar_cont"><?php echo get_avatar( $comment, '50' ); ?></div>
<?php printf(__('Comment by %s','techozoic'),'<em>'.get_comment_author_link().'</em>'); ?>:
<?php if ($comment->comment_approved == '0') {
?> <em><?php _e('Your comment is awaiting moderation.' ,'techozoic') ?></em>
View
221 functions/tech-css.php
@@ -12,41 +12,50 @@
add_action('wp_head','tech_head_css');
}
-function tech_google_font_family($where) {
- $classes = of_get_option('font_headings','');
- if(is_array($classes)){
- foreach($classes as $key => $value){
- if ($value == '1' && $key == $where){
- return of_get_option('google_font_family','') . ', ';
- }
- }
+function tech_google_font_family($font){
+ $tech_google1 = of_get_option('google_font_family', '');
+ $tech_google2 = of_get_option('google_font_family_2', '');
+ if (stripos($tech_google1, ':') !== false){
+ $tech_google1 = explode( ':' , $tech_google1);
+ $tech_google1 = $tech_google1[0];
+ }
+ if (stripos($tech_google2, ':') !== false){
+ $tech_google2 = explode( ':' , $tech_google2);
+ $tech_google2 = $tech_google2[0];
}
+ $font['face'] = ($font['face'] == 'google1') ? $tech_google1 : $font['face'];
+ $font['face'] = ($font['face'] == 'google2') ? $tech_google2 : $font['face'];
+ return $font;
}
+
function tech_head_css(){
$tech_blog_title_display = '';
$tech_blog_title_cursor = '';
- $tech_header_font = of_get_option('post_heading',array('size'=>"20px",'face'=>'verdana','style'=>'bold','color'=>'#2C4353'));
- $tech_main_heading_font = of_get_option('main_heading_font',array('size'=>"30px",'face'=>'verdana','style'=>'bold','color'=>'#A0B3C2'));
- $tech_sidebar_font = of_get_option('side_heading_font',array('size'=>"16px",'face'=>'verdana','style'=>'bold','color'=>'#2C4353'));
- $tech_body_font = of_get_option('body_font',array('size'=>"10px",'face'=>'arial','style'=>'','color'=>'#2C4353'));
- $tech_post_font = of_get_option('post_text_font', array('size'=>"10px",'face'=>'arial','style'=>'','color'=>'#2C4353'));
- $tech_small_font = of_get_option('small_font',array('size'=>"9px",'face'=>'arial','style'=>'','color'=>'#777777'));
- $tech_nav_font = of_get_option('nav_font',array('size'=>"13px",'face'=>'verdana','style'=>'bold','color'=>'#A0B3C2'));
+ $tech_header_font = tech_google_font_family(of_get_option('post_heading',array('size'=>"20px",'face'=>'verdana','style'=>'bold','color'=>'#2C4353')));
+ $tech_main_heading_font = tech_google_font_family(of_get_option('main_heading_font',array('size'=>"30px",'face'=>'verdana','style'=>'bold','color'=>'#A0B3C2')));
+ $tech_sidebar_font = tech_google_font_family(of_get_option('side_heading_font',array('size'=>"16px",'face'=>'verdana','style'=>'bold','color'=>'#2C4353')));
+ $tech_body_font = tech_google_font_family(of_get_option('body_font',array('size'=>"10px",'face'=>'arial','style'=>'','color'=>'#2C4353')));
+ $tech_post_font = tech_google_font_family(of_get_option('post_text_font', array('size'=>"10px",'face'=>'arial','style'=>'','color'=>'#2C4353')));
+ $tech_small_font = tech_google_font_family(of_get_option('small_font',array('size'=>"10px",'face'=>'arial','style'=>'','color'=>'#777777')));
+ $tech_nav_font = tech_google_font_family(of_get_option('nav_font',array('size'=>"13px",'face'=>'verdana','style'=>'bold','color'=>'#A0B3C2')));
$tech_header_align = strtolower(of_get_option('header_align','center'));
$tech_header_v_align = strtolower(of_get_option('header_v_align','center'));
$tech_bg_image = of_get_option('bg_image',array('color' => '', 'image' => '', 'repeat' => 'repeat','position' => 'top center','attachment'=>'scroll'));
$tech_page_width = of_get_option('page_width','90');
$tech_main_column_width = of_get_option('main_column_width','50');
$tech_l_sidebar_width = of_get_option('l_sidebar_width','25');
- $tech_r_sidebar_width = of_get_option('l_sidebar_width','25');
+ $tech_r_sidebar_width = of_get_option('r_sidebar_width','25');
$tech_header_height = of_get_option('header_height','200');
$tech_sidebar_pos = of_get_option('sidebar_pos','3-col');
$tech_content_bg_image = of_get_option('content_bg_image',array('color' => '', 'image' => '', 'repeat' => 'repeat','position' => 'top center','attachment'=>'scroll'));
- if (of_get_option('page_type','fluid') == 'fixed'){$tech_sign = 'px';} else {$tech_sign = '%';}
+ $tech_nav_margin = of_get_option('nav_button_margin' , '3');
+ $tech_menu_width = of_get_option('nav_menu_width', '250');
+ if (of_get_option('page_type','fluid') == 'fixed'){$tech_sign = 'px';} else {$tech_sign = '%';}
if (of_get_option('page_type','fluid') == 'fluid' && $tech_page_width > 101) $tech_page_width = '100';
if (of_get_option('page_type','fluid') == 'fluid' && ($tech_page_width > 100 || $tech_page_width < 0) ) { $tech_page_width = '95'; $tech_sign = '%';}
if (of_get_option('blog_title','1') == '0' || of_get_option('header_logo','') != '') $tech_blog_title_display = 'display:none';
if (of_get_option('blog_title_text','single') == 'single') $tech_blog_title_cursor = 'cursor:default;';
+ $tech_page_overflow = (of_get_option('nav_type', 'square') != 'ribbon') ? 'overflow:hidden' : '';
$tech_logo_top = of_get_option('header_logo_top','0');
$tech_logo_left = of_get_option('header_logo_left','0');
$tech_blog_title_align_check ="";
@@ -73,21 +82,12 @@ function tech_head_css(){
break;
}
- $tech_blog_title_font = tech_google_font_family('main') . $tech_main_heading_font['face'];
- $tech_h1_font = tech_google_font_family('h1') . $tech_header_font['face'];
- $tech_h2_font = tech_google_font_family('h2') . $tech_header_font['face'];
- $tech_h3_font = tech_google_font_family('h3') . $tech_header_font['face'];
- $tech_h4_font = tech_google_font_family('h4') . $tech_header_font['face'];
- $tech_h5_font = tech_google_font_family('h5') . $tech_header_font['face'];
- $tech_sidebar_font_face = tech_google_font_family('sidebar') . $tech_sidebar_font['face'];
- $tech_post_title_font = tech_google_font_family('post') . $tech_header_font['face'];
-
- $tech_color_scheme = of_get_option('color_scheme','custom');
+ $tech_color_scheme = of_get_option('color_scheme','custom');
$tech_default_color = array(
- "blue" => array ('#A0B3C2','#A0B3C2','#597EAA','#114477','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7'),
- "khaki" => array ('#c7c69a','#c7c69a','#6E0405','#B53839','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7'),
- "red" => array ('#AB2222','#AB2222','#D33535','#B53839','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7'),
- "grunge" => array ('#534E3E','#534E3E','#78BFBF','#78BFBF','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7')
+ "blue" => array ('#A0B3C2','#A0B3C2','#597EAA','#114477','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7', '#EFEFEF','#A0B3C2','#A0B3C2','#F7F7F7','#E3E3E3','#CCCCCC','#A0B3C2'),
+ "khaki" => array ('#c7c69a','#c7c69a','#6E0405','#B53839','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7', '#C7C69A','#f7f7f7','#C7C69A','#F7F7F7','#E3E3E3','#CCCCCC','#6E0405'),
+ "red" => array ('#AB2222','#AB2222','#D33535','#B53839','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7', '#EFEFEF','#B53839','#B53839','#F7F7F7','#E3E3E3','#CCCCCC','#D33535'),
+ "grunge" => array ('#534E3E','#534E3E','#78BFBF','#78BFBF','#2C4353','#2C4353','#E3E3E3','#E3E3E3','#F7F7F7', '#EFEFEF','#534E3E','#534E3E','#F7F7F7','#E3E3E3','#CCCCCC','#78BFBF')
);
$tech_color_names = array('blue','khaki','red','grunge');
if (in_array($tech_color_scheme, $tech_color_names)){
@@ -103,6 +103,13 @@ function tech_head_css(){
$tech_nav_bg_trans = '0';
$tech_post_bg_trans = '0';
$tech_content_bg_trans = '0';
+ $tech_nav_hov_bg_color = $tech_default_color[$tech_color_scheme][9];
+ $tech_nav_hov_text_color = $tech_default_color[$tech_color_scheme][10];
+ $tech_nav_active_bg_color = $tech_default_color[$tech_color_scheme][11];
+ $tech_nav_active_text_color =$tech_default_color[$tech_color_scheme][12];
+ $tech_nav_bg_gradient_top = $tech_default_color[$tech_color_scheme][13];
+ $tech_nav_bg_gradient_bot = $tech_default_color[$tech_color_scheme][14];
+ $tech_nav_font['color'] = $tech_default_color[$tech_color_scheme][15];
} elseif ($tech_color_scheme == 'custom'){
$tech_bg_color = of_get_option('cust_bg_color1','#A0B3C2');
$tech_bg_trans = of_get_option('cust_bg_trans1','0');
@@ -116,6 +123,12 @@ function tech_head_css(){
$tech_post_bg_trans = of_get_option('cust_post_bg_trans1','0');
$tech_content_bg_color = of_get_option('cust_content_bg_color1','#F7F7F7');
$tech_content_bg_trans = of_get_option('cust_content_bg_trans1','0');
+ $tech_nav_hov_bg_color = of_get_option('cust_nav_hov_bg_color1' ,'#EFEFEF');
+ $tech_nav_hov_text_color = of_get_option('cust_nav_hov_text_color1', '#A0B3C2');
+ $tech_nav_active_bg_color = of_get_option('cust_nav_active_bg_color1', '#A0B3C2');
+ $tech_nav_active_text_color = of_get_option('cust_nav_active_text_color1', '#F7F7F7');
+ $tech_nav_bg_gradient_top = of_get_option('cust_nav_bg_gradient_top', '#E3E3E3');
+ $tech_nav_bg_gradient_bot = of_get_option('cust_nav_bg_gradient_bot', '#CCCCCC');
}
$tech_nav_ul_bg_color = $tech_nav_bg_color;
if ($tech_bg_trans == '1') $tech_bg_color = 'transparent';
@@ -151,25 +164,23 @@ function tech_head_css(){
}
}
}
-
$css_var = '<style type="text/css">';
$css_var .= <<<CSS
/*Variable Styles*/
#page{
background:{$tech_content_bg_color} url({$tech_content_bg_image['image']}) {$tech_content_bg_image['repeat']} {$tech_content_bg_image['position']} {$tech_content_bg_image['attachment']};
+{$tech_page_overflow};
}
body{
-font-family:{$tech_body_font['face']}, Sans-Serif;
-font-size: {$tech_body_font['size']};
+font:{$tech_body_font['style']} {$tech_body_font['size']} {$tech_body_font['face']}, Sans-Serif;
background:{$tech_bg_color} url({$tech_bg_image['image']}) {$tech_bg_image['repeat']} {$tech_bg_image['position']} {$tech_bg_image['attachment']};
}
.techozoic_font_size{
font-size: {$tech_body_font['size']}px;
}
.narrowcolumn .entry,.widecolumn .entry, .top {
-font-family:{$tech_body_font['face']}, Sans-Serif;
-font-size:{$tech_body_font['size']}px;
-color: {$tech_body_font['color']};
+font:{$tech_post_font['style']} {$tech_post_font['size']} {$tech_post_font['face']}, Sans-Serif;
+color: {$tech_post_font['color']};
}
{$tech_post_bg_color_classes}{
background-color:{$tech_post_bg_color};
@@ -178,37 +189,40 @@ function tech_head_css(){
.top{
border:none;
}
-h1{
-font-family:{$tech_h1_font}, Sans-Serif;
-}
-h2{
-font-family:{$tech_h2_font}, Sans-Serif;
-}
-h3{
-font-family:{$tech_h3_font}, Sans-Serif;
-}
-h4{
-font-family:{$tech_h4_font}, Sans-Serif;
-}
-h5{
-font-family:{$tech_h5_font}, Sans-Serif;
-}
.blog_title, .blog_title a, .blog_title a:hover, .blog_title a:visited{
-font:{$tech_main_heading_font['style']} {$tech_main_heading_font['size']} {$tech_blog_title_font}, Sans-Serif;
+font:{$tech_main_heading_font['style']} {$tech_main_heading_font['size']} {$tech_main_heading_font['face']}, Sans-Serif;
color: {$tech_main_heading_font['color']};
}
h1.post_title{
-font-family:{$tech_post_title_font}, Sans-Serif;
+font:{$tech_header_font['style']} {$tech_header_font['size']} {$tech_header_font['face']}, Sans-Serif;
color:{$tech_header_font['color']} !important;
-font-size: {$tech_header_font['size']};
}
.post_title a{
-font-family:{$tech_post_title_font}, Sans-Serif;
+font:{$tech_header_font['style']} {$tech_header_font['size']} {$tech_header_font['face']}, Sans-Serif;
color:{$tech_header_font['color']} !important;
-font-size: {$tech_header_font['size']};
+}
+.entry h1{
+font:{$tech_header_font['style']} 3em {$tech_header_font['face']}, Sans-Serif;
+color: {$tech_header_font['color']} !important;
+}
+.entry h2{
+font:{$tech_header_font['style']} 2em {$tech_header_font['face']}, Sans-Serif;
+color: {$tech_header_font['color']} !important;
+}
+.entry h3{
+font:{$tech_header_font['style']} 1.4em {$tech_header_font['face']}, Sans-Serif;
+color: {$tech_header_font['color']} !important;
+}
+.entry h4{
+font:{$tech_header_font['style']} 1.3em {$tech_header_font['face']}, Sans-Serif;
+color: {$tech_header_font['color']} !important;
+}
+.entry h5{
+font:{$tech_header_font['style']} 1.2em {$tech_header_font['face']}, Sans-Serif;
+color: {$tech_header_font['color']} !important;
}
.sidebar h2, .sidebar h3, #footer h2{
-font-family:{$tech_sidebar_font_face}, Sans-Serif;
+font: {$tech_sidebar_font['style']} {$tech_sidebar_font['size']} {$tech_sidebar_font['face']}, Sans-Serif;
color:{$tech_sidebar_font['color']};
}
.widgettitle {
@@ -218,11 +232,15 @@ function tech_head_css(){
#content {
font-size: {$tech_post_font['size']};
}
-acronym,abbr,span.caps,small,.trackback li,.sidebar {
+acronym,abbr,span.caps,small,.trackback li,.sidebar, .postmetadata {
font-size: {$tech_small_font['size']};
}
-.description, ul#nav a, ul#admin a, #dropdown li.current_page_item a:hover, .top-menu li.current-menu-item a:hover, #dropdown li.current_page_item ul a, .top-menu li.current-menu-item ul a, ul#nav li.current_page_item a:hover, #nav2 a, #nav2 li.current_page_item a:hover,#subnav a, #subnav a:visited, #dropdown a, #navmenu .top-menu li a, #navmenu .top-menu li.current-menu-item a{
-color: {$tech_acc_color};
+.postmetadata{
+font: {$tech_small_font['style']} {$tech_small_font['size']} {$tech_small_font['face']}, Sans-Serif;
+color: {$tech_small_font['color']};
+}
+ul#nav a, ul#admin a, #dropdown li.current_page_item a:hover, .top-menu li.current-menu-item a:hover, #dropdown li.current_page_item ul a, .top-menu li.current-menu-item ul a, ul#nav li.current_page_item a:hover, {
+color: {$tech_nav_font['color']};
}
.author,#searchform #s, #searchsubmit:hover,#catsubmit:hover,#wp-submit:hover,.postform,#TB_ajaxContent {
background-color: {$tech_acc_color} ;
@@ -231,37 +249,76 @@ function tech_head_css(){
/*background-color: {$tech_nav_bg_color};*/
}
ul#admin li a, ul#dropdown li a, #navmenu .top-menu li a{
-font-family:{$tech_nav_font['face']}, Sans-Serif;
+font-style: {$tech_nav_font['style']};
font-size:{$tech_nav_font['size']};
+font-family: {$tech_nav_font['face']}, Sans-Serif;
color:{$tech_nav_font['color']};
}
-#navmenu .top-menu li, #navmenu .top-menu ul.sub-menu{
-background-color: {$tech_nav_ul_bg_color};
+ul#admin li a:hover, ul#dropdown li a:hover, #navmenu .top-menu li a:hover{
+color: {$tech_nav_hov_text_color};
+}
+ul#dropdown > li, ul.top-menu > li{
+margin: 0 {$tech_nav_margin}px;
+}
+.ribbon ul.top-menu > li, .square ul.top-menu > li{
+margin: 0;
+padding: 0 {$tech_nav_margin}px;
+}
+.ribbon ul.top-menu > li.has_children:hover:after, .square ul.top-menu > li.has_children:hover:after {
+border-bottom: 5px solid {$tech_nav_ul_bg_color};
+}
+#dropdown ul, .top-menu ul{
+background-color: {$tech_nav_bg_gradient_top};
+}
+.ribbon, .square{
+background-color: {$tech_nav_bg_gradient_top};
+background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from({$tech_nav_bg_gradient_top}), to({$tech_nav_bg_gradient_bot}));
+background-image: -webkit-linear-gradient(top, {$tech_nav_bg_gradient_top}, {$tech_nav_bg_gradient_bot});
+background-image: -moz-linear-gradient(top, {$tech_nav_bg_gradient_top}, {$tech_nav_bg_gradient_bot});
+background-image: -ms-linear-gradient(top, {$tech_nav_bg_gradient_top}, {$tech_nav_bg_gradient_bot});
+background-image: -o-linear-gradient(top, {$tech_nav_bg_gradient_top}, {$tech_nav_bg_gradient_bot});
+background-image: linear-gradient(top, {$tech_nav_bg_gradient_top}, {$tech_nav_bg_gradient_bot});
+filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='{$tech_nav_bg_gradient_top}', endColorstr='{$tech_nav_bg_gradient_bot}');
+}
+.ribbon ul.top-menu:before{
+border-right: 10px solid {$tech_nav_bg_gradient_bot};
+}
+.ribbon ul.top-menu:after{
+border-left: 10px solid {$tech_nav_bg_gradient_bot};
}
CSS;
-if($tech_nav_bg_trans != 'On') {
+if($tech_nav_bg_trans != '1') {
$css_var .= <<<CSS
+#navmenu .top-menu li, #navmenu .top-menu ul.sub-menu, ul#admin li{
+background-color: {$tech_nav_ul_bg_color};
+}
#dropdown li.current_page_item, #navmenu .top-menu li.current-menu-item, #navmenu .top-menu ul.sub-menu li.current-menu-item {
-background-color: {$tech_acc_color} ;
+background-color: {$tech_nav_active_bg_color} ;
}
#dropdown li:hover, #navmenu .top-menu li:hover, #navmenu .top-menu ul.sub-menu > li:hover {
-background:#efefef;
+background-color:{$tech_nav_hov_bg_color};
}
-#dropdown li.current_page_item > a, #navmenu .top-menu li.current-menu-item > a{
-color:#f7f7f7;
+#dropdown li.current_page_item > a:hover, #navmenu .top-menu li.current-menu-item > a:hover, #navmenu .top-menu li.current-menu-item:hover > a, #navmenu .top-menu li:hover > a {
+color:{$tech_nav_hov_text_color};
}
-#dropdown li.current_page_item > a:hover, #navmenu .top-menu li.current-menu-item > a:hover{
-color:{$tech_acc_color};
+#dropdown li.current_page_item > a, #navmenu .top-menu li.current-menu-item > a{
+color:{$tech_nav_active_text_color};
}
ul#admin li:hover{
-background:#efefef;
+background:{$tech_nav_hov_bg_color};
box-shadow:2px 1px 3px rgba(0, 0, 0, 0.3);
-moz-box-shadow:2px 1px 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow:2px 1px 3px rgba(0, 0, 0, 0.3);
}
CSS;
} else {
$css_var .= <<<CSS
+#navmenu .top-menu li{
+background-color: transparent;
+}
+#navmenu .top-menu ul.sub-menu{
+background-color: {$tech_nav_ul_bg_color}
+}
#dropdown li.current_page_item, #navmenu .top-menu li.current-menu-item {
background-color: transparent ;
}
@@ -272,12 +329,12 @@ function tech_head_css(){
-webkit-box-shadow:none;
}
#dropdown li.current_page_item > a, #navmenu .top-menu li.current-menu-item > a{
-color:#f7f7f7;
+color:{$tech_nav_active_text_color};
}
-#dropdown li.current_page_item > a:hover, #navmenu .top-menu li.current-menu-item > a:hover{
-color:{$tech_acc_color};
+#dropdown li.current_page_item > a:hover, #navmenu .top-menu li.current-menu-item > a:hover, #navmenu .top-menu li.current-menu-item:hover > a, #navmenu .top-menu li:hover > a{
+color:{$tech_nav_hov_text_color};
}
-ul#admin li:hover{
+ul#admin li:hover, ul#admin li{
background-color:transparent;
box-shadow:none;
-moz-box-shadow:none;
@@ -286,6 +343,12 @@ function tech_head_css(){
CSS;
}
$css_var .= <<<CSS
+#dropdown li ul li, .top-menu li ul li, #dropdown li ul , .top-menu li ul{
+width: {$tech_menu_width}px !important;
+}
+#dropdown li ul ul, .top-menu li ul ul{
+left:{$tech_menu_width}px ;
+}
.post_date {
background-color:{$tech_acc_color};
}
@@ -308,7 +371,7 @@ function tech_head_css(){
a:visited{
color:{$tech_visit_link_color};
}
-ul#nav li.current_page_item a:hover, ul#nav2 li.current_page_item a:hover, ul#nav2 li.current_page_parent a:hover {
+.description {
color:{$tech_acc_color};
}
#headerimg {
@@ -364,7 +427,7 @@ function tech_head_css(){
#page {
width: {$tech_page_width}{$tech_sign};
}
-.narrowcolumn {
+.narrowcolumn, .home .widecolumn {
float:left;
margin:0;
padding:0 2% 20px 3%;
@@ -528,7 +591,7 @@ function tech_head_css(){
if (of_get_option('nav_button_width','0') != '0') {
$tech_nav_button_width = of_get_option('nav_button_width','0');
$css_var .= <<<CSS
-#navmenu ul#nav li, #navmenu ul#admin li, #nav2 li,#dropdown li, #navmenu .top-menu li{
+#navmenu ul#admin li, #nav2 li,#dropdown li, #navmenu .top-menu li{
width: {$tech_nav_button_width}px;
}
CSS;
View
7 functions/tech-widget.php
@@ -224,6 +224,7 @@ function widget( $args, $instance ) {
$gravatar = $instance['gravatar'] ? '1' : '0';
$facebook = $instance['facebook'] ? '1' : '0';
$myspace = $instance['myspace'] ? '1' : '0';
+ $google = $instance['google'] ? '1' : '0';
$twitter = $instance['twitter'] ? '1' : '0';
$about = $instance['about'];
if ( !$number = (int) $instance['number'] )
@@ -245,7 +246,7 @@ function widget( $args, $instance ) {
?> </span><p>
<?php echo $about;
?> <ul class="about_icons">
-<?php tech_about_icons($facebook,$myspace,$twitter);
+<?php tech_about_icons($facebook,$myspace,$twitter,$google);
?> </ul>
</p><div style="clear:both"></div>
<?php echo $after_widget;
@@ -259,6 +260,7 @@ function update( $new_instance, $old_instance ) {
$instance['facebook'] = !empty($new_instance['facebook']) ? 1 : 0;
$instance['myspace'] = !empty($new_instance['myspace']) ? 1 : 0;
$instance['twitter'] = !empty($new_instance['twitter']) ? 1 : 0;
+ $instance['google'] = !empty($new_instance['google']) ? 1 : 0;
$instance['gravatar'] = !empty($new_instance['gravatar']) ? 1 : 0;
$instance['number'] = (int) $new_instance['number'];
return $instance;
@@ -271,6 +273,7 @@ function form( $instance ) {
$facebook = isset($instance['facebook']) ? (bool) $instance['facebook'] : false;
$myspace = isset($instance['myspace']) ? (bool) $instance['myspace'] : false;
$twitter = isset($instance['twitter']) ? (bool) $instance['twitter'] : false;
+ $google = isset($instance['google']) ? (bool) $instance['google'] : false;
$gravatar = isset($instance['gravatar']) ? (bool) $instance['gravatar'] : false;
$number = isset($instance['number']) ? absint($instance['number']) : 50;
?>
@@ -285,6 +288,8 @@ function form( $instance ) {
<br />
<input class="checkbox" type="checkbox" <?php checked($twitter); ?> id="<?php echo $this->get_field_id('twitter'); ?>" name="<?php echo $this->get_field_name('twitter'); ?>" /> <label for="<?php echo $this->get_field_id('twitter'); ?>"><?php _e('Display link to Twitter Profile' ,'techozoic')?></label>
<br />
+ <input class="checkbox" type="checkbox" <?php checked($google); ?> id="<?php echo $this->get_field_id('google'); ?>" name="<?php echo $this->get_field_name('google'); ?>" /> <label for="<?php echo $this->get_field_id('google'); ?>"><?php _e('Display link to Google+ Profile' ,'techozoic')?></label>
+ <br />
<input class="checkbox" type="checkbox" <?php checked($gravatar); ?> id="<?php echo $this->get_field_id('gravatar'); ?>" name="<?php echo $this->get_field_name('gravatar'); ?>" /> <label for="<?php echo $this->get_field_id('gravatar'); ?>"><?php _e('Enable Gravatar' ,'techozoic') ?></label>
</p>
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Size of Gravatar' ,'techozoic') ?></label>
View
49 header.php
@@ -2,8 +2,9 @@
<html <?php language_attributes(); ?> xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php get_bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php
-global $cpage;
+global $cpage, $tech_nav;
if ( is_singular() ){
$tech_nav = get_post_meta($post->ID, "Nav_value", $single = true);
if(empty($tech_nav)){
@@ -87,6 +88,9 @@
<body <?php body_class(); ?>>
<a name="top"></a>
<div id="page">
+<?php if(of_get_option('nav_location','below') == 'above') {
+ get_template_part('nav','wp3');
+}?>
<div id="header">
<?php if ( function_exists('dynamic_sidebar') && is_active_sidebar( 'left_header' ) ){
echo '<div class="hleft">'. "\n";
@@ -146,47 +150,8 @@
</div><!--end header-->
-<?php if (($tech_nav == "on") && (of_get_option('nav_menu','1') == '1')) {
-?>
-<div id="navmenu">
-<?php
- get_template_part('nav','wp3');
-
- if ($tech_nav == "on") {
- if (of_get_option('dashboard_link','1') == "1") {
- if (is_user_logged_in()) { ?>
- <ul id="admin"><li><a href="<?php echo site_url(); ?>/wp-admin" title="<?php _e('Dashboard' ,'techozoic')?>"><?php _e('Dashboard' ,'techozoic')?></a></li>
- <li><a href="<?php echo wp_logout_url(); ?>" title="<?php _e('Log Out' ,'techozoic')?>"><?php