<file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes() ?>>
	<head>
		<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
		<title><?php global $page, $paged;

				wp_title( '|', true, 'right' );

				// Add the blog name.
				bloginfo( 'name' );

				// Add the blog description for the home/front page.
				$site_description = get_bloginfo( 'description', 'display' );
				if ( $site_description && ( is_home() || is_front_page() ) )
				echo " | $site_description";

				// Add a page number if necessary:
				if ( $paged >= 2 || $page >= 2 )
					echo ' | ' . sprintf( __( 'Page %s', 'designcrumbs' ), max( $paged, $page ) ); ?>
		</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
		<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS" href="<?php bloginfo('rss2_url'); ?>" />
		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
		
		<!-- CSS -->
		<style type="text/css">
		a {
			color:<?php echo stripslashes(of_get_option('link_color')); ?>;
		}
		ul.commentlist .bypostauthor img.avatar {
			border:1px solid <?php echo stripslashes(of_get_option('link_color')); ?>;
		}
		</style>
		<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
		
		<?php wp_head(); //leave for plugins ?>
	
		<?php if (of_get_option('favicon') != '') { ?>
		<link rel="shortcut icon" href="<?php echo stripslashes(of_get_option('favicon')) ?>" />
		<?php } ?>
	</head>
	<body <?php body_class(''. stripslashes(of_get_option('layout')) .' '. stripslashes(of_get_option('bg_pattern')) .' '. stripslashes(of_get_option('body_display')) .' scheme_'. stripslashes(of_get_option('color_scheme')) .''); ?>>
		<div id="main_wrap">
			<div class="wrapper" id="header">
				<div id="pre_header"></div>
				<div class="container">
					<div id="logo_wrap">
						<div id="the_logo">
							<?php if (of_get_option('logo') != '') { ?>
							<a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>" class="left the_logo">
								<img src="<?php echo stripslashes(of_get_option('logo')); ?>" alt="<?php bloginfo('name'); ?>" id="logo" />
							</a>
							<?php } else { ?>
								<h1><a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
							<?php } ?>					
						</div>
						<?php get_search_form(); ?>
						<div class="clear"></div>
					</div>
					<div id="clear"></div>
				</div>
				<div id="main_menu">
					<div class="container">
						<div id="main_menu_wrap">
						<?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => '9' ) ); ?>
						<?php if (of_get_option('donate_link') != '') { ?>
							<a id="donate_now" class="button" href="<?php echo stripslashes(of_get_option('donate_link')); ?>" title="<?php echo stripslashes(of_get_option('donate_text')); ?>" target="_blank"><?php echo stripslashes(of_get_option('donate_text')); ?></a>
						<?php } ?>
						</div>
					</div>
				</div>
			</div>
			<div class="wrapper" id="content"> <!-- #content ends in footer.php -->
				<div class="container">		<file_sep><?php
/**
 * A unique identifier is defined to store the options in the database and reference them from the theme.
 * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
 * If the identifier changes, it'll appear as if the options have been reset.
 * 
 */

function optionsframework_option_name() {

	// This gets the theme name from the stylesheet (lowercase and without spaces)
	$themename = get_theme_data(STYLESHEETPATH . '/style.css');
	$themename = $themename['Name'];
	$themename = preg_replace("/\W/", "", strtolower($themename) );
	
	$optionsframework_settings = get_option('optionsframework');
	$optionsframework_settings['id'] = $themename;
	update_option('optionsframework', $optionsframework_settings);
	
	// echo $themename;
}

/**
 * Defines an array of options that will be used to generate the settings page and be saved in the database.
 * When creating the "id" fields, make sure to use all lowercase and no spaces.
 *  
 */

