<?php

// Using hooks is absolutey the smartest, most bulletproof way to implement things like plugins,
// custom design elements, and ads. You can add your hook calls below, and they should take the 
// following form:
// add_action('thesis_hook_name', 'function_name');
// The function you name above will run at the location of the specified hook. The example
// hook below demonstrates how you can insert Thesis' default recent posts widget above
// the content in Sidebar 1:
// add_action('thesis_hook_before_sidebar_1', 'thesis_widget_recent_posts');

// Delete this line, including the dashes to the left, and add your hooks in its place.

/**
 * function custom_bookmark_links() - outputs an HTML list of bookmarking links
 * NOTE: This only works when called from inside the WordPress loop!
 * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
 *
 * @since 1.0
 * @global object $post
*/

function custom_bookmark_links() {
	global $post;
?>
<ul class="bookmark_links">
	<li><a rel="nofollow" href="http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
</ul>
<?php
}

/* CUSTOM Dennison+Wolfe FOOTER HOOK */

remove_action('thesis_hook_footer', 'thesis_attribution');
function add_custom_footer () { ?>

<p>Content &#169; <?php echo date("Y"); ?> OjaiPilates.com&#8212;All Rights Reserved | <a href="http://www.dennisonwolfe.com" title="Link to the Dennison+Wolfe home page.">Design and Development</a> by Dennison+Wolfe Internet Group</p>

<?php }

add_action('thesis_hook_footer', 'add_custom_footer'); 



/* HOME PAGE CUSTOM TEMPLATE */

function home_pagecustom() {
if (is_home() || is_front_page())  {
?>

<div id="home_top_message">
<?php if (have_posts()) : ?>
	<?php while (have_posts()) : the_post(); ?>
											
			<div id="home_message">
				<h3><?php the_title(); ?></h3>
				<?php thesis_build_sidebars(); ?>
			</div>

<?php endwhile; ?>

<?php else : ?>
	
	<h2>Not Found</h2>
	<p>Sorry, but you are looking for something that isn't here.</p>
	<?php include (TEMPLATEPATH . "/searchform.php"); ?>
	
<?php endif; ?>
</div>

<?php $temp_query = $wp_query; ?>

<div id="home_bottom_content_row">
	<div id="home_sell_points">
		<div id="sell-point-one">
			<?php query_posts('p=19'); ?>
			<?php while (have_posts()) : the_post(); ?>
				<h3><a href="<?php bloginfo('url'); ?>/what-is-pilates" class="blog_title"><?php the_title(); ?></a></h3>
				<?php the_excerpt(); ?><br /><a href="<?php bloginfo('url'); ?>/what-is-pilates" class="more_link">Find out more ></a>					 
			 <?php endwhile; ?>
		</div>
		<div id="sell-point-two">
			<?php query_posts('p=21'); ?>
			<?php while (have_posts()) : the_post(); ?>
				<h3><a href="<?php bloginfo('url'); ?>/testimonials" class="blog_title"><?php the_title(); ?></a></h3>
				<?php the_excerpt(); ?><br /><a href="<?php bloginfo('url'); ?>/testimonials" class="more_link">Find out more ></a>					 
			 <?php endwhile; ?>
		</div>
		<div id="sell-point-three">
			<?php query_posts('p=23'); ?>
			<?php while (have_posts()) : the_post(); ?>
				<h3><a href="<?php bloginfo('url'); ?>/fitness-tips-facts" class="blog_title"><?php the_title(); ?></a></h3>
				<?php the_excerpt(); ?><br /><a href="<?php bloginfo('url'); ?>/fitness-tips-facts" class="more_link">Find out more ></a>				 
			 <?php endwhile; ?>
		</div>
	</div>
</div>

<?php } }

/* HOME PAGE IMPLEMENT */
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');


/* ADD IN LOGO BEFORE SIDE BAR ON ALL PAGES EXCEPT HOME PAGE */
function logo_topsidebar() {
if (is_home() || is_front_page()) { } else {
?>

	<div id="NBP-sidebar-logo">
		<img src="<?php bloginfo('url'); ?>/wp-content/themes/thesis/custom/images/NBP_logo_sidebar.png" alt="New Body Pilates Logo" width="138" height="154" border="0">
	</div>

<?php } }

add_action('thesis_hook_before_sidebars', 'logo_topsidebar');

