April 21st, 2013
Event Shortcode
/* ------------------- THEME FORCE ---------------------- */
/*
* EVENTS SHORTCODES (CUSTOM POST TYPE)
* http://www.noeltock.com/web-design/wordpress/how-to-custom-post-types-for-events-pt-2/
*/
// 1) FULL EVENTS
//***********************************************************************************
function tf_events_full ( $atts ) {
// - define arguments -
extract(shortcode_atts(array(
'limit' => '10', // # of events to show
'description' => '150' // # of Chars to show in description
), $atts));
// ===== OUTPUT FUNCTION =====
ob_start();
// ===== LOOP: FULL EVENTS SECTION =====
// - hide events that are older than 6am today (because some parties go past your bedtime) -
$today6am = strtotime('today 6:00') + ( get_option( 'gmt_offset' ) * 3600 );
// - query -
global $wpdb;
$querystr = "SELECT *
FROM $wpdb->posts wposts, $wpdb->postmeta metastart, $wpdb->postmeta metaend
WHERE (wposts.ID = metastart.post_id AND wposts.ID = metaend.post_id)
AND (metaend.meta_key = 'tf_events_enddate' AND metaend.meta_value > $today6am )
AND metastart.meta_key = 'tf_events_enddate'
AND wposts.post_type = 'tf_events'
AND wposts.post_status = 'publish'
ORDER BY metastart.meta_value ASC LIMIT $limit";
$events = $wpdb->get_results($querystr, OBJECT);
// - declare fresh day -
$daycheck = null;
// - loop -
if ($events):
global $post;
foreach ($events as $post):
setup_postdata($post);
// - custom variables -
$custom = get_post_custom(get_the_ID());
$sd = $custom["tf_events_startdate"][0];
$ed = $custom["tf_events_enddate"][0];
?>
<div class="full-events"><!--?php
// - determine if it's a new day -
$longdate = date("l, F j, Y", $sd);
if ($daycheck == null) { echo '<br ?-->
<h3 class="title">' . $longdate . '</h3>
'; } if ($daycheck != $longdate && $daycheck != null) { echo '
<h3 class="title">' . $longdate . '</h3>
'; } // - local time format - $time_format = get_option('time_format'); $stime = date($time_format, $sd); $etime = date($time_format, $ed); // - output - ?>
<table>
<tbody>
<tr>
<td class="time"></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>
<?php // - fill daycheck with the current day -
$daycheck = $longdate;
endforeach; else : endif;
// ===== RETURN: FULL EVENTS SECTION =====
$output = ob_get_contents();
ob_end_clean();
return $output;
}
add_shortcode('events', 'tf_events_full');
// You can now call onto this shortcode with [tf-events-full limit='20'] ?>
Posted in Coding |
No Comments »
January 29th, 2013
I recently received a series of text messages from a former swimmer. I had only coached this athlete for two high school seasons and not only did he have an impact on my life, but these messages clearly showed that I had an impact on his as well.
Hey Coach Greg! I just wanted to shoot you a quick text here. I just wanted to let you know how grateful I was to have had you as my head coach senior year. I know this might be a little late, but my family and I were discussing swim season and I was describing my senior season to them and out of all the sports and coaches I have had you were the most inspiring to me. You inspired a goof of a kid with some talent to put his mind and will to a sport and team and I will always appreciate that. You taught me valuable life lessons that I will carry for the rest of my life…senior year was such a blast and seeing you behind us not only as a coach but as friends too meant a lot to me. Seeing you get emotional at conference truly I feel was the moment that defined you as a coach. Emotional, yet reserved and fully supportive of everybody on the team. Not just varsity, but also JV. Even if you may have some things you would’ve changed or done differently if you had a second chance, just know that I wouldn’t have changed a single thing. That season, that team was the best of my high school career. You believed in me when other coaches didn’t, and sometimes that’s all someone really needs is someones belief in them. The only thing I might have changed is to have you as my coach for my whole high school career (haha). I just thought I should give a long deserved thanks from me to you Coach Greg. I hope that you have luck in coaching because you’re one damn good coach.
Comments like this help solidify my place on a pool deck and make the time and sacrifices worth while. Who have you heard from and what have they said to make what you do mean even more?
Posted in Coaching, Life, Personal |
No Comments »
January 22nd, 2013
If you are looking for some code to generate tiered page titles within Umbraco here is an example that worked for our site. This code assumes you are using pageTitle as a DocType element.
Read the rest of this entry »
Posted in Coding |
No Comments »
September 18th, 2012
Over the weekend, a friend asked me to do something I’ve never done before. Photograph their wedding.
While I wasn’t the official photographer, I was asked to take one of the last photos of the night. The one posted below. I have never done photos like this and was impressed with my results. I have done zero post work (yet) and am looking for tips/tricks/advice on post work and general thoughts of how it turned out.

Photo from M&J’s wedding.
Edit: I recently visited the home of this couple and was pleasantly surprised to see my photography hanging in their living room. I am so proud to be apart of this couples day and happy to have this hanging in their home.
Posted in Photography |
2 Comments
»
July 30th, 2012
When creating WordPress themes, sometimes it’s necessary to create your own menus. With 3.0+ you are able to create menus as well as a fallback menu.
Within the fallback_cb, you can actually call your own functions to create a customized menu (helpful when developing for network of blogs).
Here’s what you’ll need to do.
1. Activate Custom Menus
How to Add Custom Navigation Menus in WordPress 3.0 Themes
2. Place your Menu in the Template
Ex:
wp_nav_menu( array( 'theme_location' => 'top-nav', 'depth' => 1, 'menu_name', 'Top Nav', 'menu_class' => 'menu', 'fallback_cb' => 'yourCustomMenuName') );
3. Create a new Function (within functions.php)
function yourCustomMenuName() {
<div class="menu">
<ul>
<li>Menu Item 1</li>
<li>Menu Item 2</li>
<li>Menu Item 3</li>
</ul>
</div>
}
4. Test it!
Add and remove your custom menu (from Appearance => Menu) to see if your custom menu displays as the fallback and you’re done!
Posted in Coding |
No Comments »