function optionsframework_options() {

	$heading_fonts = array("bitter" => "Bitter","droidsans" => "Droid Sans","droidserif" => "Droid Serif","franchise" => "Franchise","museo" => "Museo Slab","ubuntu" => "Ubuntu","rokkitt" => "Rokkitt");
	
	// Pull all the categories into an array
	$options_categories = array();  
	$options_categories_obj = get_categories();
	foreach ($options_categories_obj as $category) {
    	$options_categories[$category->cat_ID] = $category->cat_name;
	}
	
	// Pull all the pages into an array
	$options_pages = array();  
	$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
	$options_pages[''] = __('Select a page:', 'designcrumbs');
	foreach ($options_pages_obj as $page) {
    	$options_pages[$page->ID] = $page->post_title;
	}
		
	// If using image radio buttons, define a directory path
	$imagepath =  get_template_directory_uri() . '/images/';
		
	$options = array();
		
	$options[] = array( "name" => __('Basic Settings', 'designcrumbs'),
						"type" => "heading");
						
	$options[] = array( "name" => __('Logo', 'designcrumbs'),
						"desc" => __('Upload your logo. Height should be 80px, if it is bigger, it will be resized.', 'designcrumbs'),
						"id" => "logo",
						"type" => "upload");
						
	$options[] = array( "name" => __('Favicon', 'designcrumbs'),
						"desc" => __('The Favicon is the little 16x16 icon that appears next to your URL in the browser. It is not required, but recommended.', 'designcrumbs'),
						"id" => "favicon",
						"type" => "upload");
						
	$options[] = array( "name" => __('Site Layout', 'designcrumbs'),
						"desc" => __('Select a layout for the site.', 'designcrumbs'),
						"id" => "layout",
						"std" => "content_left",
						"type" => "images",
						"options" => array(
							'content_right' => $imagepath . '2cl.png',
							'content_left' => $imagepath . '2cr.png',)
						);
						
	$options[] = array( "name" => __('Body Display Style', 'designcrumbs'),
						"desc" => __('Choose if you want your site design to be boxed in or span the width of the browser.', 'designcrumbs'),
						"id" => "body_display",
						"std" => "body_boxed",
						"type" => "radio",
						"options" => array("body_boxed" => __('Boxed', 'designcrumbs'),"body_span" => __('Full Width', 'designcrumbs')));
	
	$options[] = array( "name" => __('Sticky Header', 'designcrumbs'),
						"desc" => __('Would you like the header to stick to the top of the browser as the user scrolls down the site?', 'designcrumbs'),
						"id" => "sticky_header",
						"std" => "yes",
						"type" => "radio",
						"options" => array("yes" => __('Yes', 'designcrumbs'),"no" => __('No', 'designcrumbs')));					
						
	$options[] = array( "name" => __('Tracking Code', 'designcrumbs'),
						"desc" => __('Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme. If you need analytics, you can <a href="http://www.google.com/analytics" target="_blank">go here</a>.', 'designcrumbs'),
						"id" => "analytics",
						"std" => "",
						"type" => "textarea");
						
	$options[] = array( "name" => __('Credit Where Credit Is Due', 'designcrumbs'),
						"desc" => __('Checking this box will give credit to <NAME> and the Campaign theme in the footer.', 'designcrumbs'),
						"id" => "give_credit",
						"std" => "1",
						"type" => "checkbox");
	
	$options[] = array( "name" => "Campaign",
						"type" => "heading");
						
	$options[] = array( "name" => __('Donate Button Link', 'designcrumbs'),
						"desc" => __('Enter the link to your donation form. This will enable a <strong>Donate</strong> button in the menu. If you want to set up a PayPal donate link, <a href="http://en.support.wordpress.com/paypal/" target="_blank">WordPress has a tutorial of how to set that up and get the link here</a>.', 'designcrumbs'),
						"id" => "donate_link",
						"std" => "",
						"type" => "textarea");
						
	$options[] = array( "name" => __('Donate Button Text', 'designcrumbs'),
						"desc" => __('The text for your Donate button.', 'designcrumbs'),
						"id" => "donate_text",
						"std" => "Make A Donation",
						"type" => "text");
						
	$options[] = array( "name" => __('"Paid For" Text', 'designcrumbs'),
						"desc" => __('Filling in this will make a 1px bordered box appear in the footer of the site. <strong>This is required in the USA by the FEC for political committees.</strong> <a href="http://www.fec.gov/pages/brochures/notices.shtml#disclaimers" target="_blank">Learn more here</a>.', 'designcrumbs'),
						"id" => "paid_for",
						"std" => "",
						"type" => "text");
						
	$options[] = array( "name" => __('Footer Slogan', 'designcrumbs'),
						"desc" => __('This is for a large slogan at the top of your footer. Optional', 'designcrumbs'),
						"id" => "footer_slogan",
						"std" => "",
						"type" => "text");
						
	$options[] = array( "name" => __('Fallback Image', 'designcrumbs'),
						"desc" => __('Upload your fallback image for the home page posts. If the post itself does not have a featured image, this one will be used. The image size should be 170px by 120px. If it\'s larger it will be cropped.', 'designcrumbs'),
						"id" => "campaign_fallback",
						"type" => "upload");
						
	$options[] = array( "name" => __('Home Page', 'designcrumbs'),
						"type" => "heading");
						
	$options[] = array( "name" => __('Slider FX', 'designcrumbs'),
						"desc" => __('Select your slide transition.', 'designcrumbs'),
						"id" => "slider_fx",
						"type" => "select",
						"std" => "fade",
						"options" => array("fade" => __('Fade', 'designcrumbs'),"slide" => __('Slide', 'designcrumbs')));
						
	$options[] = array( "name" => __('Slider Time', 'designcrumbs'),
						"desc" => __('How long in seconds (use a whole number) would you like a slide to hold for before moving on to the next one? Setting this to 0 (zero) will not autoplay the slides. Zero is recommended if you are using videos in your slider.', 'designcrumbs'),
						"id" => "slider_time",
						"type" => "text",
						"class" => "mini",
						"std" => "8");
						
	$options[] = array( "name" => __('Home Page Video', 'designcrumbs'),
						"desc" => __('Would you like a video on the home page, and if so, from where?', 'designcrumbs'),
						"id" => "video_type",
						"std" => "none",
						"type" => "radio",
						"options" => array("none" => __('None', 'designcrumbs'),"youtube" => __('YouTube', 'designcrumbs'),"vimeo" => __('Vimeo', 'designcrumbs')));
						
	$options[] = array( "name" => __('YouTube ID', 'designcrumbs'),
						"desc" => __('If the YouTube link is http://www.youtube.com/watch?v=Iv69kB_e9KY, the ID is Iv69kB_e9KY.', 'designcrumbs'),
						"id" => "youtube_id",
						"std" => "",
						"class" => "mini",
						"type" => "text");
						
	$options[] = array( "name" => __('Vimeo ID', 'designcrumbs'),
						"desc" => __('If the Vimeo link is http://vimeo.com/22639018, the ID is 22639018.', 'designcrumbs'),
						"id" => "vimeo_id",
						"std" => "",
						"class" => "mini",
						"type" => "text");
						
	$options[] = array( "name" => __('Video Title', 'designcrumbs'),
						"desc" => __('The title to your video.', 'designcrumbs'),
						"id" => "video_title",
						"std" => "",
						"type" => "text");
						
	$options[] = array( "name" => __('Video Description', 'designcrumbs'),
						"desc" => __('A short description about your video.', 'designcrumbs'),
						"id" => "video_desc",
						"std" => "",
						"type" => "textarea");
						
	$options[] = array( "name" => __('Home Page Posts Title', 'designcrumbs'),
						"desc" => __('The title for your latest posts on the home page.', 'designcrumbs'),
						"id" => "home_posts_title",
						"std" => "Latest Posts",
						"type" => "text");
					
	$options[] = array( "name" => __('Which Posts Should Be On The Home Page?', 'designcrumbs'),
						"desc" => __('Would you like the home page posts to be all posts, or posts from a specific category?', 'designcrumbs'),
						"id" => "home_posts_selection",
						"std" => "posts_all",
						"type" => "radio",
						"options" => array("posts_all" => __('All Posts', 'designcrumbs'),"posts_specific" => __('Specific Category', 'designcrumbs')));
						
	$options[] = array( "name" => __('Home Page Posts Category', 'designcrumbs'),
						"desc" => __('Select the category you would like to pull posts from.', 'designcrumbs'),
						"id" => "home_posts_cat",
						"type" => "select",
						"options" => $options_categories);
						
	$options[] = array( "name" => __('Number of posts for the home page', 'designcrumbs'),
						"desc" => __('On the home page blog posts are displayed 3 wide, so this number should be a multiple of 3.', 'designcrumbs'),
						"id" => "home_posts_total",
						"std" => "3",
						"class" => "mini",
						"type" => "text");			
						
	$options[] = array( "name" => __('Styles', 'designcrumbs'),
						"type" => "heading");
						
	$options[] = array( "name" => __('Color Scheme', 'designcrumbs'),
						"desc" => __('Select the color scheme for your header.', 'designcrumbs'),
						"id" => "color_scheme",
						"std" => "blue",
						"type" => "select",
						"options" => array("blue" => __('Blue', 'designcrumbs'),"red" => __('Red', 'designcrumbs'),"yellow" => __('Yellow', 'designcrumbs'),"green" => __('Green', 'designcrumbs')));
						
	$options[] = array( "name" => __('Background Pattern', 'designcrumbs'),
						"desc" => __('Choose the overall background pattern for the site. <em>Note: this only works with the <strong>Boxed</strong> Body Display Style.</em>', 'designcrumbs'),
						"id" => "bg_pattern",
						"std" => "bg_fabric",
						"type" => "select",
						"options" => array("bg_cork" => __('Cork', 'designcrumbs'),"bg_fabric" => __('Fabric', 'designcrumbs'),"bg_freckles" => __('Freckle Squares', 'designcrumbs'),"bg_linen" => "Linen","bg_pinstripe" => __('Pinstripes', 'designcrumbs'),"bg_none" => __('None', 'designcrumbs')));
						
	$options[] = array( "name" => __('Heading Font', 'designcrumbs'),
						"desc" => __('Select the font for the headings of the site.', 'designcrumbs'),
						"id" => "heading_font",
						"std" => "ubuntu",
						"type" => "select",
						"options" => $heading_fonts);
						
	$options[] = array( "name" => __('Link Color', 'designcrumbs'),
						"desc" => __('Select the color for your links.', 'designcrumbs'),
						"id" => "link_color",
						"std" => "",
						"type" => "color");
										
	$options[] = array( "name" => __('Social Networks', 'designcrumbs'),
						"type" => "heading");
					
	$options[] = array( "name" => __('Twitter', 'designcrumbs'),
						"desc" => __('Enter the URL to your Twitter profile.', 'designcrumbs'),
						"id" => "twitter",
						"type" => "text"); 

	$options[] = array( "name" => __('Facebook', 'designcrumbs'),
						"desc" => __('Enter the URL to your Facebook profile.', 'designcrumbs'),
						"id" => "facebook",
						"type" => "text");
						
	$options[] = array( "name" => __('Google+', 'designcrumbs'),
						"desc" => __('Enter the URL to your Google+ profile.', 'designcrumbs'),
						"id" => "google",
						"type" => "text");
					
	$options[] = array( "name" => __('Flickr', 'designcrumbs'),
						"desc" => __('Enter the URL to your Flickr Profile.', 'designcrumbs'),
						"id" => "flickr",
						"type" => "text");
					
	$options[] = array( "name" => __('Tumblr', 'designcrumbs'),
						"desc" => __('Enter the URL to your Tumblr Profile.', 'designcrumbs'),
						"id" => "tumblr",
						"type" => "text");
						
	$options[] = array( "name" => __('YouTube', 'designcrumbs'),
						"desc" => __('Enter the URL to your YouTube Profile.', 'designcrumbs'),
						"id" => "youtube",
						"type" => "text");
					
	$options[] = array( "name" => __('Vimeo', 'designcrumbs'),
						"desc" => __('Enter the URL to your Vimeo Profile.', 'designcrumbs'),
						"id" => "vimeo",
						"type" => "text");
						
	$options[] = array( "name" => __('Pinterest', 'designcrumbs'),
						"desc" => __('Enter the URL to your Pinterest Profile.', 'designcrumbs'),
						"id" => "pinterest",
						"type" => "text");
						
	$options[] = array( "name" => __('Instagram', 'designcrumbs'),
						"desc" => __('Enter the URL to your Instagram Profile.', 'designcrumbs'),
						"id" => "instagram",
						"type" => "text");
						
		// Support
						
	$options[] = array( "name" => "Support",
						"type" => "heading");					
						
	$options[] = array( "name" => __('Theme Documentation & Support', 'designcrumbs'),
						"desc" => "<p class='dc-text'>Theme support and documentation is available for all customers. Visit the <a target='blank' href='http://support.designcrumbs.com'>Design Crumbs Support Forum</a> to get started. Simply follow the instructions on the home page to verify your purchase and get a support account.</p>
						
						<div class='dc-buttons'><a target='blank' class='dc-button help-button' href='http://support.designcrumbs.com/help_files/campaignwp/'><span class='dc-icon icon-help'>Help File</span></a><a target='blank' class='dc-button support-button' href='http://support.designcrumbs.com'><span class='dc-icon icon-support'>Support Forum</span></a><a target='blank' class='dc-button custom-button' href='http://www.designcrumbs.com/theme-customization-request'><span class='dc-icon icon-custom'>Customize Theme</span></a></div>
						
						<h4 class='heading'>More Themes by Design Crumbs</h4>
						
						<div class='embed-themes'></div>
						
						",
						"type" => "info");	
				
	return $options;
}<file_sep><li class="single_slide slides_container clearfix">
	<div class="slide_content clearfix">
	
	<?php if (has_post_thumbnail()) { ?>
		<div class="slide_image_wrap">
			<?php if (get_post_meta($post->ID, '_dc_slide_text', true) != '') { ?>
			<div class="slide_text_overlay">
				<?php echo get_post_meta($post->ID, '_dc_slide_text', true);?>
			</div>
			<?php } ?>
			<?php if (get_post_meta($post->ID, '_dc_slide_link', true) != '') { ?><a href="<?php echo get_post_meta($post->ID, '_dc_slide_link', true);?>" title="<?php the_title(); ?>"><?php } ?>
				<?php the_post_thumbnail(); ?>
			<?php if (get_post_meta($post->ID, '_dc_slide_link', true) != '') { ?></a><?php } ?>
		</div>
	<?php } else { ?>
		<?php if (get_post_meta($post->ID, '_dc_video', true) != '') { ?>
			<?php echo wp_oembed_get(get_post_meta($post->ID, '_dc_video', true), array('width'=>600,'height'=>300)); ?>
		<?php } ?>
	<?php } ?>
			
	</div>
