sorry wrong file as you can see i am going crazy. Patience is a.. don’t have it. thanks
<?php
//Define the wp_content DIR for backward compatibility
if (!defined('WP_CONTENT_URL'))
define('WP_CONTENT_URL', get_option('site_url').'/wp-content');
if (!defined('WP_CONTENT_DIR'))
define('WP_CONTENT_DIR', ABSPATH.'/wp-content');
//Define the content width for images
$max_width = 596;
$GLOBALS['content_width'] = 596;
//A function to include files throughout the theme
//It checks to see if the file exists first, so as to avoid error messages.
function get_template_file($filename) {
if (file_exists(TEMPLATEPATH."/$filename"))
include(TEMPLATEPATH."/$filename");
}
//A function to add the custom body background image
add_action('wp_head','flexx_body_bg');
function flexx_body_bg() {
global $wp_theme_options;
$options = array( 'background_image', 'background_color', 'background_position', 'background_attachment', 'background_repeat' );
?>
<style type="text/css">
body {
<?php if ( 'custom_color' == $wp_theme_options['background_option'] ) : ?>
background-color: <?php echo $wp_theme_options['background_color']; ?>;
background-image: none;
<?php else : ?>
<?php foreach ( (array) $options as $option ) : ?>
<?php if ( ! empty( $wp_theme_options[$option] ) ) : ?>
<?php if ( 'background_image' == $option ) : ?>
<?php echo str_replace( '_', '-', $option ); ?>: url(<?php echo $wp_theme_options[$option]; ?>);
<?php else : ?>
<?php echo str_replace( '_', '-', $option ); ?>: <?php echo $wp_theme_options[$option]; ?>;
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
}
</style>
<?php
}
//Theme Options code
include(TEMPLATEPATH."/lib/theme-options/theme-options.php");
//FlexLayout Code
include(TEMPLATEPATH."/lib/flexlayout.php");
//Billboard Code
include(TEMPLATEPATH."/lib/billboard/billboard.php");
//Feedburner Widget Code
include(TEMPLATEPATH."/lib/feedburner-widget/feedburner-widget.php");
add_action( 'ithemes_load_plugins', 'ithemes_functions_after_init' );
function ithemes_functions_after_init() {
//Include Tutorials Page
include(TEMPLATEPATH."/lib/tutorials/tutorials.php");
//FlexLayout Editor Code
include(TEMPLATEPATH.'/lib/flexx-layout-editor/flexx-layout-editor.php');
//Featured Image code
include(TEMPLATEPATH."/lib/featured-images/featured-images.php");
$GLOBALS['iThemesFeaturedImages'] =& new iThemesFeaturedImages( array( 'id_name' => 'title', 'width' => 'container_width', 'height' => '163', 'sleep' => 2, 'fade' => 1 ) );
//Contact Page Template code
include(TEMPLATEPATH."/lib/contact-page-plugin/contact-page-plugin.php");
}
//Unregister troublesome widgets
add_action('widgets_init','unregister_problem_widgets');
function unregister_problem_widgets() {
unregister_sidebar_widget('Calendar');
unregister_sidebar_widget('Search');
unregister_sidebar_widget('Tag_Cloud');
}
//A little SEO action
add_action('wp_meta','it_seo_options');
function it_seo_options() {
//globalize variables
global $post, $wp_theme_options;
//build our excerpt
$post_content = (strlen(strip_tags($post->post_content)) <= 150) ? strip_tags($post->post_content) : substr(strip_tags($post->post_content),0,150);
$post_excerpt = ($post->post_excerpt) ? $post->post_excerpt : $post_content;
//set the description
$description = (is_home()) ? get_bloginfo('description') : $post_excerpt;
//get the tags
foreach((array)get_the_tags($post->ID) as $tag) { $post_tags .= ','. $tag->name; }
$post_tags = substr($post_tags,1); //removing the first "," from the list
//add the follow code to our meta section
echo "\n".'<!--To follow, or not to follow-->'."\n";
if(is_home() || is_single() || is_page()) echo '<meta name="robots" content="index,follow" />'."\n";
elseif($wp_theme_options['cat_index'] != 'no' && is_category()) echo '<meta name="robots" content="index,follow" />'."\n";
elseif(!is_home() && !is_single() && !is_page()) echo '<meta name="robots" content="noindex,follow" />'."\n";
//add the description and keyword code to our meta section
echo '<!--Add Description and Keywords-->'."\n";
if($wp_theme_options['tag_as_keyword'] != 'no' && is_single() && $post_tags) echo '<meta name="keywords" content="'.$post_tags.'" />'."\n";
if(is_home() || is_single() || is_page()) echo '<meta name="description" content="'.$description.'" />'."\n";
}
///Tracking/Analytics Code
function print_tracking() {
global $wp_theme_options;
echo stripslashes($wp_theme_options['tracking']);
}
if ($wp_theme_options['tracking_pos'] == "header")
add_action('wp_head', 'print_tracking');
else //default
add_action('flexx_footer_stats', 'print_tracking');
?>