Custom 404 (Page Not Found) for Thesis

/* Custom 404 Hooks */
function custom_thesis_404_title() {
  ?>
  Oops, looks like you found one of our mistakes. We're sorry!

	<ol>
	 0) {
	?&gt;
	  <li>Were you looking for <strong>one of the following</strong> posts or pages?
		  <ul>

		    <li>&lt;a href=&quot;ID); ?&gt;"&gt;post_title; ?&gt;</a></li>

		</ul>

	  If not, don't worry, here are a few more options:</li>
	  <li><strong>If you typed in an address&hellip;</strong> make sure the spelling, case, and punctuation are correct. Then try reloading the page.</li>
	  <li><strong>Look</strong> for it in the <a href="http://code.garyjones.co.uk/sitemap/">sitemap.</a></li>
	  <li><strong>Start over again</strong> at the <a href="/">homepage</a> (and please contact me to say what went wrong, so I can fix it).</li>
	</ol>
	&lt;?php
	remove_action(&#039;thesis_hook_after_content&#039;, &#039;thesis_post_navigation&#039;);
}
remove_action(&#039;thesis_hook_404_content&#039;, &#039;thesis_404_content&#039;);
add_action(&#039;thesis_hook_404_content&#039;, &#039;custom_thesis_404_content&#039;);

Conditional Admin Menu for Thesis

/**
 * add_admin_menu - conditional Administration menu for logged in users
 *
 * @author Gary Jones
 * @version 2010-02-16
 * @since 2010-02-16
 **/
function add_admin_menu() {

    /* Grab some info about the visitor */
    get_currentuserinfo();

    /* Make sure we can access the role levels built in to WP */
    global $user_level;

    if ( $user_level &gt; 0 ) {
        /* user is logged in */
        ?&gt;
        <li class="tab tab-admin">
            &lt;a href=&quot;/wp-admin" title="Admin Dashboard"&gt;Admin</a>
            <ul class="submenu submenu-1">

                &lt;li class=&quot;item item-1"&gt;
                    &lt;a href=&quot;/wp-admin/post.php?action=edit&amp;post=ID;?&gt;" title="Edit Post"&gt;Edit Post</a>
                </li>

                &lt;li class=&quot;item item-2"&gt;
                    &lt;a href=&quot;/wp-admin/page.php?action=edit&amp;post=ID;?&gt;" title="Edit Page"&gt;Edit Page</a>
                </li>

                &lt;li class=&quot;item item-3"&gt;
                    &lt;a href="http://diythemes.com/forums/" title="Thesis Forum">Get Support</a>
                </li>

                &lt;li class=&quot;item item-4"&gt;
                    <a href="http://garyjones.co.uk/helped">Say Thanks!</a>
                </li>

            </ul>
        </li>
        &lt;?php
    } else {
        /* user is not logged in */
        /* in this case, show nothing */
    }
}
add_action(&#039;thesis_hook_last_nav_item&#039;, &#039;add_admin_menu&#039;);

Sidebars Class for Thesis

Adding new sidebars (widget areas) can sometimes be a bit of a pain with the Thesis theme, so this class not only adds the concept of sidebar sets, but also makes adding them require just two lines of code per set.

Set up

  1. Create a new folder inside the Thesis custom/ folder called classes
  2. Copy the following to a blank file and save it to custom/classes/GT_Sidebars.php:

View the code