</li><file_sep><?php
/*
Campaign JS
Code and stuff you need for the Campaign theme
*/
?>
<script type="text/javascript">
	/* <![CDATA[  */ 
	
	<?php if (is_front_page()) { ?>
	jQuery(function($) {
		$(window).load(function(){
			
			// THE SLIDER
			$('#slides').flexslider({
				start: function(slider) {
					if (slider.count == 1) {
						$('.flex-control-nav, .flex-direction-nav').hide();
					} 
				},
				animation: "fade",
				slideshowSpeed: <?php echo stripslashes(of_get_option('slider_time')); ?>000,
				animationSpeed: 600,
				prevText: "",
				nextText: "",
				smoothHeight: true,
				controlNav: true,
				video: true,
				directionNav: false
			});
					
		
		});
	});
	<?php } ?>
	
	jQuery(document).ready(function($){
	
		// load mobile menu
		$('#main_menu ul.menu').mobileMenu();
		
        $('select.select-menu').each(function(){
            var title = $(this).attr('title');
            if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
            $(this)
                .css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
                .after('<span class="select">' + title + '</span>')
                .change(function(){
                    val = $('option:selected',this).text();
                    $(this).next().text(val);
                    })
        });
		
		// Children Flyout on Menu
		$("#main_menu ul li ul").css({display: "none"}); // Opera Fix
		$("#main_menu ul li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(300);
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
		});
		
		// FitVids
		$("#content").fitVids();
		
		<?php if ((of_get_option('sticky_header') == 'yes') && (of_get_option('body_display') == 'body_span')) { ?>
		$("#header").sticky({topSpacing:0});
		<?php } ?>
		
		// Turn on that SlabText
		function slabTextHeadlines() {
			$('.slabload').fadeIn(1000); // fade in after it's loaded
        	$(".slabwrap h1").slabText({
        		// Don't slabtext the headers if the viewport is under 380px
        		"viewportBreakpoint":380
        	});
		};

		// give it a second to load fonts
		$(window).load(function() {
 	       setTimeout(slabTextHeadlines, 1000);
 	    });
	
		// Adds class to commenters
		$("ul.commentlist li:not(.bypostauthor)").children(".the_comment").addClass("not_author");
		
		// Fancybox
		$(".lightbox").attr('rel', 'gallery').fancybox({
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade'
		});
		
		// clean up the WP Email Capture widget
		$('#wp_email_capture').parent().addClass('wp_email_capture_wrap');
		$('#wp_email_capture').parent().parent().parent().addClass('wp_email_slide');
		$('#wp_email_capture').find('br').remove();

		// put title in fields
		$("input[type='text']").focus(function(srcc) {
			if ($(this).val() == $(this)[0].title) {
				$(this).removeClass("wp-email-capture-active");
				$(this).val("");
			}
		});
		$("input[type='text']").blur(function() {
			if ($(this).val() == "") {
				$(this).addClass("wp-email-capture-active");
				$(this).val($(this)[0].title);
			}
		});
		$("input[type='text']").blur();
		
		$('#slide_widget').fadeIn(1000); // fade in after it's loaded

	});			
	/* ]]> */
</script><file_sep><?php get_header(); ?>
<div id="page" class="posts-wrap">
		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<div id="post-single" <?php post_class(); ?>>
		<h3 class="entry-title">
			<?php the_title(); ?>
		</h3>
		<?php if ((get_post_meta($post->ID, '_dc_media_vimeo', true) != '') || (get_post_meta($post->ID, '_dc_media_youtube', true) != '')) { ?>
			<?php if (get_post_meta($post->ID, '_dc_media_vimeo', true) != '') { ?>
		<div class="vid-wrap">
			<iframe src="http://player.vimeo.com/video/<?php echo get_post_meta($post->ID, '_dc_media_vimeo', true);?>?portrait=0" width="600" height="335" frameborder="0"></iframe>
		</div>
			<?php } elseif (get_post_meta($post->ID, '_dc_media_youtube', true) != '') { ?>
		<div class="vid-wrap">
			<iframe width="600" height="335" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, '_dc_media_youtube', true);?>?wmode=opaque" frameborder="0" allowfullscreen></iframe>
		</div>
			<?php } ?>
		<?php } elseif (has_post_thumbnail()) { ?>
		<a href="<?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'full', true); echo $image_url[0]; ?>" class="lightbox"><?php the_post_thumbnail( 'blog_image', array('alt' => get_the_title()) ); ?></a>
		<?php } ?>
		<div class="post_meta">
			<div class="blocks_wrap">
				<div class="meta_block">
					<span><?php _e("Post Date", "designcrumbs"); ?></span>
					<?php the_time('F d, Y'); ?>
				</div>
				<div class="meta_block">
					<span><?php _e("Comments", "designcrumbs"); ?></span>
					<?php comments_popup_link( __( '0 Comments', 'designcrumbs' ), __( '1 Comment', 'designcrumbs' ), __( '% Comments', 'designcrumbs' ), 'comments-link', __('Comments Closed', 'designcrumbs')); ?>
				</div>
				<div class="meta_block">
					<span><?php _e("Author", "designcrumbs"); ?></span>
					<?php the_author_posts_link(); ?>
				</div>
				<div class="meta_block">
					<span><?php _e("Category", "designcrumbs"); ?></span>
					<?php the_category(', ') ?>
				</div>
				<div class="meta_block share">
					<span><?php _e("Share", "designcrumbs"); ?></span>
					<a class="share-facebook" onclick="window.open('http://www.facebook.com/share.php?u=<?php the_permalink(); ?>','facebook','width=450,height=300,left='+(screen.availWidth/2-375)+',top='+(screen.availHeight/2-150)+'');return false;" href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>" title="<?php the_title(); ?>">
						<img src="<?php echo get_template_directory_uri(); ?>/images/socnets/share_facebook.png" alt="Share on Facebook" />
					</a>
					<a class="share-twitter" onclick="window.open('http://twitter.com/home?status=<?php the_title(); ?> - <?php the_permalink(); ?>','twitter','width=450,height=300,left='+(screen.availWidth/2-375)+',top='+(screen.availHeight/2-150)+'');return false;" href="http://twitter.com/home?status=<?php the_title(); ?> - <?php the_permalink(); ?>" title="<?php the_title(); ?>">
						<img src="<?php echo get_template_directory_uri(); ?>/images/socnets/share_twitter.png" alt="Share on Twitter" />
					</a>
					<a class="share-google" href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="window.open('https://plus.google.com/share?url=<?php the_permalink(); ?>','gplusshare','width=450,height=300,left='+(screen.availWidth/2-375)+',top='+(screen.availHeight/2-150)+'');return false;" title="<?php the_title(); ?>">
						<img src="<?php echo get_template_directory_uri(); ?>/images/socnets/share_google.png" alt="Share on Google+" />
					</a>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="blog-content">
			<div class="entry-content" id="entry-content-single">
				<?php the_content(); ?>
				<div class="clear"></div>
				<?php if (has_tag()) { ?>
				<div class="single-meta">
					<?php the_tags( __('Tagged with ', 'designcrumbs'), ", ", " " ) ?>
				</div>
				<?php } ?>
			</div>
		</div>
		<div class="clear"></div>
		<?php my_author_box(); ?>
	</div><!-- end .post -->		
			
			<?php comments_template('', true); ?>
	
		<?php endwhile; else: ?>

			<?php _e('Sorry, no posts matched your criteria', 'designcrumbs'); ?>.

		<?php endif; ?>
	<div class="clear"></div>
</div><!-- end .posts-wrap -->
<?php get_sidebar(); ?>
<?php get_footer(); ?><file_sep><?php get_header(); ?>
<div class="posts-wrap the_blog search_results">
	<h3 id="search" class="page-title">
		<?php /* Search Count */
		$allsearch = new WP_Query("s=$s&showposts=-1");
		$count = $allsearch->post_count;
		$string = sprintf( __('%1$s Search Results for <strong>%2$s</strong>', 'designcrumbs'), $count, get_search_query() );
		echo $string;
		wp_reset_query(); ?>
	</h3>
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	
		<?php get_template_part( 'loop', 'post' ); ?>
        
	<?php endwhile; ?>
		
	<div class="navigation navigation-index">
		<div class="nav-prev"><?php next_posts_link( __('&laquo; Older Entries', 'designcrumbs')) ?></div>
		<div class="nav-next"><?php previous_posts_link( __('Newer Entries &raquo;', 'designcrumbs')) ?></div>
		<div class="clear"></div>
	</div>

	<?php else : ?>
	<div class="post">
		<div class="entry-content">
			<?php _e("We're sorry, but", "designcrumbs"); ?> <strong><?php the_search_query() ?></strong> <?php _e("returns no results. Please try your search again, or navigate around the site with the links on top.", "designcrumbs"); ?>
		</div>
	</div>
	<?php endif; ?>
