<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Designs By Nick the Geek</title>
	<atom:link href="https://designsbynickthegeek.com/feed" rel="self" type="application/rss+xml" />
	<link>https://designsbynickthegeek.com</link>
	<description>Genesis Based WordPress Development and Tutorials for Everyone</description>
	<lastBuildDate>Wed, 26 Feb 2020 21:04:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>
<site xmlns="com-wordpress:feed-additions:1">43579896</site>	<item>
		<title>Genesis Explained Book and More</title>
		<link>https://designsbynickthegeek.com/tutorials/genesis-explained-book-and-more</link>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Thu, 21 Dec 2017 15:00:47 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1331</guid>

					<description><![CDATA[It has been over 5 and a half years since I started planning the Genesis Explained book. That is a crazy amount of time. So much has happened since then. I started working for Copyblogger/Rainmaker and became a full-time and eventually senior developer for them. I can&#8217;t tell you how much work I did because [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" data-attachment-id="1332" data-permalink="https://designsbynickthegeek.com/tutorials/genesis-explained-book-and-more/attachment/genesis-explained-book-cover" data-orig-file="https://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover.jpg" data-orig-size="504,658" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="genesis-explained-book-cover" data-image-description="" data-image-caption="" data-medium-file="https://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover-230x300.jpg" data-large-file="https://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover.jpg" class="alignright size-full wp-image-1332" src="http://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover.jpg" alt="" width="504" height="658" srcset="https://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover.jpg 504w, https://designsbynickthegeek.com/wp-content/uploads/2017/12/genesis-explained-book-cover-230x300.jpg 230w" sizes="(max-width: 504px) 100vw, 504px" />It has been over 5 and a half years since I started planning the Genesis Explained book. That is a crazy amount of time.</p>
<p>So much has happened since then. I started working for Copyblogger/Rainmaker and became a full-time and eventually senior developer for them. I can&#8217;t tell you how much work I did because it is just difficult to imagine just how monumental it really was.</p>
<p>In that time I felt I was sliding further and further from the community that meant so much to me. I wasn&#8217;t really able to maintain my plugins or plan the future of them. I tried more than once to hand development off but things never really worked out.</p>
<p>I stopped having time to work on my blog.</p>
<p>I didn&#8217;t even get on twitter very often any more.</p>
<p>I mean, when I do something I go all in and that is what I did with my work. Between the church, development, and my family I just didn&#8217;t have any time at all to do the Genesis Explained book.</p>
<p>Things changed back in October. It was a very sad and equally exciting change. I ended up leaving Rainmaker to start work at Reaktiv Studios. It took me a while to get in the swing of things but while making the transition I started evaluating my goals and life. Ultimately I decided that I needed to start doing more.</p>
<p>Actually this really started back in the spring. I decided to apply to speak at WordCamp DC. It had been so long since I&#8217;ve been involved in the WordPress community that I really didn&#8217;t know if I&#8217;d be accepted so when I was, I went all in.</p>
<p>I enjoyed WordCamp DC so much that I felt I needed to start doing more.</p>
<p>That is why I started setting aside some time each day to work on my Genesis Explained book and to start planning the future of my plugins.</p>
<p>I&#8217;ve been able to do 2 updates on Genesis Featured Widget Amplified, but more than that I&#8217;ve got things planned for several new updates that will add new features and improve the underlying code.</p>
<p>I also got to attend WordCamp US a few weeks ago. That resulted in meeting the owner of OS Training. They have a series of books with the title format &#8220;&#8230; Explained.&#8221; My Genesis Explained book seemed to be a perfect fit so we started talking, then emailing, and now the book is just about ready to publish.</p>
<p>In fact, it will be coming out <b>very</b> early in 2018, just a few weeks away.</p>
<p>I&#8217;ve talked about this on Twitter and with my long neglected email list.</p>
<p>I am sending my email list a draft copy of the book just like I promised all those years ago.</p>
<p>The book has a lot of the content from the Genesis Explained series, but it was updated to make sure the content is correct for Genesis 2.5.x. I&#8217;ve also added several new chapters on features that have been added since I stopped publishing the series.</p>
<p>So here is the bottom line, I want to give you an opportunity to sign up for more information.</p>
<p>The plan is to do a soft launch to get the book to a few people and then the big kickoff. I want to make sure you know everything you can about this and about all the new things I&#8217;m working on.</p>
<p>All I need to keep you up to date, is a bit of info. If I did the form correctly, it should appear when you get to the bottom of this page. Just fill it out with your name and email and I&#8217;ll make sure you get the latest news.</p>
<p>I promise, I&#8217;m not about to spam you like mad. I know a lot of people promise that kind of thing and fail, but I&#8217;ve literally sent 2 emails in the last 5+ years to my subscribers. I&#8217;m going to do better but the goal is to find balance, not go crazy.</p>
<h2>Oh, and one last thing</h2>
<p>If the sign up form doesn&#8217;t slide out for you at the bottom of the page (I&#8217;m looking at you FireFox) then I added a simple page you can sign up at without a problem.</p>
<h4><a class="button button-primary more-link" href="https://mailchi.mp/7cb6c18d0615/genesis-explained-updates" target="_blank">Sign Up Now</a></h4>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1331</post-id>	</item>
		<item>
		<title>Efficient plugin design using advanced WordPress hooks &#8211; WCDC 2017</title>
		<link>https://designsbynickthegeek.com/experiences/advanced-wordpress-hooks-wcdc</link>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Wed, 12 Jul 2017 14:00:12 +0000</pubDate>
				<category><![CDATA[Experiences]]></category>
		<category><![CDATA[WCDC]]></category>
		<category><![CDATA[WordCamp]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1308</guid>

					<description><![CDATA[I&#8217;m being given the opportunity to share on improving plugin design with advanced WordPress hooks at WordCamp 2017. In preparation I am putting together some resources that will be very helpful. Efficient plugin design using advanced WordPress hooks full presentation WCDC Advanced Hooks Version 0.1 &#8211; Least Efficient Version 0.2 &#8211; is_admin() Version 0.3 &#8211; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large.jpeg"><img decoding="async" data-attachment-id="1311" data-permalink="https://designsbynickthegeek.com/experiences/advanced-wordpress-hooks-wcdc/attachment/depxnfsxkaa3p9i-jpg-large" data-orig-file="https://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large.jpeg" data-orig-size="600,300" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="DEPXnfSXkAA3P9I.jpg-large" data-image-description="" data-image-caption="" data-medium-file="https://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large-300x150.jpeg" data-large-file="https://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large.jpeg" src="http://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large.jpeg" alt="" width="600" height="300" class="alignright one-half size-full wp-image-1311" srcset="https://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large.jpeg 600w, https://designsbynickthegeek.com/wp-content/uploads/2017/07/DEPXnfSXkAA3P9I.jpg-large-300x150.jpeg 300w" sizes="(max-width: 600px) 100vw, 600px" /></a>I&#8217;m being given the opportunity to share on improving plugin design with <a href="https://2017.dc.wordcamp.org/session/efficient-plugin-design-using-advanced-wordpress-hooks/" target="_blank">advanced WordPress hooks at WordCamp 2017</a>. In preparation I am putting together some resources that will be very helpful.</p>
<ul>
<li><a href="https://www.dropbox.com/s/0x1mam2bdpki531/Efficient%20plugin%20design%20using%20advanced%20WordPress%20hooks.pdf?dl=0" target="_blank">Efficient plugin design using advanced WordPress hooks full presentation</a></li>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks" target="_blank">WCDC Advanced Hooks</a>
<ul>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks/tags/0.1" target="_blank">Version 0.1 &#8211; Least Efficient</a></li>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks/tags/0.2" target="_blank">Version 0.2 &#8211; is_admin()</a></li>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks/tags/0.3" target="_blank">Version 0.3 &#8211; Autoloader</a></li>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks/tags/0.4" target="_blank">Version 0.4 &#8211; Advanced Hooks</a></li>
<li><a href="https://gitlab.com/NicktheGeek/wcdc-advanced-hooks/tags/0.5" target="_blank">Version 0.5 &#8211; Bonus</a></li>
</ul>
</li>
<li><a href="https://codex.wordpress.org/Plugin_API/Action_Reference/" target="_blank">Action Reference</a></li>
<li><a href="http://designsbynickthegeek.com/tutorials/genesis-explained-actions" target="_blank">Actions Explained</a></li>
<li><a href="http://designsbynickthegeek.com/tutorials/genesis-explained-filters" target="_blank">Filters Explained</a></li>
</ul>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1308</post-id>	</item>
		<item>
		<title>Genesis Plugins: Building a WordPress Admin Page</title>
		<link>https://designsbynickthegeek.com/plugins/genesis-plugins-building-a-wordpress-admin-page</link>
					<comments>https://designsbynickthegeek.com/plugins/genesis-plugins-building-a-wordpress-admin-page#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Fri, 17 Jan 2014 18:00:35 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1252</guid>

					<description><![CDATA[Start with a plan He who fails to plan is planning to fail ~Winston Churchill Interesting fact, Google said that Benjamin Franklin may have been the originator on that quote, but don&#8217;t quote me on that. I also learned recently that Hemingway may have never said, &#8220;Write drunk. Edit Sober.&#8221; For sure he didn&#8217;t follow [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Start with a plan</h2>
<blockquote><p><a href="http://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta.jpg"><img decoding="async" data-attachment-id="1256" data-permalink="https://designsbynickthegeek.com/plugins/genesis-plugins-building-a-wordpress-admin-page/attachment/big-three-yalta" data-orig-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta.jpg" data-orig-size="1500,1230" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="big-three-yalta" data-image-description="" data-image-caption="" data-medium-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta-300x246.jpg" data-large-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta-1024x839.jpg" src="http://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta-300x246.jpg" alt="big-three-yalta" width="300" height="246" class="alignright size-medium wp-image-1256" srcset="https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta-300x246.jpg 300w, https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta-1024x839.jpg 1024w, https://designsbynickthegeek.com/wp-content/uploads/2014/01/big-three-yalta.jpg 1500w" sizes="(max-width: 300px) 100vw, 300px" /></a>He who fails to plan is planning to fail<br />
<cite>~Winston Churchill</cite></p></blockquote>
<p>Interesting fact, Google said that Benjamin Franklin may have been the originator on that quote, but don&#8217;t quote me on that. I also learned recently that Hemingway may have never said, &#8220;Write drunk. Edit Sober.&#8221; For sure he didn&#8217;t follow that advice. I feel a bit out of sorts with all of these new revelations.</p>
<p>In any case, the point is that you need to start with a plan. You <a href="http://designsbynickthegeek.com/tutorials/your-first-plugin">already know what you want your plugin to do</a>, but what options do you want to make for the plugin users? The way I see it, there are two schools of thought on this.</p>
<ul>
<li>Add all the options</li>
<li>Add minimal to no options</li>
</ul>
<p>Each of these approaches are based on different underlying opinions on what a user wants. If you go ask a user if they want more options, they will probably say, &#8220;yes&#8221;. We like the idea of control so we want more ways to control the output.</p>
<p>A lot of studies in UX/UI seem to point towards users actually preferring fewer and more intuitive options. A great example is the iOS. People love it because it is simple and easy to use. Sure, you are much more limited in what you can do, but most users just don&#8217;t care so long as it works.</p>
<p>Regardless of which approach you follow, I highly recommend outlining the options, then reviewing them to ask if they make sense. I tend to add all the options to my initial outline then I start asking myself how I can condense the options. A few lucky people have been able to get in on some early testing for the Genesis Simple Share plugin. I hope they really like the super simple admin UI. When it started there were several options for each sharing icon and then some additional general options. In the end the sharing icons were mostly given a single option, &#8220;enable this icon.&#8221; The interface was cleaned up and I think it is much easier for people to use.</p>
<p>For &#8220;power&#8221; users who might want to have more complex control it is possible to use template functions to do a lot more.</p>
<p>I personally think that is how we should approach the admin. If you can make your plugin work well without user controlled settings, skip this article. Of course, most of the time you need to have at least some options, but consider making a minimalist admin page. Include only what is necessary, especially for your initial release.</p>
<p>As a closing example, I run sound for my church. I was watching videos to learn more about how to balance the sound because I noticed that often, the live mix seemed muddy and harsh. One sound technician said &#8220;always cut first.&#8221; What that means is, when mixing sound you need to find the frequencies that sound bad and lower those for each instrument and vocalist first. This creates places for other sounds to fill and makes it a lot easier to bring up a few things to round out the sound than to have too much stacked in a small frequency range. That is what makes muddy and harsh sounding music. The next week I did a lot of cuts and did very little else to change the mix. The music was significantly better than the prior week.</p>
<p>I think we, as developers, have a habit of filling the voids because we can but that results in overwhelming option screens that are hard to use. Try cutting options first, then add back anything you absolutely need.</p>
<h2>Add the Page</h2>
<p>Now that you have an idea of what options you will need it is time to build your page. There are quite a few <a href="http://wpsmith.net/2012/genesis/how-to-use-the-new-genesis-admin-class-metabox-example/" target="_blank">good tutorials</a> on working with the <a href="http://www.billerickson.net/admin-pages-with-genesis/" target="_blank">Genesis admin class</a>. This was introduced in Genesis 1.8 and has made it very easy to build a consistent admin experience across plugins. This is important because a consistent experience means users will be more likely to know how your admin screen works. After all, they have already seen similar screens.</p>
<p>That said, if you can come up with an intuitive way to get your options on page then take time to work on added styling and js. I&#8217;ve been seeing some users that have done some really interesting things lately like the <a href="https://genesisdesignpro.com" target="_blank">Genesis Design Palette Pro</a> plugin by <a href="http://andrewnorcross.com" target="_blank">Andrew Norcross</a>.</p>
<p>Here is what the basic class looks like with the bare essentials in place. I&#8217;ll fill those in as I explain the various parts in more detail.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/**
 * Creates the plugin admin page.
 *
 *
 * @category Genesis Boilerplate
 * @package  Admin
 * @author   copyblogger
 * @license  http://www.opensource.org/licenses/gpl-license.php GPL-2.0+
 */
 
 /* Prevent direct access to the plugin */
if ( !defined( 'ABSPATH' ) ) {
    die( &quot;Sorry, you are not allowed to access this page directly.&quot; );
}

/**
 * Registers a new admin page, providing content and corresponding menu items
 *
 * @category Genesis Boilerplate
 * @package Admin
 *
 * @since 0.1.0
 */
class Genesis_Boilerplate_Boxes extends Genesis_Admin_Boxes {
	
	
	/**
	 * Create an admin menu item and settings page.
	 *
	 * @since 0.1.0
	 *
	 */
	function __construct() {
		
		/*
		 defines the setting value. 
		 You will use genesis_get_option( 'option', 'genesis_boilerplate' ); 
		 to retrieve &quot;option&quot; from this field later
		*/
		$settings_field   = 'genesis_boilerplate'; 
		
		//allows you to set defaults. Look for a full example below
		$default_settings = array();
		
		//define where your page can be found
		$menu_ops = array(
			 'submenu' =&gt; array(
				/** Do not use without 'main_menu' */
				'parent_slug' =&gt; 'genesis', //loads under &quot;genesis&quot; menu
				'page_title'  =&gt; __( 'Genesis Boilerplate Settings', 'genesis-boilerplate' ), //shows on page
				'menu_title'  =&gt; __( 'Boilerplate', 'genesis-boilerplate' ) //shows in the menu
			) 
		);
		
		/** Just use the defaults most of the time other tutorials can show you how to get advanced here */
		$page_ops = array();
		
		//creates the page
		$this-&gt;create( 'genesis_boilerplate_settings', $menu_ops, $page_ops, $settings_field, $default_settings );
		
		//loads the sanitizer. Look for details below.
		add_action( 'genesis_settings_sanitizer_init', array( $this, 'sanitizer_filters' ) );
		
	}
	
	/**
	 * Register each of the settings with a sanitization filter type.
	 *
	 * @since 0.9.0
	 *
	 * @uses genesis_add_option_filter() Assign filter to array of settings.
	 *
	 * @see \Genesis_Settings_Sanitizer::add_filter() Add sanitization filters to options.
	 */
	function sanitizer_filters() {
		
	}
	
	/**
	 * Loads required scripts.
	 *
	 * @since 0.1.0
	 *
	 */
	function scripts() {
		
	}
	
	/**
 	 * Register meta boxes.
 	 *
 	 *
 	 * @since 0.1.0
 	 *
 	 */
	function metaboxes() {

	}
	
}

new Genesis_Boilerplate_Boxes;

</pre>
<h3>Load CSS and Javascript</h3>
<p>I previously wrote on the <a href="http://designsbynickthegeek.com/tutorials/genesis-explained-admin-clas" target="_blank">Genesis Admin Class</a> so I&#8217;m not going to spend much time explaining the basic class, but since I&#8217;m encouraging users to work on including CSS and JS if they have come up with a good solution I want to focus on how to do that.</p>
<p>I&#8217;m assuming a specific file structure with these examples. It isn&#8217;t the only way to do things, but it is how I tend to build a plugin</p>
<ul>
<li>genesis-boilerplate/
<ul>
<li>plugin.php</li>
<li>lib/
<ul>
<li>admin.php</li>
<li>front-page.php</li>
<li>functions.php</li>
<li>css/
<ul>
<li>admin.css</li>
<li>style.css</li>
</ul>
</li>
<li>js/
<ul>
<li>admin.js</li>
<li>plugin.js</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>If your file structure is different you may need to amend the code used to load the Javascript and Styles.</p>
<p>If you are manually building your admin page you have to build a custom action to load the styles and you should check the page hook to make sure you are loading the scripts and styles only on your settings page. I&#8217;m going to repeat myself here</p>
<blockquote><p>Only load your scripts and styles on your admin page</p></blockquote>
<p>I can&#8217;t stress this enough. One of the biggest problems other plugins cause is when they load scripts or styles universally in the dashboard. I&#8217;ve even seen many plugins that are fine on their own but they end up breaking other plugins because they&#8217;ve used common class names and changed them. We recently had to change our clear class because a plugin was styling .clear and gave it some strange markup. The markup probably made sense in the plugin admin page but it broke our admin page. That should never happen and in the github issue where I fixed the issue I said:</p>
<blockquote><p>
To test, enable a plugin that breaks the admin screen because of stupid developers. Our classes are different and shouldn&#8217;t be broken.
</p></blockquote>
<p>Please don&#8217;t be a stupid developer. Make sure your scripts are loaded only on your admin page.</p>
<p>Fortunately, we are using the Genesis Admin Class. All you need to do is add a <code>scripts()</code> method and it will load your scripts correctly and only on your admin page. The Genesis class automatically loads this method so you do not need to use an action to load it on the right hook or check the page hook to make it load only on your admin page. This is all done automatically. You get to be a smart developer and it is super easy. That makes you some kind of dragon ninja warrior kind of developer.</p>
<p>So, here is the example code you can use. I&#8217;ve added a lot of comments to help with explaining it.</p>
<pre class="brush: php; title: ; notranslate">
	/**
	 * Loads required scripts.
	 *
	 * @since 0.1.0
	 *
	 */
	function scripts() {
	
		//adding some common scripts here. You may or may not need them
		wp_enqueue_script( 'common' ); 
		wp_enqueue_script( 'wp-lists' );
		wp_enqueue_script( 'postbox' );
	
		//use wp_enqueue_script() and wp_enqueue_style() to load scripts and styles
		wp_enqueue_script( 'genesis-boilerplate-admin-js', //make sure you namespace your ID and pick a unique and descriptive name
							plugins_url( 'js/admin.js', __FILE__ ), //adjust if needed. This automatically builds the right URL based on the file structure above
							array( 'jquery' ), //I'm assuming the file needs jQuery.
							'0.1.0' //use versions so if you have to update people get the right version
						);
		
		//This is enqueueing the style. It is very similar to the script function above but geared for styles
		wp_enqueue_style( 	'genesis-boilerplate-admin-css', 
							plugins_url( 'css/admin.css', __FILE__ ), 
							array(), 
							'0.1.0' 
						);
		
	}
</pre>
<h3>Add Options</h3>
<p>There are many ways to add options. I&#8217;ve built an admin builder class which I talk about in the other post I wrote. I&#8217;ve moved away from that because it is large and I don&#8217;t usually need all those options. Instead I use a few methods and build my options out using those.</p>
<p>The reason for building those option methods is I&#8217;ve found that I tend to use the exact same HTML with a few small changes over and over. It causes very long files and that makes things difficult to read. Check out how clean the code ends up when you take time to build a method to handle repeating code.</p>
<pre class="brush: php; title: ; notranslate">
/**
 	 * Register meta boxes.
 	 *
 	 *
 	 * @since 0.1.0
 	 *
 	 */
	function metaboxes() {
		
		/*
		This loads the functions that display the boxes on the admin page.
		Make sure you use names that are unique and descriptive.
		*/
		add_meta_box( 'genesis_boilerplate_general_settings' , __( 'General' , 'boilerplate' ), array( $this, 'general' ) , $this-&gt;pagehook, 'main' );
		add_meta_box( 'genesis_boilerplate_advanced_settings', __( 'Advanced', 'boilerplate' ), array( $this, 'advanced' ), $this-&gt;pagehook, 'main' );

	}
	
	/**
 	 * Create General settings metabox output
 	 *
 	 *
 	 * @since 0.1.0
 	 *
 	 */
	function general() {
		
		$id = 'general'; //I use an ID to link common options together
		
		?&gt;
		
		&lt;div class=&quot;wrap gb-clear&quot;&gt;		
			
			&lt;br /&gt;
			
			&lt;table class=&quot;form-table&quot;&gt;
			&lt;!--this is using table markup to build out the relationship for labels and options--&gt;
				&lt;tbody&gt;
					
					&lt;?php
						
						//I created a method for building a select field. It is clean and easy to use. Feel free to steal and adapt it
						$this-&gt;select_field( $id . '_size', __( 'Size', 'genesis-boilerplate' ), array(
							'small'  =&gt; __( 'Small' , 'genesis-boilerplate' ),
							'medium' =&gt; __( 'Medium', 'genesis-boilerplate' ),
							'tall'   =&gt; __( 'Box'       , 'genesis-boilerplate' ),
						) );
						
						//I used a wrapper method here. There were a lot of options in the full file this plugin was for so this saved space
						$this-&gt;position( $id );
						//I also have another wrapper method that automatically builds a multicheck from all post types. Another handy thing to steal.
						$this-&gt;post_type_checkbox( $id );
						
					?&gt;
				&lt;/tbody&gt;
			&lt;/table&gt;
		&lt;/div&gt;
		
		&lt;?php
		
	}
	
	/**
 	 * Create Advanced settings metabox output
 	 *
 	 *
 	 * @since 0.1.0
 	 *
 	 */
	function advanced() {
	
		$id = 'advanced';
		
		//This method builds a checkbox
		$this-&gt;checkbox( $id . '_checkbox', __( 'Enable This Option?', 'genesis-boilerplate' ) );
		
		//here is an example of adding a text field directly to the screen without a method. 
		?&gt;&lt;p&gt;
			&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( $id . '_text' ); ?&gt;&quot;&gt;&lt;?php _e( 'Enter text here:', 'genesis-boilerplate' ); ?&gt;&lt;/label&gt;
			&lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name( $id . '_text' ); ?&gt;&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id( $id . '_text' ); ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( $this-&gt;get_field_value( $id . '_text' ); ?&gt;&quot; size=&quot;27&quot; /&gt;
		&lt;/p&gt;&lt;?php
		
		//an alternate solution to the abover would be a text_field() method
		//$this-&gt;text_field( $id . '_text', __( 'Enter text here:', 'genesis-boilerplate' ) );
		
	}
	
	/**
	 * Outputs select field to select position for the icon
	 *
	 * @since 0.1.0
	 *
	 * @param string  $id        ID base to use when building select box.
	 * 
	 */
	function position( $id ){
		
		$this-&gt;select_field( $id . '_position', __( 'Display Position'   , 'genesis-boilerplate' ), array(
			'off'            =&gt; __( 'Select display position to enable.'      , 'genesis-boilerplate' ),
			'before_content' =&gt; __( 'Before the Content'                      , 'genesis-boilerplate' ),
			'after_content'  =&gt; __( 'After the Content'                       , 'genesis-boilerplate' ),
			'both'           =&gt; __( 'Before and After the Content'            , 'genesis-boilerplate' ),
		) );
		
	}
	
	/**
	 * Outputs text field
	 *
	 * @since 0.1.0
	 *
	 * @param string  $id        ID to use when building select box.
	 * @param string  $name      Label text for the select field.
	 * @param array   $option    Array key $option=&gt;$title used to build select options.
	 *
	 */
	function text_field( $id, $label ){
		
		printf( '&lt;label for=&quot;%s&quot;&gt;%s&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;%s&quot; id=&quot;%s&quot; value=&quot;%s&quot; size=&quot;27&quot; /&gt;',
			$this-&gt;get_field_id( $id ),
			$label,
			$this-&gt;get_field_name( $id ),
			$this-&gt;get_field_id( $id ),
			esc_attr( $this-&gt;get_field_value( $id )
		);
		
	}
	
	/**
	 * Outputs select field
	 *
	 * @since 0.1.0
	 *
	 * @param string  $id        ID to use when building select box.
	 * @param string  $label     Label text for the select field.
	 * @param array   $option    Array key $option=&gt;$title used to build select options.
	 *
	 */
	function select_field( $id, $label, $options = array() ){
		$current = $this-&gt;get_field_value( $id );
		?&gt;
		&lt;tr valign=&quot;top&quot;&gt;
			&lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( $id ); ?&gt;&quot;&gt;&lt;?php echo $label ?&gt;&lt;/label&gt;&lt;/th&gt;
			&lt;td&gt;&lt;select name=&quot;&lt;?php echo $this-&gt;get_field_name( $id ); ?&gt;&quot; class=&quot;&lt;?php echo 'genesis_boilerplate_' . $id; ?&gt;&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id( $id ); ?&gt;&quot;&gt;
				&lt;?php
				if ( ! empty( $options ) ) {
					foreach ( (array) $options as $option =&gt; $title ) {
					
						printf( '&lt;option value=&quot;%s&quot;%s&gt;%s&lt;/option&gt;', 
								esc_attr( $option ),
								selected( $current, $option, false ),
								esc_html( $title )
						);
						
					}
				}
				?&gt;
			&lt;/select&gt;&lt;/td&gt;
		&lt;/tr&gt;&lt;?php
	}
	
	/**
	 * Outputs checkbox fields for public post types.
	 *
	 * @since 0.1.0
	 *
	 * @param string  $id        ID base to use when building checkbox.
	 *
	 */
	function post_type_checkbox( $id ){
	
		$post_types = get_post_types( array( 'public' =&gt; true, ) );
		
		printf( '&lt;tr valign=&quot;top&quot;&gt;&lt;th scope=&quot;row&quot;&gt;%s&lt;/th&gt;', __( 'Enable on:', 'genesis-boilerplate' ) );
		
		echo '&lt;td&gt;';
		
		foreach( $post_types as $post_type )
			$this-&gt;checkbox( $id . '_' . $post_type, $post_type );
		
		$this-&gt;checkbox( $id . '_show_archive', __( 'Show on Archive Pages', 'genesis-boilerplate' ) );
		
		echo '&lt;/td&gt;&lt;/tr&gt;';
		
	}
	
	/**
	 * Outputs checkbox field.
	 *
	 * @since 0.1.0
	 *
	 * @param string  $id        ID to use when building  checkbox.
	 * @param string  $label      Label text for the checkbox.
	 *
	 */
	function checkbox( $id, $label ){
		printf( '&lt;label for=&quot;%s&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;%s&quot; id=&quot;%s&quot; value=&quot;1&quot;%s /&gt; %s &lt;/label&gt; ',
				$this-&gt;get_field_id( $id ),
				$this-&gt;get_field_name( $id ),
				$this-&gt;get_field_id( $id ),
				checked( $this-&gt;get_field_value( $id ), 1, false ),
				$label
		);
		echo '&lt;br /&gt;';
	}
</pre>
<p>Of course, I pulled out most of the options this file had so there is probably a net loss or maybe a wash. With more options it can save you significant space and it makes it easier to change the markup on several elements at once.</p>
<h3>Add Defaults</h3>
<p>Once you have your options built you should decide what the default values are.</p>
<h4>Why bother with defaults?</h4>
<p>If people will be setting up options, then why should you give them defaults? Remember, the goal is to make things easy for a user. If they can turn on a plugin and have it work out of the box that is a better experience. The options page should let them set important values that cannot be decided for them or customize the feel of your plugin to quite their needs. You are the expert though, so give them a head start by providing as many default values as you can based on your experience.</p>
<p>Start by filling in the options that you would pick. That will give you a good idea of which values you would recommend. Now use that to fill in the defaults. This goes up in the <code>__construct()</code> method.</p>
<pre class="brush: php; title: ; notranslate">
		/*
		If themes or other plugins should be able to change your defaults use a filter here. 
		Otherwise just use the array without the filter
		*/
		$default_settings = apply_filters(
			'genesis_boilerplate_defaults',
			array(
				'general_size'      =&gt; 'medium',
				'general_position'  =&gt; 'before_content',
				'general_post'      =&gt; 1,
				'advanced_checkbox' =&gt; 0,
				'advanced_text'     =&gt; __( 'Default Text', 'genesis_boilerplate' ), //if you define default text internationalize it
			)
		);
</pre>
<h3>Sanitize Your Options</h3>
<p>Another important step here is to sanitize the values. If you do not sanitize your content it opens your plugin up to exploits. Sanitizing the saved option also means you can know with greater certainty what type of value will be returned on the front end of the site. The number one rule of sanitizing options is to make sure the option uses the least possible filter. A checkbox should be validated with only the possible option, typically 1 or 0. Select boxes and most text fields can be no HTML.</p>
<p>Fortunately Genesis makes this very easy too. There is a class that runs various sanitization filters that you can quickly access in the Genesis Admin Class.</p>
<p>The example code here has those filters in what I deem to be the order of risk. If you can use a higher filter for your option it is safer to use that filter. The lower the filter is, the more risk there is in using it.</p>
<pre class="brush: php; title: ; notranslate">
	/**
	 * Register each of the settings with a sanitization filter type.
	 *
	 * @since 0.9.0
	 *
	 * @uses genesis_add_option_filter() Assign filter to array of settings.
	 *
	 * @see \Genesis_Settings_Sanitizer::add_filter() Add sanitization filters to options.
	 */
	function sanitizer_filters() {
		
		//since I'm building some checkboxes programatically I have to add validation programatically. 
		$one_zero = array(
				'general_post',
				'advanced_checkbox',
			);
			
		//this gets the post type list
		$post_types = get_post_types( array( 'public' =&gt; true, ) );
			
		//I add the post types to the hard coded options so they can all be filtered
		foreach( $post_types as $post_type ){
			$one_zero&#x5B;] = 'general_' . $post_type;
		}
		
		//use for checkboxes
		genesis_add_option_filter(
			'one_zero',
			$this-&gt;settings_field,
			$one_zero
		);
		
		//only allows integers. Great for text fields that are just for numbers
		genesis_add_option_filter(
			'absint',
			$this-&gt;settings_field,
			array(
				
			)
		);
		
		//used to validate a URL
		genesis_add_option_filter(
			'url',
			$this-&gt;settings_field,
			array(
				
			)
		);

		//if you don't NEED html in your text field use this option for text
		genesis_add_option_filter(
			'no_html',
			$this-&gt;settings_field,
			array(
				'general_size', //these are select fields so there shouldn't ever be HTML
				'general_position', //if HTML shows up here someone is trying something tricky
			)
		);
		
		//uses wp_kses to allow some HTML but nothing easily exploitable
		genesis_add_option_filter(
			'safe_html',
			$this-&gt;settings_field,
			array(
				'advanced_text',
			)
		);
		
		//allows full HTML but only for users with unfiltered HTML priviledge
		genesis_add_option_filter(
			'requires_unfiltered_html',
			$this-&gt;settings_field,
			array(
				
			)
		);
		
	}
</pre>
<p>Once again I find myself with a very long post and still much more I&#8217;d like to say.</p>
<p>I&#8217;m going to stop now though and turn it over to you:</p>
<p>&lt;</p>
<p>ul></p>
<li>What tips do you have for adding options for a plugin?</li>
<li>Did I miss anything important?</li>
<li>How do you feel about the Genesis Admin Class?</li>
<p>&lt;</p>
<p>ul></p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/plugins/genesis-plugins-building-a-wordpress-admin-page/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1252</post-id>	</item>
		<item>
		<title>Genesis Plugins: Your First WordPress Plugin</title>
		<link>https://designsbynickthegeek.com/uncategorized/your-first-plugin</link>
					<comments>https://designsbynickthegeek.com/uncategorized/your-first-plugin#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Tue, 14 Jan 2014 18:00:45 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1237</guid>

					<description><![CDATA[Life is full of firsts and movies like to make &#8220;first&#8221; experiences look so good. The movie 50 First Dates has a line where Drew Barrymore&#8217;s character says, &#8220;there is nothing like a first kiss.&#8221; Princess Diaries has a subplot point that revolves around a first kiss and how it should make your foot &#8220;pop.&#8221; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Life is full of firsts and movies like to make &#8220;first&#8221; experiences look so good. The movie <i>50 First Dates</i> has a line where Drew Barrymore&#8217;s character says, &#8220;there is nothing like a first kiss.&#8221; <i>Princess Diaries</i> has a subplot point that revolves around a first kiss and how it should make your foot &#8220;pop.&#8221;</p>
<p><a href="http://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o.jpg"><img loading="lazy" decoding="async" data-attachment-id="1240" data-permalink="https://designsbynickthegeek.com/uncategorized/your-first-plugin/attachment/736944375_91a2a09498_o" data-orig-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o.jpg" data-orig-size="1395,924" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;5&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;NIKON D40&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1183132466&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;18&quot;,&quot;iso&quot;:&quot;400&quot;,&quot;shutter_speed&quot;:&quot;0.01&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="736944375_91a2a09498_o" data-image-description="" data-image-caption="" data-medium-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o-300x198.jpg" data-large-file="https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o-1024x678.jpg" src="http://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o-300x198.jpg" alt="736944375_91a2a09498_o" width="300" height="198" class="alignleft size-medium wp-image-1240" srcset="https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o-300x198.jpg 300w, https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o-1024x678.jpg 1024w, https://designsbynickthegeek.com/wp-content/uploads/2014/01/736944375_91a2a09498_o.jpg 1395w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
I remember my first kiss and I&#8217;m sure most of you do to. It probably wasn&#8217;t like the movies. I was young and awkward. The girl was too. We bumped foreheads, then noses, then finally our lips. I guess with nothing to compare it to I thought it was the best thing ever. Of course, experience taught my a lot and I&#8217;d like to think I&#8217;ve improved in kissing as well as other things &#8230; like making plugins. Get you minds out of the gutter.</p>
<p class="clear">I had a lot of help with my first plugin and that plugin has become fairly popular but I did several revisions to clean up code as well as add features. I want to do a full overhaul on the plugin though, because when I look at the code I keep asking &#8220;why did I do it like that?&#8221;</p>
<p>I think a lot of developers do the same thing and then we have a lot of plugins out there that need an overhaul but we&#8217;ve moved on and learned so much that it is almost painful to think about that first awkward plugin. I&#8217;m going to share some tips and ideas I&#8217;ve learned over the years so your first plugin can be better for it and maybe you&#8217;ll learn something to make your current plugins even better.</p>
<p>I made this part of my Genesis Explained series because I want to address some common errors I see in other plugins built for Genesis, but if you are building a WordPress plugin for any theme or all themes, you should find something useful here.</p>
<h2>Why Build a Plugin</h2>
<p>Some of you already have a great idea and know it is going to be the best possible plugin ever, but there are folks reading this that don&#8217;t think of themselves as a plugin developer. They make themes and that is good enough.</p>
<p>Listen, if you don&#8217;t want to build a plugin ever, that&#8217;s fine. I&#8217;m not going to look down on you and think you are an inferior developer. We&#8217;re cool. That said, you might want to keep reading because there are reasons for theme developers to learn to build good plugins too.</p>
<h3>Theme features that aren&#8217;t theme specific</h3>
<p><a href="http://www.billerickson.net/core-functionality-plugin/" target="_blank">Bill Erickson</a> got me started on the idea that theme developers should be making these core functionality plugins instead of building everything into their custom themes. He writes on this in more detail and in turn links to other developers who have written in even more detail. It&#8217;s a rabbit hole that just keeps going.</p>
<p>The short version is, features you might add to a site for a client like custom fields, custom post types, and short codes are part of the site, not the theme. If the client ever changed themes they would lose those features and that would be bad for the site. If you are developing themes for clients or even for yourself I&#8217;d recommend building core functionality plugins to pull some features into the plugin instead of the theme.</p>
<p>Just an example by experience. I added a lot of cool features to my site and each time I&#8217;d change themes I had to find the code and transfer it to the new theme. This caused a lot of frustration while changing themes. After Bill talked about this type of feature with me I decided to start moving features to the core functionality plugin. Now 75% or more of the features built into my site have been moved to the plugin. Only CSS and sidebars are really part of my theme. This has made it much easier any time I change themes, because I just focus on design, knowing my functionality is there.</p>
<h3>Repeat Features</h3>
<p>Clients love to think they are being cutting edge and unique, but 90% of the time clients give me a link to some cool thing they saw that they want on their site. The truth is, the more clients I have, the more I find I&#8217;m doing a lot of the same thing. Part of building a good core functionality plugin is learning what repeated things you are doing and build that for easy access. I can build out a custom project for a client and it might take 40 hours because I built ever line from scratch, but the next client will do some similar things and I already know what I&#8217;m doing so it may only take 30 hours or even less time. If I&#8217;m noticing that I keep getting asked for a portfolio, I can build a portfolio plugin. Then I include that for the client and focus on styling instead of having to develop a new portfolio for each client separately.</p>
<p>It saves me time, saves them money, and makes my development more consistent. The truth is, most of the features I built into plugins like the Genesis Featured Widget Extended were because of needs I had to make something for a client and I didn&#8217;t want to have to built a completely custom widget.</p>
<h3>You have a great idea</h3>
<p>I think most publicly released plugins probably fall under this. The movie <i>Robots</i> has a recurring line, &#8220;See a need, fill a need.&#8221; I think that is the heart of what WordPress plugin developers are all about. We often see things that need to happen and then ignore them because we assume that someone more skilled will make it happen &#8230; eventually. The truth is, if you see a need you can fill the need. Build your first plugin and then learn from it. You don&#8217;t have to be perfect the first time out. I know I wasn&#8217;t. Shoot, I often build out plugins for Copyblogger and find that it needs a lot of polish when I thought it was done. That&#8217;s ok.</p>
<p>If you have an idea for a plugin it is time to make it happen.</p>
<h2>Build Your Plugin</h2>
<p>Ok, so you have been convinced. You are ready to make your first plugin &#8230; now what? The developer who helped me get my first plugin out the door is <a href="http://code.garyjones.co.uk" target="_blank">Gary Jones</a>. I think he would say the first thing you need to do is learn some code standards.</p>
<h3>Why are code standards important?</h3>
<p>The short answer is, so your code doesn&#8217;t suck.</p>
<p>Code standards mean your code is easier to read, easier to understand, and easier to fix.</p>
<p>PHP is a very forgiving language. You can do a lot of weird things in PHP that you can&#8217;t in other languages. Sure, when it breaks it is more cryptic about why things are broken, but relatively speaking, you have to work harder to break it. That doesn&#8217;t mean that you should just go hog wild because you can.</p>
<p>By learning to use proper white spacing, formatting, and documentation you will be better serving your users and (more importantly) your future self.</p>
<p>I&#8217;m at the point where I will sketch up ideas for a plugin then sit down and write. I can write up multiple files with hundreds of lines of code each then debug it. When I first started I had to run things in smaller chunks, but now I can conceptualize the entire project because I&#8217;ve done it often enough. When I debug things are bound to be broken though. So I&#8217;ll have to go in and find the issues and fix them.</p>
<p>Proper white spacing means it is easier to read the code. Using smaller functions means it is easier to follow what is happening and documenting as I go along means I will remember what I was thinking when I wrote a given bit of code.</p>
<p>Since WordPress and Genesis plugins mean you are working with other standards you need to learn those standards so you are compliant with that system. By doing so, someone who is familiar with reading WordPress code will be able to quickly read your code. It also means your plugin is more likely to work with the themes and plugins others have developed.</p>
<p>WordPress has a pretty good resource on <a href="http://make.wordpress.org/core/handbook/coding-standards/php/" target="_blank">coding standards for contributing to WP core</a>.</p>
<p>After you have the basics down check out the <a href="http://make.wordpress.org/docs/plugin-developer-handbook/" target="_blank">WordPress Plugin Developer Handbook</a>.</p>
<p>Once you learn the standards and are ready to build you will need to create your plugin.</p>
<h3>Minimum requirements for a plugin</h3>
<p>For your first plugin you need at least one php file and a readme.txt file. Many simple plugins use a single php file and there is no specific reason you need multiple files. That said, if your plugin will be using admin, front end, and general functions it may be good to break it up into separate files.</p>
<p>By moving functions to different files and loading them conditionally you make it easier to quickly identify what various parts of your code do and you make it load fewer resources at any given time. This may only result in a few milliseconds per page load in added speed but on a busy server that can be a pretty important savings.</p>
<h3>Use Genesis Init for Genesis plugins</h3>
<p>I&#8217;m going to be honest here. This is the main reason I&#8217;m writing this. I see a lot of Genesis plugins and most of them are pretty cool. The great thing about Genesis is the way it is built to be extended by child themes <b>and</b> plugins. I love that developers out there take things they think are cool and make very helpful plugins.</p>
<p>That said; folks, you got to use <code>genesis_init</code>.</p>
<p>This hook is loaded on the WordPress init action. The biggest difference between loading your plugin on the <code>init</code> hook and the <code>genesis_init</code> hook is the later only exists if Genesis is being used. It is a super efficient way of making sure any <code>genesis_</code> function is going to be available. Now, this doesn&#8217;t take the place of checking to make sure a function is available but if you run a version comparison you can know what functions and classes are available to you on the <code>genesis_init</code> hook.</p>
<blockquote><p>It isn&#8217;t enough to do a theme check when you activate the plugin.</p></blockquote>
<p>When you do a theme check while activating your plugin, you only know that the theme functions are available at the time the plugin is activated. If users switch themes, you can white screen their site. More importantly, if they are using a tool that disables the theme in certain circumstances, you can white screen their site.</p>
<p>For example, let&#8217;s say someone is using JetPack. I&#8217;m not going to argue if this is a good or bad thing, but it is a popular tool so many users have it active. Jetpack activates a mobile theme by default. Again, I&#8217;m not saying this is good or <b>very, very bad</b> but a lot of people don&#8217;t know and leave it active. If your plugin loads on the <code>init</code> hook and you don&#8217;t carefully check to make sure all of your Genesis functions are available before using them, people visiting the site via a mobile device will see a lovely white screen.</p>
<p>For safety, please use the <code>genesis_init</code> hook when loading your plugin actions.</p>
<h3>Example plugin file</h3>
<p>Here is an example from a plugin I recently finished. I&#8217;ve added inline documentation to help explain everything:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/*
  Plugin Name: Genesis Boilerplate
  Plugin URI: 
  Description: A Simple plugin template used for building other plugins.
  Version: 0.1.0
  Author: Nick_theGeek
  Author URI: http://designsbynickthegeek.com
  Text Domain: genesis-boilerplate
  Domain Path /languages/

*/

/*
The previous section is what defines the plugin. 
The Plugin Name line defines the name.
The Plugin URI line is a link to where the plugin details can be found online
Since this plugin isn't released I'm just linking to root domain
The Description line is the short description that will show in the WordPress dashboard.
The Version line defines the version of the plugin file
The Author line defines the author. This should match your WordPress user name if uploading to the WordPress repo
The Author URI provides a link to your Web site
The text domain line allow you to hint at the domain that is used for internationalizing your text strings
The domain path defines where WordPress should look for translation files.
*/

/* Prevent direct access to the plugin */
if ( !defined( 'ABSPATH' ) ) {
    die( &quot;Sorry, you are not allowed to access this page directly.&quot; );
}

/* I like to define a constant for the /lib/ and other directories so I don't have to call dirname() all the time */
define( 'GENESIS_BOILERPLATE_LIB', dirname( __FILE__ ) . '/lib/' );

/*
One thing I'm skipping in this plugin is an activation hook action. This type of action loads when your plugin
is activated. That is when you would want to check to see what version of Genesis is being used.
I'm only using the genesis_get_option and genesis_get_image functions in this plugin.
Those functions have been available for all public releases of Genesis so I'm just using the genesis_init hook.
It's a bit of a cheat but it works and I hate loading code that I don't absolutely need.
If I were doing something with functions that were added in 2.0 or something I'd run an activation hook or
I'd do a &quot;function exists&quot; before continuing.
*/

/*
Notice that this is loaded on genesis_init. If this was not a Genesis specific plugin I could just load on init
Since I loaded on genesis_init I know certain Genesis functions like genesis_get_option will be available
Also note that I have name spaced the function I created with &quot;genesis_boilerplate&quot; so I don't conflict with other plugins
*/
add_action( 'genesis_init', 'genesis_boilerplate_init', 99 );
/**
 * Loads plugin text domain and required files. Uses genesis_init to ensure Genesis functions are available
 *
 * @since 0.1.0
 *
 * @uses GENESIS_BOILERPLATE_LIB
 *
 */
function genesis_boilerplate_init() {

	/** Load textdomain for translation */
	load_plugin_textdomain( 'genesis-boilerplate', false, basename( dirname( __FILE__ ) ) . '/languages/' );
	
	/*
	Checks to see if this is an admin screen and if the Genesis_Admin_Boxes class is available
	Since the admin class is not part of Genesis 1.0 I do a check here to make sure it is there
	I could have done the activation check to make sure Genesis 1.8 or higher was running but I
	went with this class_exists() check instead
	*/
	if ( is_admin() &amp;&amp; class_exists( 'Genesis_Admin_Boxes' ) ) {
		require_once( GENESIS_BOILERPLATE_LIB . 'admin.php' );
	}
	else { //if this is not an admin screen it is the front end and the appropriate files are loaded
		require_once( GENESIS_BOILERPLATE_LIB . 'front-end.php' );
	}
		
	//this plugin doesn't load any common functions but if it did I would uncomment this line
	//require_once( GENESIS_BOILERPLATE_LIB . 'functions.php' );

}

</pre>
<h2>Moving on</h2>
<p>I&#8217;m looking at my word count and I&#8217;ve got well over 2000 words already. I have so much more I&#8217;d like to share. There are some important topics that I struggled with like &#8220;using subversion&#8221; and even handling versioning in GitHub during development. I didn&#8217;t even get a chance to cover the readme.txt file.</p>
<p>As much as I&#8217;d like to cover all these details, I also want to give opportunity for community feedback.</p>
<p>What are the most important lessons you have learned while making plugins?</p>
<p>What did I not cover that you really want to know?</p>
<p><a href="http://www.flickr.com/photos/67162861@N00/736944375/" target="_blank">Featured Image</a> was obtained under a Creative Commons License.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/your-first-plugin/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1237</post-id>	</item>
		<item>
		<title>Customer Service: Lessons from Failure</title>
		<link>https://designsbynickthegeek.com/uncategorized/customer-service-lessons-from-failure</link>
					<comments>https://designsbynickthegeek.com/uncategorized/customer-service-lessons-from-failure#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Mon, 14 Oct 2013 18:31:52 +0000</pubDate>
				<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1221</guid>

					<description><![CDATA[Hey folks. I haven&#8217;t written in a while. I&#8217;ve got a lot I want to write about but not a lot of time. For a couple weeks I&#8217;ve been thinking about what makes good customer service. This is largely based on the absolute worst customer service experiences I&#8217;ve ever had. I expect that this will [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hey folks. I haven&#8217;t written in a while. I&#8217;ve got a lot I want to write about but not a lot of time. For a couple weeks I&#8217;ve been thinking about what makes good customer service. This is largely based on the absolute worst customer service experiences I&#8217;ve ever had. I expect that this will be entertaining at the very least and hopefully educational.</p>
<p>I&#8217;ve been doing customer service type things for ages. In one way or another, nearly every job I&#8217;ve ever had requires me to work directly with the customer. There are a lot of people that hate working directly with the customer. These people do not belong in customer service. That is fine. Not everyone is cut out for it. I actually really like working with most customers most of the time. </p>
<p>Despite what people say about me, I&#8217;m not a robot. This means I&#8217;m not always on my game and I might actually make someone mad, but with a good service team, we can even provide great customer service on days where I&#8217;m not feeling it. </p>
<blockquote>
<p>Nick is a robot</p>
<p><cite>~Everyone I&#8217;ve ever worked with</cite></p></blockquote>
<p>So, about those bad customer service experiences. I&#8217;m going to break down two experiences that stand out to be in the &#8220;worst customer service I&#8217;ve ever received&#8221; and see if I can learn something from them.</p>
<h2>I know you are busy, but please ignore me</h2>
<p>The restaurant industry is one of the hardest places to work with the public. Despite that, 99% of the time I have a great experience with my wait staff. There have been times that I&#8217;ve had less than perfect (or even less than good) service, but I pretty much leave a 15% tip even in the worst of service because I know that the wait staff tends to get virtually nothing for their work and rely on the tips, which they often have to split with the rest of the staff. Most of the time I try to leave at least 20% because I have 4 kids and that means even more work. I believe this is the right thing to do and to be honest, one of the reasons I get good service is because I don&#8217;t do jerkish things to the people who are serving me. I treat them with respect and I like to use &#8220;please and thank you&#8221; because manners are appreciated and reciprocated. </p>
<p>That said, when I was in college I remember going to a restaurant near one of the other colleges in town. This was a small chain restaurant and we usually went to a different location, but for some reason we decided to give this particular location a try on this particular day.</p>
<p>The place was moderately busy. We were seated in about 5 minutes, so it wasn&#8217;t overwhelming but 90% of the tables were full. We sat down and began talking. Time moved on and we eventually grabbed the manager as he went by to ask if we could get someone to wait on us. Apparently the waitress who was watching the table had just checked out and the one who was suppose to cover didn&#8217;t realize it so we were completely overlooked. That is why we had been sitting there for 30 minutes and no one even took our drink order.</p>
<p>The waitress came and took our drink order but ran off before we could give her the meal order. After all, it had been 30 minutes so we knew what we wanted.</p>
<p>This time we only waited 10 minutes before finding the manager and letting him know we had not received our drinks and we would like to order our food. The waitress showed up with the wrong drinks and took our food order. We asked for the right drinks and they showed up after the food arrived, which was almost 40 minutes later.</p>
<p>Each part of the meal process took an absurd amount of time. Each time we didn&#8217;t get things resolved till we grabbed the manager. Some things never did get resolved. It took almost an hour and a half before the correct drinks found their way to the table. By the time we finished our meal, got our check, and paid it was nearly a 3 hour dining experience. Over the hour and a half after getting the correct drink, I didn&#8217;t get a single refill. I did ask multiple times and I even asked the manager about it. The refill never came.</p>
<p>In the end I left 4 pennies for the tip along with a note. I explained that I had never in my life given less than 15% on the tip but I have never been treated so poorly by wait staff and that we would never bother her or the rest of the staff again. </p>
<h2>Communication is a waste of my time</h2>
<p>I order a lot of things online. It is so convenient. Amazon is amazing. I&#8217;m not convinced they don&#8217;t have a partnership with Aperture Science. I have ordered items around 3 or 4pm local time and received the item by 10am the following day. Ive only had to deal with a replacement from them once. The process was great. I contacted them and they gave me a prepaid return label. They also shipped the replacement immediately. I literally had the replacement 32 hours after I requested it. I didn&#8217;t even ship the bad item back to them yet. I hadn&#8217;t had time. I&#8217;ve had to return items to a few other sellers and they have made me ship back (sometimes at my own expense) before they would replace the item. This experience was pretty amazing and really cemented them as the best people to buy form online. I also love buying from Newegg and ThinkGeek because of the few times I&#8217;ve had to deal with their customer service department, but compared to Amazon they are very much second place.</p>
<p>Other online sales have been less than ideal though. Recently I had a horrible experience with an Amazon Market Place seller. Since they sell through Amazon I immediately give them some of my perceived confidence. They were also very well ranked by the buying community in Amazon so I trusted them. Spoiler alert, I do not any longer.</p>
<p>We needed a couple small items for a church even we were doing. We placed the order a week ahead. This might have been a bit late, but the order delivery estimate was suppose to be before the event. The items didn&#8217;t arrive within 2 days like they would have with an Amazon fulfilled order, but I believed the shipping estimate to be accurate. The day the order should have shipped came and went so I sent the seller a message. I explained the situation and asked if there was a problem with the order so we could cancel and purchase elsewhere in time for the event. </p>
<p>The seller wrote back 24 hours later (still time for me to order with expedited shipping from another seller).</p>
<blockquote><p>I do apologize for the delay. Your order will ship soon.</p></blockquote>
<p>That was the entire reply. I waited 2 more days before getting a confirmation that the order had shipped. This was the day before the event so at this point we wouldn&#8217;t receive the order and it was impossible to get an alternate in even with expedited shipping.</p>
<p>The items arrived nearly a full work week after the original delivery estimate. We didn&#8217;t get a chance to use these items for the event, but we have other events so I went to file the items so we would have them next time. Something prompted me to check and only one of two items were shipped. Additionally there was no invoice so I had to go check the order to see if they shipped in two parts and if I even ordered both items. Turns out there was no notation of two shipments and I had ordered both items.</p>
<p>Again I wrote the customer service and explained that I wanted the other item mailed off and gave them express details on my expectations. They replied: </p>
<blockquote><p>There must have been an error with our inventory because we searched our warehouse for this item and can’t find it.<br />
I apologize for the inconvenience.<br />
We are canceling the order and processing a refund if applicable, it may take a few days to process.</p></blockquote>
<p>At no point had I asked for a refund. I asked for the item I ordered. They didn&#8217;t offer me to wait for them to order replenishment. They just made an assumption on what I wanted. </p>
<p>Moreover, I actually fee like they shipped late because the items were not there, did not include the invoice because the items were not there, and never once communicated this issue because they hoped I wouldn&#8217;t notice.</p>
<h2>What can we learn from this?</h2>
<p>In both of these examples there was a series of problems. Someone that is writing a how to in customer service might actually call them a series of opportunities, but that sounds kind of silly &#8230; still, there might be something to that.</p>
<p>The fact is, sometimes customers have a bad experience and they might contact you about that bad experience. This really is an opportunity to turn that bad experience into a great experience. Like I said, I&#8217;ve only had to work with Amazon customer service once. They turned the bad experience of a broken product into something that really made me loyal. I have to wonder if there is a way the people I interacted with could have done things differently.</p>
<div class="one-half first">
<h3>Bad Experience</h3>
<ul>
<li>Lack of over sight: Customer contacts a manager about a problem, manager tells employee to fix it then ignores the situation.</li>
<li>Fail to communicate: Something cannot be completed because of situations outside of your control. You wait for the customer to contact you then fail to divulge the issue. The customer is responsible for finding information that leads them to the right question. You will only answer the question asked.</li>
<li>Make Assumptions: Your customer asked for a given drink but it isn&#8217;t available so you bring them a different drink. Your customer asked to have an item shipped so you give them a refund.</li>
</ul>
</div>
<div class="one-half">
<h3>Good Experience</h3>
<ul>
<li>Follow up: Sometimes things happen. If a manager decides to follow up on a bad situation it makes the customer feel valued. If the staff and manager see the customer as an obstacle the customer will feel like an obstacle.</li>
<li>Communicate clearly: This isn&#8217;t about excuses. This is about taking responsibility to find out the answer to the question the customer didn&#8217;t ask. Most customers are not part of your industry, so they don&#8217;t know to ask if the drink situation is because of a backup in dishwashing because of a huge crowd you just had or if you actually have the items your web site told them you did have. What are the obstacles and how will you help your customer overcome them.</li>
<li>Offer choices: Maybe the drink isn&#8217;t available. Go tell the customer and let them choose a new drink. If an item isn&#8217;t available let the customer know it can be ordered or they can get a refund. Empower your customer.</li>
</ul>
</div>
<div class="clear"></div>
<p>This won&#8217;t make every customer happy, but in my experience this will make almost all customers happy. Most of us want to be seen as something more than a number, inconvenience, or problem to be solved. We want to be seen as people. If you stop and remember that the customer is a real person you will find it much easier to follow the path to a good experience.</p>
<p>What about you? What horrible customer service experiences have you had and what would it have taken to turn that into a good experience?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/customer-service-lessons-from-failure/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1221</post-id>	</item>
		<item>
		<title>Genesis 2.0 HTML5 Conversion</title>
		<link>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-conversion</link>
					<comments>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-conversion#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Fri, 07 Jun 2013 21:35:36 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1204</guid>

					<description><![CDATA[One of the first things I read about Genesis compared it to a car. The Getting Started page at StudioPress has a really cool illustration of that analogy. Basically, WordPress is the engine, Genesis is the frame and body, and the child theme is the paint job. When Genesis Beta 1 dropped I did a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>One of the first things I read about Genesis compared it to a car. The <a href="http://www.studiopress.com/get-started" target="_blank" rel="noopener noreferrer">Getting Started</a> page at StudioPress has a really cool illustration of that analogy. Basically, WordPress is the engine, Genesis is the frame and body, and the child theme is the paint job.</p>



<p>When Genesis Beta 1 dropped I did a conversion on my <a href="http://firstassemblyfrontroyal.com" target="_blank" rel="noopener noreferrer">church Web site</a> and then wrote about that experience in the <a href="http://designsbynickthegeek.com/experiences/genesis-2-0-html5-and-schema-oh-my">Genesis 2.0, HTML5 and Schema oh my</a> post.</p>



<p>Based on that experience and the more recent conversion of this site to HTML5 I think there is a lot to the car analogy.</p>



<p>My first car was a 1980 Datsun (yeah, before they were called Nissan) 200SX. It was a baby blue, but it probably didn&#8217;t start life that faded. All things considered it was a really good first car. Most of the time it was pretty reliable, but the starter had issues. Twice a year I had to put a new starter into it. Technically, the starter wasn&#8217;t the problem, it was the solenoid, so in a pinch I could make things work.</p>



<p>So here is the situation, school is out, and it is freezing cold. I have hung out in the junior hall with my friends till the parking lot is mostly empty, then I run to the car and hop in, trying to get it started so I can get some heat building up before my fingers start going numb. I turn the key and &#8230; nothing happens. So I leave the key in the on position, pop the hood and grab a big screw driver from the glove box.</p>



<p>When I open the hood I reach in and use the metal end of the screw driver to arc against the contacts of the solenoid. Sparks fly and the engine roars to life. This is how I start my car for the next couple of days till I can get to the parts store and pickup a new starter. Fortunately the starter is covered under warranty so all it costs is an hour of my life. I have mastered replacing the starter and that hour includes the time it takes to pull the old starter, take it to the parts store, drive home with the new starter, and bolt it on again. I feel comfortable I could do it with my eyes closed to this day.</p>



<h2 class="wp-block-heading">Get better with Genesis by practicing</h2>



<p>Working with Genesis can be a lot like that. The more you do something the faster you get at it. I can solve a Rubik Cube in about 2 minutes. Well, I used to be able to. Before writing this I timed myself and was down to 5 minutes. Guess it isn&#8217;t exactly like riding a bike. I can do a whole lot with Genesis very very quickly because I have done a whole lot with Genesis over the years that it has been around.</p>



<p>My first HTML5 conversion took a bit because it was something I hadn&#8217;t done before, but I am sure that with practice I could do a Genesis HTML5 conversion much faster.</p>



<p>Of course, there is more to being a good mechanic than just doing the job a lot. See, I&#8217;m not a good mechanic and it would take a lot more than work on my car every weekend to make me into one. I also need the tools that make things easier.</p>



<p>Once I got in a small accident on the ice. It was actually kinda fun looking back. I didn&#8217;t hit anyone else and the car spun around in a complete circle then another 270° before jumping the curb. I pretty much held on for the ride. The problem is I bent the split axel on the car and had to replace it. We were able to pick one up for cheep at the salvage yard then I spend the better part of 2 days trying to pull that stupid axel. The repair manual made it look so easy, but it wouldn&#8217;t budge for nothing. Finally we went to the parts store and asked if there was a trick to it and this older guy goes to the back and brings out a slide hammer. He told us that would make things a lot easier.</p>



<p>I was a bit discredulous ($50 word for the win) but willing to try anything. Wouldn&#8217;t you know, about 5 minutes with the right tool and the job was done. Amazing!!!</p>



<h2 class="wp-block-heading">HTML5 Genesis Conversion with the right tool</h2>



<p>The slide hammer made that job so much easier. Having the right tool really helps, and sometimes you really do need a specialty tool. Converting an existing Genesis child theme to HTML5 can benefit from the right tool. Rafal Tomal built <s>a simple but very effective tool</s> for helping users convert a site to HTML5. (Note: Rafal&#8217;s tool was taken down or moved. There is a tool <a href="https://cobaltapps.com/genesis-xhtml-to-html5-css-converter/">here</a> that appears to be working.)</p>



<p>That is what I used for this site. It did 90% of the work for me in no time. Basically it uses a bunch of search/replace strings to replace existing markup in the style.css file to the HTML5 equivalent.</p>



<p>Please note, it is not perfect. You will have to make a few small adjustments. It changed a couple of things that probably shouldn&#8217;t have been changed. It also assumes a specific placement of certain items. For most Genesis child themes that is fine, but for the Streamline theme, the post info was moved outside the entry-header so I had to fix the markup for that manually. As of the time of this writing, it does not currently fix .s for input[type=search] so I had to fix my search markup. Also, there is some HTML5 specific code that really needs to be added to the style.css file to make it backwards compatible.</p>



<p>You also still have to adjust your actions to use the new <a href="http://designsbynickthegeek.com/tutorials/genesis-explained-two">Genesis 2.0 HTML5 hooks</a>.</p>



<p>Still, I was able to do this site in HTML5 in about 15 minutes. It has taken me much longer to write about it than to do it. I think that Rafal&#8217;s tool is going to be something that all developers will want to make sure they know how to use correctly as the Genesis 2.0 release nears.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-conversion/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1204</post-id>	</item>
		<item>
		<title>Genesis 2.0 Explained</title>
		<link>https://designsbynickthegeek.com/uncategorized/genesis-explained-two</link>
					<comments>https://designsbynickthegeek.com/uncategorized/genesis-explained-two#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Fri, 31 May 2013 15:26:11 +0000</pubDate>
				<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1190</guid>

					<description><![CDATA[As a kid I loved going to the pool. Actually I loved water in general. I was raised all over the world including Japan, Guam, and California. This meant I spent a lot of my time at the beach or in pools. Not long after moving to Oklahoma we got to go the to local [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>As a kid I loved going to the pool. Actually I loved water in general. I was raised all over the world including Japan, Guam, and California. This meant I spent a lot of my time at the beach or in pools. Not long after moving to Oklahoma we got to go the to local pool. It was burning hot and I missed the California beaches, but the pool was great. I went 2-3 times a week and made a lot of summer friends by the water.</p>
<p>Our pool had 2 diving boards. The low board was just a few feet above the water and we would line up to do cannon balls, belly flops, and ninja dives. You may not know what a ninja dive is. Basically it is what 8 year olds who have watched too many kung fu movies do when they are trying to reenact the wire fu kicks and flips seen in movies like Crouching Tiger Hidden Dragon, but from a diving board.</p>
<p>The problem with ninja dives from the low dive is you only have a split second to strike a pose, not quite the Teenage Mutant Ninja Turtles kind of stuff we were going for.</p>
<p>Weeks into the summer we were daring each other to try the high dive. To an 8 year old it was about a million feet tall so none of us would do it. Still, the thought of having all those seconds of free fall to put on a series of legendary arial acrobatics &#8230; it was tempting. Eventually I had psyched myself up enough to climb the thousands of steps and edge out to the end of the board. I literally crawled out then looked down. Everyone was watching so I sucked it up and stood. The board twitched and wobbled with each step as bigger kids yelled for me to hurry up. I stood on the edge and felt my stomach heave and then stepped into history.</p>
<p>All of us had been anticipating that moment, and for my 8 year old self it was everything I wanted it to be. After that everyone lined up and we never looked back on that low dive.</p>
<p>That is how I feel about Genesis 2.0 and HTML5. It is so exciting. I feel like we have been in a holding pattern for ages to bring these changes out, but it will be so worth it and I know I&#8217;ll never go back to the XHTML markup.</p>
<p>Back in May of 2011 I started my <a href="http://designsbynickthegeek.com/tutorials/genesis-explained-the-framework">Genesis Explained</a> series so it is appropriate that May 2013 is the start of the Genesis 2.0 series. In that initial article I explained that working with Genesis is a lot like working with Legos (another child hood memory). Through the course of the series I tried to teach how actions work, what filters do, and how fledgling developers can learn to read the code in the various files to learn and adapt.</p>
<p>That information is largely still valid and I don&#8217;t plan on removing it. Through <a href="http://designsbynickthegeek.com/tag/genesis-explained-2">Genesis Explained Two</a> series I will be referencing the original Genesis Explained series for added details. I will also be going back to edit the original series to point to the new articles where appropriate. If you already know Genesis you will find Genesis 2.0 extremely comfortable. If you are just getting started and want to learn more while I am writing this new series, then take time to go check out the original <a href="http://designsbynickthegeek.com/tag/genesis-explained">Genesis Explained Series</a>. It won&#8217;t steer you wrong.</p>
<p>I&#8217;ve already referenced the first article of Genesis Explained, but if you have not read it I&#8217;d recommend going back and <a href="http://designsbynickthegeek.com/tutorials/genesis-explained-the-framework">reading it now</a>. Now that you are familiar with the basic concept behind Genesis I&#8217;d like to cover the new hooks. I&#8217;ll be going back and looking at the framework.php file from Genesis 2.0 later. There is a new function I need to explain, but don&#8217;t worry, I won&#8217;t forget.</p>
<p>So, on to the complete hook reference for all Genesis 2 hooks:</p>
<h4>Init.php</h4>
<ul>
<li>genesis_pre</li>
<li>genesis_pre_framework</li>
<li>genesis_init</li>
<li>genesis_setup</li>
</ul>
<h4>Header.php</h4>
<ul>
<li>genesis_doctype</li>
<li>genesis_title</li>
<li>genesis_meta</li>
<li>genesis_before</li>
<li>genesis_before_header</li>
<li>genesis_header
<ul>
<li>genesis_site_title</li>
<li>genesis_site_description</li>
<li>genesis_header_right</li>
</ul>
</li>
<li>genesis_after_header</li>
</ul>
<h4>Framework.php</h4>
<ul>
<li>genesis_before_content_sidebar_wrap
<ul>
<li>genesis_before_content
<ul>
<li>genesis_before_loop
<ul>
<li>genesis_loop<br />
<h5>HTML5</h5>
<ul>
<li>genesis_before_entry
<ul>
<li>genesis_entry_header</li>
<li>genesis_before_entry_content
<ul>
<li>genesis_entry_content</li>
</ul>
</li>
<li>genesis_after_entry_content</li>
<li>genesis_entry_footer</li>
</ul>
</li>
<li>genesis_after_entry</li>
</ul>
<h5>XHTML</h5>
<ul>
<li>genesis_before_post
<ul>
<li>genesis_before_post_title
<ul>
<li>genesis_post_title</li>
</ul>
</li>
<li>genesis_after_post_title</li>
<li>genesis_before_post_content
<ul>
<li>genesis_post_content</li>
</ul>
</li>
<li>genesis_after_post_content</li>
</ul>
</li>
<li>genesis_after_post</li>
</ul>
<h4>Comments.php</h4>
<ul>
<li>genesis_before_comments</li>
<li>genesis_comments
<ul>
<li>genesis_list_comments
<ul>
<li>genesis_before_comment</li>
<li>genesis_after_comment</li>
<li>genesis_before_comment</li>
<li>genesis_after_comment</li>
</ul>
</li>
</ul>
</li>
<li>genesis_after_comments</li>
<li>genesis_before_pings</li>
<li>genesis_pings
<ul>
<li>genesis_list_pings
<ul>
<li>genesis_before_comment</li>
<li>genesis_after_comment</li>
<li>genesis_before_comment</li>
<li>genesis_after_comment</li>
</ul>
</li>
</ul>
</li>
<li>genesis_after_pings</li>
<li>genesis_before_comment_form</li>
<li>genesis_comment_form</li>
<li>genesis_after_comment_form</li>
</ul>
<ul>
<li>genesis_after_endwhile</li>
<li>genesis_loop_else</li>
</ul>
</li>
</ul>
</li>
<li>genesis_after_loop</li>
</ul>
</li>
<li>genesis_after_content<br />
<h4>Sidebar.php</h4>
<ul>
<li>genesis_before_sidebar_widget_area
<ul>
<li>genesis_sidebar</li>
</ul>
</li>
<li>genesis_after_sidebar_widget_area</li>
</ul>
</li>
</ul>
</li>
<li>genesis_after_content_sidebar_wrap<br />
<h4>Sidebar-alt.php</h4>
<ul>
<li>genesis_before_sidebar_alt_widget_area
<ul>
<li>genesis_sidebar_alt</li>
</ul>
</li>
<li>genesis_after_sidebar_alt_widget_area</li>
</ul>
</li>
</ul>
<h4>Footer.php</h4>
<ul>
<li>genesis_before_footer
<ul>
<li>genesis_footer</li>
</ul>
</li>
<li>genesis_after_footer</li>
</ul>
<ul>
<li>genesis_after</li>
</ul>
<p>That is every hook that Genesis loads in order on a typical front end page. As you see there are two different sets of loop hooks, the HTML5 and XHTML hooks. This is the single biggest change in the hook structure for Genesis and that is what you will need to focus on. In addition to those hooks, there are admin hooks and a few other hooks that are run in specific instances.</p>
<h4>Admin</h4>
<ul>
<li>genesis_cpt_archives_settings_metaboxes</li>
<li>genesis_import_export_form</li>
<li>genesis_export</li>
<li>genesis_import</li>
<li>genesis_admin_menu</li>
<li>genesis_theme_settings_metaboxes</li>
<li>genesis_admin_before_metaboxes</li>
<li>genesis_admin_after_metaboxes</li>
<li>genesis_admin_init</li>
<li>genesis_settings_sanitizer_init</li>
</ul>
<h4>Upgrade.php</h4>
<ul>
<li>genesis_upgrade</li>
</ul>
<h4>Menu</h4>
<ul>
<li>genesis_register_nav_menus</li>
</ul>
<h4>Post</h4>
<ul>
<li>genesis_reset_loops</li>
</ul>
<h4>Dynamic Hooks</h4>
<p>Finally there are the dynamic hooks. These hooks are created by the functions that use them. This means they will change based on how they are used. For example, the &#8220;$args[&#8216;before_sidebar_hook&#8217;]&#8221; hook below is created by the genesis_widget_area() function and it will use the widget area id to make a &#8220;genesis_before_sidebar_widget_area&#8221; hook when the primary sidebar is loaded.</p>
<ul>
<li>$this-&gt;pagehook . &#8216;_settings_page_form&#8217;</li>
<li>$this-&gt;pagehook . &#8216;_settings_page_boxes&#8217;</li>
<li>$args[&#8216;before_sidebar_hook&#8217;]</li>
<li>$args[&#8216;after_sidebar_hook&#8217;]</li>
</ul>
<p>As you can see, there are a LOT of hooks. By my count there are 78 total hooks plus the Dynamic hooks that create additional hooks as needed. Additionally WordPress has dozens of hooks so you can add content almost anywhere. With the addition of priorities (which I explain in the original Genesis Explained Actions article) you have near perfect control with these hooks. That is one reason why Genesis is so amazing and why we have been so excited for Genesis 2.0 to hit.</p>
<p>So what are you waiting for? <a href="http://nickc.co/genesis" target="_blank">Dive in</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/genesis-explained-two/feed</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1190</post-id>	</item>
		<item>
		<title>Genesis Responsive Header Customizer Update</title>
		<link>https://designsbynickthegeek.com/uncategorized/genesis-responsive-header-customizer-update</link>
					<comments>https://designsbynickthegeek.com/uncategorized/genesis-responsive-header-customizer-update#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Sat, 25 May 2013 18:53:34 +0000</pubDate>
				<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1168</guid>

					<description><![CDATA[Get the Genesis Responsive Header plugin Hey folks, finally had some time to do an important update on the Genesis Responsive Header plugin. This update is pretty fresh so be warned, it could have problems, but I&#8217;ve done a good bit of testing with it so far and found it to work well in my [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="float: right; width: 25%; margin: 0 10px 10px 0; padding: 10px;"><a href="https://github.com/NicktheGeek/genesis-responsive-header/archive/customizer.zip">Get the Genesis Responsive Header plugin</a></div>
<p>Hey folks, finally had some time to do an important update on the Genesis Responsive Header plugin. This update is pretty fresh so be warned, it could have problems, but I&#8217;ve done a good bit of testing with it so far and found it to work well in my tests, but when updating you will have to rebuild your options. More on that in a bit.</p>
<p>Some things you can look forward to in this new version</p>
<ul>
<li>Use the theme customizer</li>
<li>Allows users to add, change, or remove the device width break points</li>
<li>Allows automatic image size refresh</li>
<li>Allows users to manually update image height</li>
</ul>
<p>I also want to talk about these changes in detail.</p>
<h2>Use the theme customizer</h2>
<p>WordPress added a fancy new theme customizer that allows users to make changes to the theme with a pretty handy settings panel. Among other things it has it&#8217;s own built in image uploader and color picker. This means I could drop the admin class and save a good bit of code. To give you a good idea of what I mean, the old zip file was 92kb but the new zip file is only 7kb. That is a <strong>huge</strong> difference. I mean over 90% reduction in file size which means that much less code that has to be run.</p>
<p>This also fixes some conflicts that were happening where images couldn&#8217;t be uploaded because of other plugins. Since this is now using native features in WordPress exactly as created this does a lot to improve cross plugin compatibility.</p>
<h2>Add, Change, or Remove Device Widths</h2>
<p>This is a feature a lot of people have been asking for. Up until now the Genesis Responsive Header plugin only allowed 4 preset device widths as break points. Those will still be present automatically, but you can add, change, or remove breakpoints with a simple filter in the theme functions.php file. Here is some example code</p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'grh_media_sizes', 'my_grh_media_sizes' );
function my_grh_media_sizes( $sizes ){
	//add 960px device width to first position in the $sizes array
	array_unshift( $sizes, '960' );

	return $sizes;
}
</pre>
<p>You could also rebuild the array to change other widths very quickly.</p>
<h2>Automatically update image heights</h2>
<p>Originally I was trying to pull the image height when uploading the image. This had some problems and worse it isn&#8217;t something I can do with the customizer without building my own custom uploader. While that is an option in WordPress, I didn&#8217;t want to do that. Instead there is a new option, Update Image Sizes, that will use php to find the image size and update automatically on save. When the customizer is refreshed the option will be unset. That is because it isn&#8217;t intended to be left on. That could add a good bit of overhead and waste time.</p>
<p>Basically it goes is this option set? OK, lets find out how tall the images are and set that in the options. Now I&#8217;m going to unset the update image size option so I don&#8217;t do this again till you tell me to. Have a nice day.</p>
<p>Use this any time you change header images and the height of an image changed.</p>
<h2>Manually update the image height</h2>
<p>This is a fall back for the automated feature. If your server doesn&#8217;t work with the getimagesize() function the automatic feature will not work. Since the image height really helps make sure that the logo is sized correctly, especially if the javascript is disabled, it is important to set the image height. For folks that this becomes an issue for, I added an option to allow those values to be changed manually.</p>
<h2>Upgrading to this version</h2>
<p>To upgrade to this version you will need to disable and delete the version currently on your site. Right now I do not have an upgrade script so the options will not be converted over. This means you will need to upload your images and set your header background colors again. Before I add this to the WP repository I plan on writing a simple upgrade script that will find the existing options and convert them over. This is important because users will receive a notice and may not read my upgrade note here.</p>
<p>I also want to have people who are testing right now use the new interface. This will help me find any issues that may need to be fixed.</p>
<p>If you are ready to update or use the Responsive Header for the first time, <a href="https://github.com/NicktheGeek/genesis-responsive-header/archive/customizer.zip">Get the Genesis Responsive Header plugin</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/genesis-responsive-header-customizer-update/feed</wfw:commentRss>
			<slash:comments>90</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1168</post-id>	</item>
		<item>
		<title>Genesis 2.0, HTML5, and Schema Oh My!!!</title>
		<link>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-and-schema-oh-my</link>
					<comments>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-and-schema-oh-my#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Wed, 22 May 2013 16:00:59 +0000</pubDate>
				<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1162</guid>

					<description><![CDATA[Hey folks. I have been crazy busy with a bunch of things over at Copyblogger. I have to say, working with them is a real blast and there are so many different projects going that I don&#8217;t know if I&#8217;ll ever get bored. One of the big things in the pipe is Genesis 2.0. I&#8217;m [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hey folks. I have been crazy busy with a bunch of things over at Copyblogger. I have to say, working with them is a real blast and there are so many different projects going that I don&#8217;t know if I&#8217;ll ever get bored.</p>
<p>One of the big things in the pipe is Genesis 2.0. I&#8217;m going to have to make some big changes to my <a href="http://designsbynickthegeek.com/tag/genesis-explained">Genesis explained</a> series because of that. Maybe even a whole Genesis 2.0 explained series. If you aren&#8217;t familiar with it, Genesis 2.0 is going to be bringing a lot of changes to my favorite framework including HTML5 and Schema.</p>
<p>The Genesis 2.0 Beta is available now, just install the <a href="http://wordpress.org/plugins/genesis-beta-tester/" target="_blank">Genesis Beta Tester</a> plugin to enable it. I want to mention that Genesis 2.0 is in beta so there may be bugs. I&#8217;ve only found a couple myself and a few more have been reported. Mostly this is very nitpicky stuff, but if you want to test be aware that you might have to fix something that isn&#8217;t right.</p>
<p>I am running Genesis 2.0b1 on this site and everything is working well, but I am not using an HTML5 theme so I couldn&#8217;t say much about how HTML5 and Schema work. <a href="http://firstassemblyfrontroyal.com" target="_blank">My church web site</a> is already using HTML5 markup for the sermons, but otherwise it was using XHTML 2.0 transitional markup despite the doctype declaration. I figured that converting it over to true HTML5 would only make sense and would give me a better feel for how HTML5 and Schema work. </p>
<h2>Changing to HTML5</h2>
<p>As I noted, this site is running on Genesis 2.0b. Everything is running smoothly and I didn&#8217;t have to do anything but the update. This is an important test because existing sites should not be automatically converted to HTML5. This is something that must be enabled. So if you want to use HTML5 you should start with the Genesis Sample 2.0 beta theme. This is available at <a href="http://my.studiopress.com" target="_blank">my.studiopress.com</a>. After Genesis 2.0 is released other child themes will be made available in HTML5.</p>
<p>Of course, I already had a theme and wanted to keep the same look, so I had to do a bit of hybridizing for the church site. If you look in the style.css file you will see that I did the work very quick and dirty. I started with the sample 2.0 beta style.css file then copied in chunks of code from the Outreach style.css file to change the header, navigation, and other elements. The markup isn&#8217;t compatible but this quick and dirty conversion only took me about an hour. At some point I need to go back and clean up the CSS to remove redundancies and make sure everything works. Overall though I am happy with how easy it was for me to make the conversion.</p>
<p>Now, a lot of folks are going to wonder about their own themes and how easy it will be to convert them. Quite frankly that depends on your experience. If you know CSS pretty well you could do a full conversion in a day or less. If you can barely spell CSS you may want to leave HTML5 alone or hire this one out. It will require a solid understanding of CSS basics and the HTML markup structure.</p>
<p>The HTML5 system introduces a whole new set of actions and functions. It isn&#8217;t terribly difficult to learn but it is pretty dramatically difference. This is why I probably need a Genesis 2.0 Explained series to supplement the Genesis Explained series.</p>
<h2>Genesis 2.0 Schema</h2>
<p>This is one of the biggest reasons I wanted to convert my church site over. Schema should really help the indexing of the site. I am using event schema, civic/church schema, location schema, Web site schema, article schema, and audio schema. </p>
<p>I probably need to review the exact organization of the schema levels and make some adjustments here and there as I go. I&#8217;m not 100% sure of the best way to nest elements for the absolute best indexing, and I have some old HTML that was in pages that I still need to update. I found the schema system in Genesis 2.0 to be very powerful and easy to adapt to specific needs. For example, to change my sermons over to an audio schema I just added this code to the sermons plugin I built </p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'genesis_attr_entry', 'first_sermon_attributes_entry', 20 );
/**
 * Changes sermons to the AudioObject Schema
 */
function first_sermon_attributes_entry( $attributes ) {

	if( 'sermons' != get_post_type() )
		return $attributes;

	$attributes&#x5B;'itemtype']  = 'http://schema.org/AudioObject';

	return $attributes;

}
</pre>
<p>It is possible to change pretty much any part of the schema markup when using the new filters. I was also adding additional details to the sermons for the date and such so I wrapped those details in spans with the appropriate schema markup for better indexing. Everything is testing well in the Rich Snippets tool. </p>
<p>As you can see, doing more than basic blog post markup will take a bit of work, but this is something that I or someone else may address with a plugin after Genesis 2.0 is released so any post, page, or post type can be converted to the correct schema. I can see how that could be very helpful for users wishing to take full advantage of the power that gives in hinting to the type of content on a page so Google can best handle your indexing.</p>
<p>I just made these changes and I&#8217;m trying hard to build authority for my church site, so I hope that this really gives it the nudge it needs to rise in the search results.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/genesis-2-0-html5-and-schema-oh-my/feed</wfw:commentRss>
			<slash:comments>17</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1162</post-id>	</item>
		<item>
		<title>StudioPress Forum Focus Group</title>
		<link>https://designsbynickthegeek.com/uncategorized/studiopress-forum-focus-group</link>
					<comments>https://designsbynickthegeek.com/uncategorized/studiopress-forum-focus-group#comments</comments>
		
		<dc:creator><![CDATA[nickthegeek]]></dc:creator>
		<pubDate>Thu, 27 Dec 2012 22:11:13 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://designsbynickthegeek.com/?p=1145</guid>

					<description><![CDATA[Hey folks, I need a limited number of people to sign up for a focus group on some stuff I&#8217;m working on in the StudioPress forums. I have a couple of moderators already but need some others involved. Right now I&#8217;m looking for 20 people. I need volunteers from every experience level so the big [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hey folks, I need a limited number of people to sign up for a focus group on some stuff I&#8217;m working on in the StudioPress forums. I have a couple of moderators already but need some others involved. Right now I&#8217;m looking for 20 people. I need volunteers from every experience level so the big question is time.</p>
<p>I&#8217;m not asking for a huge time commitment either. I have a series of changes being done and would like to ask for feedback on those changes during development.  This will involve a few surveys after reviewing the development stages of what I am working on. Most of the time reviewing and taking the survey will take just a few minutes.</p>
<p>This is time well spent because you get to help make sure the system works well for you, which means you should save time in the future. I call that a win.</p>
<p>So if you are interested, please sign up using this form. It will add you to a Mail Chimp list which I will only use for this focus group.</p>
<p><p>Thanks for your interest. At this time the focus group is full.</p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://designsbynickthegeek.com/uncategorized/studiopress-forum-focus-group/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1145</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced (Page is feed) 
Database Caching 31/110 queries in 0.094 seconds using Disk (Request-wide modification query)

Served from: designsbynickthegeek.com @ 2026-04-01 22:17:39 by W3 Total Cache
-->