New Portfolio Design and Other Interesting Stuff

It’s been a while since I’ve written anything here, most of what I’ve been writing has been posted over at DuncanDay.com or CSSForge.com. Unfortunately, I haven’t been doing as much writing over at those sites as I would like to, either.

Back on topic, though, as you can see I’ve finally gotten around to putting a fresh coat of paint on my portfolio. I’m extremely happy with the way that it turned out, which is a pretty rare occurrence in and of itself. I plan on continuing to iterate on the design here, but I’ll be turning my focus over to Lucid Theme and CSSForge.

I’m also currently working on the beginning stages of a new web app with a friend of mine, Gabe Marshall. This is the first product that I’ve ever worked on, so naturally I’m pretty damn excited.

That’s all I’ve got for now, but I would love to hear your thoughts on the new portfolio design!

New Project: CSSForge.com

Radio silence broken. Over the weekend I worked hard to make finishing touches to my new blog, CSSForge.com, and get it launched.

Going forward, I will be posting on both CSS Forge and this site. CSS Forge will be geared more towards inspiration, tutorials and general web development news. Some articles will be cross-posted between here and there, but for the most part I will try and keep the content unique to each.

As a result, this site will be geared more towards the projects that I am working on. Some of those will have to remain nameless, because of NDA’s and what-not.

I hope you all like the new CSSForge site. I’m working on a post about device agnostic design (which is the approach that I took there).

Creating a Custom Footer with Genesis

When I first started using the Genesis Framework, it was pretty intimidating. I previously had no experience with using hooks and PHP logic was still rather fuzzy to me.

Once I started digging into the Genesis core and saw how things worked, though, it all became infinitely more clear.

Creating custom footers is one of those ways to get the functionality you want, where you want it, without having to resort to rebuilding the entire template from the ground up (which is, not-so-coincidentally, one of the things I love most about Genesis).

So without further ado, here is the code to replace the default footer with a custom footer. Place the code below in your themes functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
/** Customize the footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5);
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15);
function child_custom_footer() { ?>
 
    <footer>
        <!-- Home page footer -->
    </footer>
 
<?php }
add_action( 'genesis_footer', 'child_custom_footer' ); 
/** Customize the footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5);
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15);
function child_custom_footer() { ?>

  	<footer>
  	    <!-- Home page footer -->
  	</footer>

<?php }
add_action( 'genesis_footer', 'child_custom_footer' ); 

That's all there is to it. Quite simple, actually... but what if you want to display one footer on the home page, but a different one on every other page?

Well here's how you would do that:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/** Customize the footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5);
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15);
function child_custom_footer() { 
 
  if(is_front_page()) {?>
 
    <footer>
        <!-- Home page footer -->
    </footer>
    
  <?php }
 
  elseif (!is_front_page()) {?>
 
    <footer>
        <!-- Your other footer -->
    </footer>
 
  <?php }
}
add_action( 'genesis_footer', 'child_customer_footer' ); 
/** Customize the footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5);
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15);
function child_custom_footer() { 

  if(is_front_page()) {?>

  	<footer>
  	    <!-- Home page footer -->
  	</footer>
  	
  <?php }

  elseif (!is_front_page()) {?>

	<footer>
		<!-- Your other footer -->
	</footer>

  <?php }
}
add_action( 'genesis_footer', 'child_customer_footer' ); 

Let's take a quick look at it, line by line, and figure out what this function is doing.

Lines 2-4: These lines are removing the default Genesis footer.

Line 5: Name our new function child_custom_footer.

Line 7: If the current page is the front page of the site, execute the code in the brackets. If not, move to the elseif.

Lines 9-11: This is where you'll place your HTML.

Line 15: If the page is not the home page, execute the code in the brackets.

Lines 17-19: This is where you add the HTML for your alternate footer.

Line 23: Add our new function in the genesis_footer section of the Genesis Framework.

If you have any questions, feel free to leave me a comment!

---
Full disclosure: the above link to the Genesis Framework is an affiliate link... so you should totally buy it.