</div><!-- end .posts-wrap -->

<?php get_sidebar(); ?>
<?php get_footer(); ?><file_sep>					<div class="clear"></div>
				</div><!-- end div.container, begins in header.php -->
			</div><!-- end div.wrapper, begins in header.php -->
		</div><!-- end div#main_wrap, begins in header.php -->
		<div id="footer" class="wrapper">
			<div class="container">
				<?php if (of_get_option('footer_slogan') != '') { ?>
					<h1 id="footer_slogan"><?php echo stripslashes(of_get_option('footer_slogan')) ?></h1>
				<?php } ?>
				<div id="footer_widgets" class="<?php $sb_count = wp_get_sidebars_widgets(); if (count( $sb_count['Footer']) <= '5') { ?>footer_widget_count<?php count_sidebar_widgets( 'Footer' );?><?php } else { ?>footer_widget_overflow<?php } ?>">
					<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer') ) : endif; ?>
					<div class="clear"></div>
				</div>
				<div id="post_footer">				
					
					<?php if ((of_get_option('twitter') != '') || (of_get_option('facebook') != '') || (of_get_option('google') != '') || (of_get_option('flickr') != '') || (of_get_option('vimeo') != '') || (of_get_option('youtube') != '') || (of_get_option('tumblr') != '') || (of_get_option('pinterest') != '') || (of_get_option('instagram') != '') ) { ?>
					<div id="socnets_wrap">	
						<div id="socnets">
							<?php if (of_get_option('twitter') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('twitter')); ?>" title="Twitter" class="socnet-twitter"></a>
							<?php } if (of_get_option('facebook') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('facebook')); ?>" title="Facebook" class="socnet-facebook"></a>
							<?php } if (of_get_option('google') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('google')); ?>" title="Google+" class="socnet-google"></a>
							<?php } if (of_get_option('flickr') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('flickr')); ?>" title="Flickr" class="socnet-flickr"></a>
							<?php } if (of_get_option('tumblr') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('tumblr')); ?>" title="Tumblr" class="socnet-tumblr"></a>
							<?php } if (of_get_option('vimeo') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('vimeo')); ?>" title="Vimeo" class="socnet-vimeo"></a>
							<?php } if (of_get_option('youtube') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('youtube')); ?>" title="YouTube" class="socnet-youtube"></a>
							<?php } if (of_get_option('pinterest') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('pinterest')); ?>" title="Pinterest" class="socnet-pinterest"></a>
							<?php } if (of_get_option('instagram') != '') { ?>
							<a href="<?php echo stripslashes(of_get_option('instagram')); ?>" title="Instagram" class="socnet-instagram"></a>
							<?php } ?>
						</div>
						<div class="clear"></div>
					</div>
					<?php } ?>

					<?php if (of_get_option('paid_for') != '') { ?>
					<div id="paid_for"><?php echo stripslashes(of_get_option('paid_for')) ?></div>
					<?php } ?>
					<div id="site_info">
						&copy; <?php echo date("Y"); ?> <?php bloginfo('name'); ?>&nbsp;&nbsp;:&nbsp;
						
						<?php if (of_get_option('give_credit') == '1') {
						
							$string = sprintf( __('<a href="%1$s" title="Campaign WordPress Theme">Campaign Theme</a> by <a href="%2$s" title="Design Crumbs">Design Crumbs</a>', 'designcrumbs'), 'http://themes.designcrumbs.com', 'http://designcrumbs.com' );
							echo $string;
							
						} else {
						
							echo bloginfo('description');
							
						} ?>
					</div>
				</div>
			</div>
		</div>
		<?php wp_footer(); //leave for plugins ?>
		<?php echo stripslashes(of_get_option('analytics')); ?>
	</body>
</html><file_sep><?php get_header(); ?>
	<div id="slides_wrap"<?php $sb_count = wp_get_sidebars_widgets(); if (count( $sb_count['Home_Page_Banner']) == '0') { ?> class="home_space"<?php } ?>>
		
		<?php // START SLIDES
		$query_default = new WP_Query( array(
			'post_type' => 'slides',
			'posts_per_page' => 99,
			'order' => 'desc'
		)); 
		if ( $query_default->have_posts() ) : ?>
		<div id="slides" class="clearfix"> 
			<div id="slide_wrap" class="clearfix">
				
				<ul class="slides clearfix">
			
				<?php while ( $query_default->have_posts() ) : $query_default->the_post(); ?>
					
					<?php get_template_part( 'loop', 'slide' ); ?>
					
				<?php endwhile; wp_reset_query(); ?>
				
				</ul>
			
			</div>
		</div>
		<?php endif; // END SLIDES ?>
		<?php /*
		<div id="slide_widget">
			<div id="slide_widget_inner">
				<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Top_Sidebar') ) : endif; ?>
			</div>
		</div>
		<div class="clear"></div>
		*/ ?>
	</div>
	
	<?php if (count( $sb_count['Home_Page_Banner']) != '0') { ?>
	<div id="home_widgets">
		<div id="home_widget_wrap" class="<?php $sb_count = wp_get_sidebars_widgets(); if (count( $sb_count['Home_Page_Banner']) <= '3') { ?>banner_widget_count<?php count_sidebar_widgets( 'Home_Page_Banner' );?><?php } else { ?>banner_widget_overflow<?php } ?>">
			<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Home_Page_Banner') ) : endif; ?>
			<div class="clear"></div>
		</div>
	</div>
	<?php } ?>
	
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	
		<?php if ($post->post_content != "") { // if the post has content ?>

			<div id="home_content">
				<div <?php post_class(); ?>>
					<?php the_content(); ?>
					<div class="clear"></div>
				</div>
			</div>
		
		<?php } ?>
	
	<?php endwhile; endif; ?>
	
	<div class="posts-wrap">
	
		<?php if (of_get_option('video_type') != 'none') { ?>
		<div id="home_video_wrap">
			<div id="home_video">
				<?php if ((of_get_option('vimeo_id') != '') && (of_get_option('video_type') == 'vimeo')) { ?>
				<iframe src="http://player.vimeo.com/video/<?php echo stripslashes(of_get_option('vimeo_id')); ?>?portrait=0" width="380" height="223" frameborder="0"></iframe>
				<?php } if ((of_get_option('youtube_id') != '') && (of_get_option('video_type') == 'youtube')) { ?>
				<iframe width="380" height="223" src="http://www.youtube.com/embed/<?php echo stripslashes(of_get_option('youtube_id')); ?>?wmode=opaque" frameborder="0" allowfullscreen></iframe>
				<?php } ?>
			</div>
			<?php if (of_get_option('video_desc') != '') { ?>
			<div id="home_video_desc">
				<?php if (of_get_option('video_title') != '') { ?>
				<h4><?php echo stripslashes(of_get_option('video_title')); ?></h4>
				<?php } ?>
				<p><?php echo stripslashes(of_get_option('video_desc')); ?></p>
			</div>
			<?php } ?>
			<div class="clear"></div>
		</div>
		<?php } ?>
	
		<?php wp_reset_query(); // END NEWS LOOP ?>
	
	</div>

<?php get_footer(); ?><file_sep><?php

// Theme Prefix: dcs_

/* ========================================= Constants ========================================= */

if(!defined('DCS_THEME_DIR')) {
	define('DCS_THEME_DIR', dirname(__FILE__));
}

/* ========================================= File Includes ========================================= */

include(DCS_THEME_DIR . '/includes/scripts.php');

/* ========================================= General Things We Need ========================================= */

add_editor_style(); // Adds CSS to the editor to match the front end of the site.
add_theme_support('automatic-feed-links');
if ( ! isset( $content_width ) ) $content_width = 590; // This is the max width of the content, thus the max width of large images that are uploaded.
require_once(dirname(__FILE__) . "/includes/support/support.php"); // Load support tab

// Load Language File
load_theme_textdomain('designcrumbs', get_template_directory() . '/languages');
$locale = get_locale();
$locale_file = get_template_directory() . '/languages/$locale.php';
if ( is_readable($locale_file) )
	require_once($locale_file);
	
// Check for Options Framework Plugin
of_check();

function of_check() {
	if ( !function_exists('of_get_option') ) {
		add_action('admin_notices', 'of_check_notice');
	}
}

// The Admin Notice
function of_check_notice() {
?>
  <div class='updated fade'>
    <p>The <strong>Options Framework plugin</strong> is required for this theme to function properly. <a href="<?php echo network_admin_url('plugin-install.php?tab=plugin-information&plugin=options-framework&TB_iframe=true&width=640&height=517'); ?>" class="thickbox onclick">Install now</a>.</p>
  </div>
<?php
}

// Check for WP Email Capture
dcs_wpemailcapture_check();

function dcs_wpemailcapture_check() {
	if ( function_exists('wp_email_capture_plugins_loaded') ) {
		update_option('wp_email_capture_theme_affiliate_link', 'https://www.e-junkie.com/ecom/gb.php?ii=1130727&c=ib&aff=236565&cl=24404');
	}
}

/* =================================== Options Framework =================================== */

if ( !function_exists( 'of_get_option' ) ) {
	function of_get_option($name, $default = false) {
	    $optionsframework_settings = get_option('optionsframework');
	    
	    // Gets the unique option id
	    $option_name = $optionsframework_settings['id'];
	    if ( get_option($option_name) ) {
	        $options = get_option($option_name);
	    }
	    if ( isset($options[$name]) ) {
	        return $options[$name];
	    } else {
	        return $default;
	    }
	}
}

/* This one shows/hides the an option when a checkbox is clicked. */
 
add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
 
function optionsframework_custom_scripts() { ?>
 
<script type="text/javascript">
jQuery(document).ready(function() {

	// adds support tab
	jQuery(".embed-themes").html("<iframe width='770' height='390' src='http://themes.designcrumbs.com/iframe/index.html'></iframe>");
 
 	// Checks for body style
	jQuery('#campaign-body_display-body_span').click(function() {
  		jQuery('#section-sticky_header').fadeIn(400);
	});
	
	jQuery('#campaign-body_display-body_boxed').click(function() {
  		jQuery('#section-sticky_header').fadeOut(400);
	});
 
	if (jQuery('#campaign-body_display-body_boxed').is(':checked')) {
		jQuery('#section-sticky_header').hide();
	};
	
	// Checks for home page video content
	jQuery('#campaign-video_type-none').click(function() {
  		jQuery('#section-youtube_id').hide();
  		jQuery('#section-vimeo_id').hide();
  		jQuery('#section-video_title').hide();
  		jQuery('#section-video_desc').hide();
	});
	
	jQuery('#campaign-video_type-youtube').click(function() {
  		jQuery('#section-vimeo_id').hide();
  		jQuery('#section-youtube_id').fadeIn(400);
  		jQuery('#section-video_title').fadeIn(400);
  		jQuery('#section-video_desc').fadeIn(400);
	});
	
	jQuery('#campaign-video_type-vimeo').click(function() {
  		jQuery('#section-youtube_id').hide();
  		jQuery('#section-vimeo_id').fadeIn(400);
  		jQuery('#section-video_title').fadeIn(400);
  		jQuery('#section-video_desc').fadeIn(400);
	});
 
	if (jQuery('#campaign-video_type-none').is(':checked')) {
		jQuery('#section-youtube_id').hide();
  		jQuery('#section-vimeo_id').hide();
  		jQuery('#section-video_title').hide();
  		jQuery('#section-video_desc').hide();
	};
	
	if (jQuery('#campaign-video_type-youtube').is(':checked')) {
		jQuery('#section-vimeo_id').hide();
	};
	
	if (jQuery('#campaign-video_type-vimeo').is(':checked')) {
		jQuery('#section-youtube_id').hide();
	};
	
	// Checks for home page post cats
	jQuery('#campaign-home_posts_selection-posts_specific').click(function() {
  		jQuery('#section-home_posts_cat').fadeIn(400);
	});
	
	jQuery('#campaign-home_posts_selection-posts_all').click(function() {
  		jQuery('#section-home_posts_cat').fadeOut(400);
	});
 
	if (jQuery('#campaign-home_posts_selection-posts_all').is(':checked')) {
		jQuery('#section-home_posts_cat').hide();
	};

});
</script>
 
<?php
}
 
/* Removes the code stripping */
 
add_action('admin_init','optionscheck_change_santiziation', 100);
 
function optionscheck_change_santiziation() {
    remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
    add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea_custom' );
}
 
function of_sanitize_textarea_custom($input) {
    global $allowedposttags;
        $of_custom_allowedtags["embed"] = array(
			"src" => array(),
			"type" => array(),
			"allowfullscreen" => array(),
			"allowscriptaccess" => array(),
			"height" => array(),
			"width" => array()
		);
		$of_custom_allowedtags["script"] = array(
			"type" => array()
		);
		$of_custom_allowedtags["iframe"] = array(
			"height" => array(),
			"width" => array(),
			"src" => array(),
			"frameborder" => array(),
			"allowfullscreen" => array()
		);
		$of_custom_allowedtags["object"] = array(
			"height" => array(),
			"width" => array()
		);
		$of_custom_allowedtags["param"] = array(
			"name" => array(),
			"value" => array()
		);
 
	$of_custom_allowedtags = array_merge($of_custom_allowedtags, $allowedposttags);
	$output = wp_kses( $input, $of_custom_allowedtags);
	return $output;
}

/* =================================== Add Fancybox to linked Images =================================== */

/**
 * Attach a class to linked images' parent anchors
 * e.g. a img => a.img img
 */
function give_linked_images_class($html, $id, $caption, $title, $align, $url, $size, $alt = '' ){
	$classes = 'lightbox'; // separated by spaces, e.g. 'img image-link'

	// check if there are already classes assigned to the anchor
	if ( preg_match('/<a.*? class=".*?">/', $html) ) {
		$html = preg_replace('/(<a.*? class=".*?)(".*?>)/', '$1 ' . $classes . '$2', $html);
	} else {
		$html = preg_replace('/(<a.*?)>/', '$1 class="' . $classes . '" >', $html);
	}
	return $html;
}
add_filter('image_send_to_editor','give_linked_images_class',10,8);

/* =================================== Add Menus =================================== */
add_theme_support( 'menus' );

register_nav_menus( array(
	'primary' => __( 'Main Menu', 'designcrumbs' )
) );

/* ========================================= Featured Images ========================================= */

add_theme_support( 'post-thumbnails' ); /* ===== ADDS FEATURED IMAGE TO PAGES ===== */
add_image_size( 'blog_image', 590, 400, true ); /* ===== SETS FEATURED IMAGE SIZE  ===== */
add_image_size( 'slide_image', 600, 300, true ); /* ===== SETS FEATURED IMAGE SIZE  ===== */
add_image_size( 'single_latest', 170, 120, true ); /* ===== SETS FEATURED IMAGE SIZE  ===== */

/* =================================== Add Slides Post Type =================================== */

register_post_type('slides', array(
	'label' => __('Slides', 'designcrumbs'),
	'singular_label' => __('Slide', 'designcrumbs'),
	'public' => true,
	'show_ui' => true, // UI in admin panel
	'_builtin' => false, // It's a custom post type, not built in!
	'_edit_link' => 'post.php?post=%d',
	'capability_type' => 'post',
	'hierarchical' => false,
	'has_archive' => false,
	'supports' => array(
			'title',
			'thumbnail',)
	));
	
/* ====================================================== Slide Meta Box ====================================================== */

add_filter( 'cmb_meta_boxes', 'dcs_metaboxes' );
function dcs_metaboxes( array $meta_boxes ) {

	$prefix = '_dc_';

	$meta_boxes[] = array(
	    'id' => 'dc_slides_info',
	    'title' => __('Slide Contents (for image slide only)', 'designcrumbs'),
	    'pages' => array('slides'), // post type
		'context' => 'normal',
		'priority' => 'high',
		'show_names' => true, // Show field names on the left
	    'fields' => array(
	   		array(
		        'name' => __('Slide Text', 'designcrumbs'),
		        'desc' => __('Enter text to be overlaid on the bottom of the slide image. Optional.', 'designcrumbs'),
		        'id' => $prefix . 'slide_text',
		        'type' => 'text'
		    ),
	        array(
		        'name' => __('Link', 'designcrumbs'),
		        'desc' => __('Enter a link (including the http://) if you would like the slide to link to somewhere. Optional.', 'designcrumbs'),
		        'id' => $prefix . 'slide_link',
		        'type' => 'text'
		    ),
	    )
	);
	$meta_boxes[] = array(
	    'id' => 'dc_slides',
	    'title' => __('Slide Video Embed', 'designcrumbs'),
	    'pages' => array('slides'), // post type
		'context' => 'normal',
		'priority' => 'high',
		'show_names' => true, // Show field names on the left
	    'fields' => array(
	        array(
		        'name' => __('Video oEmbed Link', 'designcrumbs'),
		        'desc' => __('Enter the full URL to your video. <a href="http://codex.wordpress.org/Embeds">Learn more about oEmbeds</a>.', 'designcrumbs'),
		        'id' => $prefix . 'video',
		        'type' => 'text'
		    ),
	    )
	);
	$meta_boxes[] = array(
	    'id' => 'dc_media',
	    'title' => __('Video Embeds', 'designcrumbs'),
	    'pages' => array('post'), // post type
		'context' => 'normal',
		'priority' => 'high',
		'show_names' => true, // Show field names on the left
	    'fields' => array(
	        array(
		        'name' => __('YouTube Video ID', 'designcrumbs'),
		        'desc' => __('If the YouTube link is http://www.youtube.com/watch?v=Iv69kB_e9KY, the ID is Iv69kB_e9KY. Enter that ID above.', 'designcrumbs'),
		        'id' => $prefix . 'media_youtube',
		        'type' => 'text'
		    ),
	        array(
		        'name' => __('Vimeo Video ID', 'designcrumbs'),
		        'desc' => __('If the Vimeo link is http://vimeo.com/22639018, the ID is 22639018. Enter that ID above.', 'designcrumbs'),
		        'id' => $prefix . 'media_vimeo',
		        'type' => 'text'
		    ),
	    )
	);
	return $meta_boxes;
}

add_action( 'init', 'dcs_initialize_cmb_meta_boxes', 9999 );
function dcs_initialize_cmb_meta_boxes() {

	if ( ! class_exists( 'cmb_Meta_Box' ) )
		require_once 'lib/metabox/init.php';

}

/* =================================== The Excerpt =================================== */

function improved_trim_excerpt($text) {
        global $post;
        if ( '' == $text ) {
                $text = get_the_content('');
                $text = apply_filters('the_content', $text);
                $text = str_replace('\]\]\>', ']]&gt;', $text);
                $text = strip_tags($text, '<p>');
                $excerpt_length = 85;
                $words = explode(' ', $text, $excerpt_length + 1);
                if (count($words)> $excerpt_length) {
                        array_pop($words);
                        array_push($words, '...');
                        $text = implode(' ', $words);
                }
        }
        return $text;
}

remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'improved_trim_excerpt');

/* =================================== Count How Many Widgets are in a Sidebar =================================== */

function count_sidebar_widgets( $sidebar_id, $echo = true ) {
    $the_sidebars = wp_get_sidebars_widgets();
    if( !isset( $the_sidebars[$sidebar_id] ) )
        return __( 'Invalid sidebar ID', 'designcrumbs' );
    if( $echo )
        echo count( $the_sidebars[$sidebar_id] );
    else
        return count( $the_sidebars[$sidebar_id] );
}

// To call it on the front end - count_sidebar_widgets( 'some-sidebar-id' );

/* ========================================= Checks for subcategories for the archives ========================================= */

// If is category or subcategory of $cat_id
if (!function_exists('is_category_or_sub')) {
	function is_category_or_sub($cat_id = 0) {
	    foreach (get_the_category() as $cat) {
	    	if ($cat_id == $cat->cat_ID || cat_is_ancestor_of($cat_id, $cat)) return true;
	    }
	    return false;
	}
}

/* ========================================= Creates function to check if single page is in child category ========================================= */

if ( ! function_exists( 'post_is_in_descendant_category' ) ) {
	function post_is_in_descendant_category( $cats, $_post = null ) {
		foreach ( (array) $cats as $cat ) {
			// get_term_children() accepts integer ID only
			$descendants = get_term_children( (int) $cat, 'category' );
			if ( $descendants && in_category( $descendants, $_post ) )
				return true;
		}
		return false;
	}
}

/* ========================================= Sidebars ========================================= */

if ( function_exists('register_sidebars') )
	register_sidebar(array(
		'name' => 'Overall_Sidebar',
		'id' => 'Overall_Sidebar',
		'description' => __('These widgets will show up on every page and post, including to the side of the home page.', 'designcrumbs'),
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
		'before_title' => '<h4 class="widgettitle">',
		'after_title' => '</h4>'
	));
	register_sidebar(array(
		'name' => 'Pages_Sidebar',
		'id' => 'Pages_Sidebar',
		'description' => __('These widgets will show up only on all pages, except the home page.', 'designcrumbs'),
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
		'before_title' => '<h4 class="widgettitle">',
		'after_title' => '</h4>'
	));
	register_sidebar(array(
		'name' => 'Blog_Sidebar',
		'id' => 'Blog_Sidebar',
		'description' => __('These widgets will show up in the blog and on blog posts.', 'designcrumbs'),
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
		'before_title' => '<h4 class="widgettitle">',
		'after_title' => '</h4>'
	));
	register_sidebar(array(
		'name' => 'Top_Sidebar',
		'id' => 'Top_Sidebar',
		'description' => __('You have room here for one widget to go next to the slider on the home page. It&#39;s recommended to put an email signup, such as the WP Email Capture plugin by <NAME>, or contact form here. On all other pages this widget will be displayed first in the sidebar', 'designcrumbs'),
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
		'before_title' => '<h3 class="widgettitle">',
		'after_title' => '</h3>'
	));
	register_sidebar(array(
		'name' => 'Home_Page_Banner',
		'id' => 'Home_Page_Banner',
		'description' => __('These widgets show up in the banner just below the slider.', 'designcrumbs'),
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
		'before_title' => '<h3 class="widgettitle">',
		'after_title' => '</h3>'
	));
	register_sidebar(array(
		'name' => 'Footer',
		'id' => 'Footer',
		'description' => __('These widgets will appear in the footer.', 'designcrumbs'),
		'before_widget' => '<div class="footer_widget">',
		'after_widget' => '</div>',
		'before_title' => '<h6 class="widgettitle">',
		'after_title' => '</h6>'
	));


/* =================================== User Extras =================================== */

add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );

function my_show_extra_profile_fields( $user ) { ?>

	<h3><?php _e('Extra profile information', 'designcrumbs') ?></h3>

	<table class="form-table">

		<tr>
			<th><label for="twitter"><?php _e('Twitter', 'designcrumbs') ?></label></th>

			<td>
				<input type="text" name="twitter" id="twitter" value="<?php echo esc_attr( get_the_author_meta( 'twitter', $user->ID ) ); ?>" class="regular-text" /><br />
				<span class="description"><?php _e('Please enter your Twitter username without the @.', 'designcrumbs') ?></span>
			</td>
		</tr>

	</table>
<?php }

add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );

function my_save_extra_profile_fields( $user_id ) {

	if ( !current_user_can( 'edit_user', $user_id ) )
		return false;

	update_user_meta( $user_id, 'twitter', $_POST['twitter'] );
}

function my_author_box() { ?>
			<div class="about_the_author">
				<?php echo get_avatar( get_the_author_meta('email'), '70' ); ?>
				<div class="author_info">
					<div class="author_title"><?php _e('This post was written by', 'designcrumbs') ?> <?php the_author_posts_link(); ?>
					</div>
					<div class="author_about">
					<?php the_author_meta( 'description' ); ?>
					</div>
					<?php if (get_the_author_meta('twitter') != '' || get_the_author_meta('url') != '' ) { ?>
					<div class="author_links">
						<?php if (get_the_author_meta('twitter') != '' ) { ?>
						<a href="http://twitter.com/<?php the_author_meta('twitter'); ?>" title="Follow <?php the_author_meta( 'display_name' ); ?> on Twitter"><?php _e('My Twitter', 'designcrumbs') ?> &raquo;</a>
						<?php } if (get_the_author_meta('url') != '' ) { ?>
						<a href="<?php the_author_meta('url'); ?>" title="My Website"><?php _e('My Website', 'designcrumbs') ?> &raquo;</a>
						<?php } ?>
					<div class="clear"></div>
					</div>
					<?php } // End check for twitter & url ?>
				</div>
				<div class="clear"></div>
			</div>
	<?php
}
	
/* =================================== Specific User Widget =================================== */

class featured_user_widget extends WP_Widget {

		//function to set up widget in admin
		function featured_user_widget() {
		
			$widget_ops = array( 'classname' => 'featured-user', 
			'description' => __('A widget that will display a specified user&#39;s gravatar, display name, bio, and link to their author post archive.', 'designcrumbs') );
			
			$control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'featured-user' );
			parent::__construct( 'featured-user', __('Featured User', 'designcrumbs'), $widget_ops, $control_ops );
		
		}

		//function to echo out widget on sidebar
		function widget( $args, $instance ) {
		extract( $args );
		
			$title = $instance['title'];
			
			echo $before_widget;
			echo "<div class='featured_user'>";
	
			// if user written title echo out
			if ( $title ){
			echo $before_title . $title . $after_title;
			}
		    //don't touch this!
			$userid = $instance['user_id'];
			
			//user information array
			//refer to http://codex.wordpress.org/Function_Reference/get_userdata
			$userinfo = get_userdata($userid);
			
			//user meta data
			//refer to http://codex.wordpress.org/Function_Reference/get_user_meta
			$userbio = get_user_meta($userid,'description',true);
			
			//user post url
			//refer to http://codex.wordpress.org/Function_Reference/get_author_posts_url
			$userposturl = get_author_posts_url($userid);	
			
			?>			
			
			<!--Now we print out speciifc user informations to screen!-->
			<div class='specific_user'>
			<a href='<?php echo $userposturl; ?>' title='<?php echo $userinfo->display_name; ?>'>
			<?php echo get_avatar($userid,58); ?>
			</a>
			<strong>
			<a href='<?php echo $userposturl; ?>' title='<?php echo $userinfo->display_name; ?>' class='featured_user_name'>
			<?php echo $userinfo->display_name; ?>
			</a></strong>
			<?php echo $userbio; ?>
			<?php/* <a href='<?php echo $userposturl; ?>' title='<?php echo $userinfo->display_name; ?>'>
			View Author's Posts &raquo;
			</a> */ ?>
			<div class="clear"></div>
			</div>
			<!--end-->
			
			<?php

			echo '</div>';
			echo $after_widget;
		
		 }//end of function widget

		//function to update widget setting
		function update( $new_instance, $old_instance ) {
		
			$instance = $old_instance;
			$instance['title'] = strip_tags( $new_instance['title'] );
			$instance['user_id'] = strip_tags( $new_instance['user_id'] );
			return $instance;
	
		}//end of function update


		//function to create Widget Admin form
		function form($instance) {
		
			$instance = wp_parse_args( (array) $instance, array( 'title' => '','user_id' => '') );
			
			$instance['title'] = $instance['title'];
			$instance['user_id'] = $instance['user_id'];
					
			?>

			<p>
			<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title:', 'designcrumbs') ?></label> 
			<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>"
			 type="text" value="<?php echo $instance['title']; ?>" />
			</p>
			
			<p>
			<label for="<?php echo $this->get_field_id( 'user_id' ); ?>"><?php _e('Select User:', 'designcrumbs') ?></label> 
			<select id="<?php echo $this->get_field_id( 'user_id' );?>" name="<?php echo $this->get_field_name( 'user_id' );?>" class="widefat" style="width:100%;">

			<?php
			$instance = $instance['user_id'];
			$option_list = user_get_users_list_option($instance);
			echo $option_list;
			?>
			</select>
			
			</p>
			
			
			<?php
		
	      }//end of function form($instance)

}//end of  Class

//function to get all users
function user_get_users_list_option($instance){
$output = '';
global $wpdb; 
$users = $wpdb->get_results("SELECT display_name, ID FROM $wpdb->users");
	foreach($users as $u){
    $uname = $u->display_name;
    $uid = $u->ID;
    $output .="<option value='$uid'";
    if($instance == $uid){
    $output.= 'selected="selected"';
    } 
    $output.= ">$uname</option>";
	}
return $output;
}

register_widget('featured_user_widget');

/* =================================== Testimonial Widget =================================== */

class TestimonialWidget extends WP_Widget
{
 /**
  * Declares the TestimonialWidget class.
  *
  */
    function TestimonialWidget(){
	    $widget_ops = array('classname' => 'widget_testimonial', 'description' => __('Displays a testimonial along with a name, company, and URL.', 'designcrumbs') );
	    $control_ops = array('width' => 300, 'height' => 300);
	    parent::__construct('testimonial', __('Testimonial', 'designcrumbs'), $widget_ops, $control_ops);
    }

  /**
    * Displays the Widget
    *
    */
    function widget($args, $instance){
      extract($args);
      $testi_title = apply_filters('widget_title', empty($instance['testi_title']) ? '' : $instance['testi_title']);
      $testi_name = empty($instance['testi_name']) ? '' : $instance['testi_name'];
      $testi_company = empty($instance['testi_company']) ? '' : $instance['testi_company'];
      $testi_url = empty($instance['testi_url']) ? '' : $instance['testi_url'];
      $testi_testimonial = empty($instance['testi_testimonial']) ? '' : $instance['testi_testimonial'];

      # Before the widget
      echo '<div class="widget_testimonial widget">';

      # The title
      if ( $testi_title )
		echo $before_title . $testi_title . $after_title;
		echo '<div class="the_testimonial">'.$testi_testimonial . '</div>';
		echo '<div class="the_testimonial_author">';
		echo '<strong>- ' . $testi_name . '</strong>';
      if ( $testi_url ) {
      	echo '<span><a href="'.$testi_url.'" title="'.$testi_company.'">' . $testi_company . '</a></span>';
      } else {
		echo '<span>' . $testi_company .'</span>';}
		echo '</div>';
		echo '<div class="clear"></div>';
		
      # After the widget
      echo '</div>';
  }

  /**
    * Saves the widgets settings.
    *
    */
    function update($new_instance, $old_instance){
      $instance = $old_instance;
      $instance['testi_title'] = strip_tags(stripslashes($new_instance['testi_title']));
      $instance['testi_name'] = strip_tags(stripslashes($new_instance['testi_name']));
      $instance['testi_company'] = strip_tags(stripslashes($new_instance['testi_company']));
      $instance['testi_url'] = strip_tags(stripslashes($new_instance['testi_url']));
      $instance['testi_testimonial'] = strip_tags(stripslashes($new_instance['testi_testimonial']));

    return $instance;
  }

  /**
    * Creates the edit form for the widget.
    *
    */
    function form($instance){
      //Defaults

      $testi_title = htmlspecialchars($instance['testi_title']);
      $testi_name = htmlspecialchars($instance['testi_name']);
      $testi_company = htmlspecialchars($instance['testi_company']);
      $testi_url = htmlspecialchars($instance['testi_url']);
      $testi_testimonial = htmlspecialchars($instance['testi_testimonial']);

    //output  
	# Title
	echo '<p><label for="' . $this->get_field_name('testi_title') . '">' . __('Title (Optional):', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('testi_title') . '" name="' . $this->get_field_name('testi_title') . '" type="text" value="' . $testi_title . '" /></p>';
	# Name
	echo '<p><label for="' . $this->get_field_name('testi_name') . '">' . __('Name:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('testi_name') . '" name="' . $this->get_field_name('testi_name') . '" type="text" value="' . $testi_name . '" /></p>';
	# Company
	echo '<p><label for="' . $this->get_field_name('testi_company') . '">' . __('Company:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('testi_company') . '" name="' . $this->get_field_name('testi_company') . '" type="text" value="' . $testi_company . '" /></p>';
	# URL
	echo '<p><label for="' . $this->get_field_name('testi_url') . '">' . __('URL:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('testi_url') . '" name="' . $this->get_field_name('testi_url') . '" type="text" value="' . $testi_url . '" /></p>';
	# Testimonial
	echo '<p><label for="' . $this->get_field_name('testi_testimonial') . '">' . __('The Testimonial:', 'designcrumbs') . '</label><textarea class="widefat" id="' . $this->get_field_id('testi_testimonial') . '" cols="20" rows="6" value="' . $testi_testimonial . '" name="' . $this->get_field_name('testi_testimonial') . '">' . $testi_testimonial . '</textarea></p>';
  }

}// END class

  function TestimonialInit() {
  register_widget('TestimonialWidget');
  }
  add_action('widgets_init', 'TestimonialInit');

/* =================================== Text with a Button Widget =================================== */

class TextButtonWidget extends WP_Widget
{
 /**
  * Declares the TextButtonWidget class.
  *
  */
    function TextButtonWidget(){
    $widget_ops = array('classname' => 'widget_text_button', 'description' => __('Arbitrary text or HTML along with a button.', 'designcrumbs') );
    $control_ops = array('width' => 300, 'height' => 300);
    parent::__construct('text_button', __('Text with a Button', 'designcrumbs'), $widget_ops, $control_ops);
    }

  /**
    * Displays the Widget
    *
    */
    function widget($args, $instance){
      extract($args);
      $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']);
      $the_button_text = empty($instance['the_button_text']) ? '' : $instance['the_button_text'];
      $the_button_link = empty($instance['the_button_link']) ? '' : $instance['the_button_link'];
      $button_type = empty($instance['button_type']) ? 'button' : $instance['button_type'];
      $the_message = empty($instance['the_message']) ? '' : $instance['the_message'];

      # Before the widget
      echo $before_widget;

      # The title
      if ( $title )
      echo $before_title . $title . $after_title;

      echo '<div>' . $the_message . '</div><a href="' . $the_button_link . '" class="' . $button_type . '">' . $the_button_text . '</a>';

      # After the widget
      echo $after_widget;
  }

  /**
    * Saves the widgets settings.
    *
    */
    function update($new_instance, $old_instance){
      $instance = $old_instance;
      $instance['title'] = strip_tags(stripslashes($new_instance['title']));
      $instance['the_button_text'] = strip_tags(stripslashes($new_instance['the_button_text']));
      $instance['the_button_link'] = strip_tags(stripslashes($new_instance['the_button_link']));
      $instance['button_type'] = strip_tags(stripslashes($new_instance['button_type']));
      $instance['the_message'] = strip_tags(stripslashes($new_instance['the_message']));

    return $instance;
  }

  /**
    * Creates the edit form for the widget.
    *
    */
    function form($instance){
      //Defaults

      $title = htmlspecialchars($instance['title']);
      $the_button_text = htmlspecialchars($instance['the_button_text']);
      $the_button_link = htmlspecialchars($instance['the_button_link']);
      $button_type = htmlspecialchars($instance['button_type']);
      $the_message = htmlspecialchars($instance['the_message']);

    //output  
	# Title
	echo '<label for="' . $this->get_field_name('title') . '">' . __('Title:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" />';
	# Message
	echo '<label for="' . $this->get_field_name('the_message') . '">' . __('The Message:', 'designcrumbs') . '</label><textarea class="widefat" id="' . $this->get_field_id('the_message') . '" cols="20" rows="6" value="' . $the_message . '" name="' . $this->get_field_name('the_message') . '">' . $the_message . '</textarea>';
	# Button Text
	echo '<label for="' . $this->get_field_name('the_button_text') . '">' . __('Button Text:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('the_button_text') . '" name="' . $this->get_field_name('the_button_text') . '" type="text" value="' . $the_button_text . '" />';
	# Button Link
	echo '<label for="' . $this->get_field_name('the_button_link') . '">' . __('Button Link (including http):', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('the_button_link') . '" name="' . $this->get_field_name('the_button_link') . '" type="text" value="' . $the_button_link . '" />';
	# Button Type
	echo '<label for="' . $this->get_field_name('button_type') . '">' . __('Button Color:', 'designcrumbs') . '</label><select class="widefat" id="' . $this->get_field_id('button_type') . '" name="' . $this->get_field_name('button_type') . '"><option value="button" '. ( ($button_type == "button") ? "selected='selected'"   : "") .'>' . __('Blue', 'designcrumbs') . '</option><option value="button button_red" '. ( ($button_type == "button button_red") ? "selected='selected'"   : "") .'>' . __('Red', 'designcrumbs') . '</option><option value="button button_gray" '. ( ($button_type == "button button_gray") ? "selected='selected'"   : "") .'>' . __('Gray', 'designcrumbs') . '</option></select>';


  }

}// END class

  function TextButtonInit() {
  register_widget('TextButtonWidget');
  }
  add_action('widgets_init', 'TextButtonInit');

/* =================================== SlabText Widget =================================== */

class SlabTextWidget extends WP_Widget
{
 /**
  * Declares the SlabTextWidget class.
  *
  */
    function SlabTextWidget(){
    $widget_ops = array('classname' => 'widget_slabtext', 'description' => __('Text headline that forms the area it&#39;s in to make some cool typography.', 'designcrumbs') );
    $control_ops = array('width' => 300, 'height' => 300);
    parent::__construct('slabtext', __('Slab Text', 'designcrumbs'), $widget_ops, $control_ops);
    }

  /**
    * Displays the Widget
    *
    */
    function widget($args, $instance){
      extract($args);
      $line1 = empty($instance['line1']) ? '' : $instance['line1'];
      $line2 = empty($instance['line2']) ? '' : $instance['line2'];
      $line3 = empty($instance['line3']) ? '' : $instance['line3'];
      $line4 = empty($instance['line4']) ? '' : $instance['line4'];
      $line5 = empty($instance['line5']) ? '' : $instance['line5'];

      # Before the widget
      echo $before_widget;

      echo '<div class="slabload">
			<div class="slabwrap">
				<h1 class="slabtextdone">
					<span class="slabtext">'. strtoupper($line1) .'</span>
					<span class="slabtext">'. strtoupper($line2) .'</span>
					<span class="slabtext">'. strtoupper($line3) .'</span>
					<span class="slabtext">'. strtoupper($line4) .'</span>
					<span class="slabtext">'. strtoupper($line5) .'</span>
				</h1>
			</div>
		</div>';

      # After the widget
      echo $after_widget;
  }

  /**
    * Saves the widgets settings.
    *
    */
    function update($new_instance, $old_instance){
      $instance = $old_instance;
      $instance['line1'] = strip_tags(stripslashes($new_instance['line1']));
      $instance['line2'] = strip_tags(stripslashes($new_instance['line2']));
      $instance['line3'] = strip_tags(stripslashes($new_instance['line3']));
      $instance['line4'] = strip_tags(stripslashes($new_instance['line4']));
      $instance['line5'] = strip_tags(stripslashes($new_instance['line5']));

    return $instance;
  }

  /**
    * Creates the edit form for the widget.
    *
    */
    function form($instance){
      //Defaults

      $line1 = htmlspecialchars($instance['line1']);
      $line2 = htmlspecialchars($instance['line2']);
      $line3 = htmlspecialchars($instance['line3']);
      $line4 = htmlspecialchars($instance['line4']);
      $line5 = htmlspecialchars($instance['line5']);

    //output  
	# Line1
	echo '<label for="' . $this->get_field_name('line1') . '">' . __('Line 1:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('line1') . '" name="' . $this->get_field_name('line1') . '" type="text" value="' . $line1 . '" />';
	# Line2
	echo '<label for="' . $this->get_field_name('line1') . '">' . __('Line 2:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('line2') . '" name="' . $this->get_field_name('line2') . '" type="text" value="' . $line2 . '" />';
	# Line3
	echo '<label for="' . $this->get_field_name('line1') . '">' . __('Line 3:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('line3') . '" name="' . $this->get_field_name('line3') . '" type="text" value="' . $line3 . '" />';
	# Line4
	echo '<label for="' . $this->get_field_name('line1') . '">' . __('Line 4:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('line4') . '" name="' . $this->get_field_name('line4') . '" type="text" value="' . $line4 . '" />';
	# Line5
	echo '<label for="' . $this->get_field_name('line1') . '">' . __('Line 5:', 'designcrumbs') . '</label><input class="widefat" id="' . $this->get_field_id('line5') . '" name="' . $this->get_field_name('line5') . '" type="text" value="' . $line5 . '" />';
  }

}// END class

  function SlabTextWidget() {
  register_widget('SlabTextWidget');
  }
  add_action('widgets_init', 'SlabTextWidget');

/* ====================================================== COMMENTS ====================================================== */

function custom_comment($comment, $args, $depth) {
       $GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID( ); ?>">
<div class="the_comment">
<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '50'); } ?>
<div class="the_comment_author"><strong><?php comment_author_link() ?></strong> <?php _e('says', 'designcrumbs'); ?></div>
<?php if ($comment->comment_approved == '0') : //message if comment is held for moderation ?>
<br><em><?php _e('Your comment is awaiting moderation', 'designcrumbs'); ?>.</em><br>
<?php endif; ?>
<div class="the_comment_text"><?php comment_text() ?></div>
<small class="commentmetadata">
<?php comment_date(get_option( 'date_format' )) ?> - <?php comment_date('g:i a') ?> - <a href="<?php comment_link() ?>" class="comment_permalink"><?php _e('Permalink', 'designcrumbs'); ?></a>
</small>
<div class="reply">
<?php edit_comment_link( __('Edit', 'designcrumbs'),'',' &nbsp;|&nbsp; '); ?><?php echo comment_reply_link(array('reply_text' => __('Reply', 'designcrumbs'), 'depth' => $depth, 'max_depth' => $args['max_depth']));  ?>
</div>
<div class="clear"></div>
</div>
<?php } function custom_pings($comment, $args, $depth) {
       $GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID( ); ?>">
<?php _e('Trackback from', 'designcrumbs'); ?> <em><?php comment_author_link() ?></em>
<div class="the_comment_text"><?php comment_text() ?></div>
<small class="commentmetadata">
<?php comment_date(get_option( 'date_format' )) ?>
</small>
<div class="clear"></div>
<?php }<file_sep><?php

function dcs_load_scripts() {

	// load WP's included jQuery library
	wp_enqueue_script('jquery');

	// global scripts
	wp_enqueue_script('jquery-slabtext', get_template_directory_uri() . '/includes/js/jquery.slabtext.min.js');
	wp_enqueue_script('jquery-easing', get_template_directory_uri() . '/includes/js/jquery.easing.1.3.js');
	wp_enqueue_script('jquery-fancybox', get_template_directory_uri() . '/includes/fancybox/jquery.fancybox.js');
	wp_enqueue_script('jquery-mobilemenu', get_template_directory_uri() . '/includes/js/jquery.mobilemenu.js');
	wp_enqueue_script('jquery-fitvids', get_template_directory_uri() . '/includes/js/jquery.fitvids.js');
	
	// front page scripts
	if (is_front_page()) { 
		wp_enqueue_script('jquery-slides', get_template_directory_uri() . '/includes/js/flexslider/jquery.flexslider.js');
		wp_enqueue_style('css-flexslider', get_template_directory_uri() . '/includes/js/flexslider/flexslider.css');
	}
	
	// sticky header
	if ((of_get_option('sticky_header') == 'yes') && (of_get_option('body_display') == 'body_span')) {
		wp_enqueue_script('jquery-sticky', get_template_directory_uri() . '/includes/js/jquery.sticky.js');
	}
	
	// load singular (posts and pages) scripts
	if ( is_singular() ) {
		wp_enqueue_script( 'comment-reply' ); //enable nested comments 
	}
	
	// global styles
	wp_enqueue_style('css-fancybox', get_template_directory_uri() . '/includes/fancybox/jquery.fancybox.css');
	wp_enqueue_style('heading-font', get_template_directory_uri() . '/fonts/style-' . stripslashes(of_get_option('heading_font')) . '.css');
		
	// load in footer
	function dcs_add_footer_js() {
    	get_template_part('includes/js/campaignjs');
	}
	add_action('wp_footer', 'dcs_add_footer_js');
		
}
add_action('wp_enqueue_scripts', 'dcs_load_scripts');