advanced thesis techniques and tricks
DESCRIPTION
My presentation at WordCamp Mid-Atlantic on Advanced Thesis Techniques and TricksTRANSCRIPT
Advanced Thesis Advanced Thesis Techniques and TricksTechniques and Tricks
Brad WilliamsWebDevStudios.com
Brad WilliamsCEO & Co-Founder, WebDevStudios.com
Co-Host SitePoint Podcast
Organizer NJ WordPress Meetup
Who Am I?Who Am I?
Recent Thesis Sites:
AwayToGarden.com (WPMU)LoomisCreek.comTheSisterProject.com (WPMU)MattBites.comRetroRenovation.com
What is Thesis? What is a Hook Custom Page Templates Adding a Secondary Menu Widetize your Multimedia Box And more!
TopicsTopics
What is Thesis?
Search Engine Optimization (SEO) Accessibility Usability Flexibility
Thesis is a Premium Theme Thesis is a Premium Theme Framework with a focus on…Framework with a focus on…
Thesis was created by this guy: Chris Pearson
Matt Cutts - http://www.dullest.com/blog/ Chris Brogan - http://www.chrisbrogan.com/ Copy Blogger - http://www.copyblogger.com/ Danny Sullivan - http://daggle.com/ Laughing Squid - http://laughingsquid.com/ Cute Overload - http://cuteoverload.com/ Technosailor - http://technosailor.com/ Etc, etc, etc
Who uses Thesis?Who uses Thesis?
Custom_functions.php – location for all custom code, hooks, functions, etc
Custom.css – location for all custom style elements on your website
Thesis customization is Thesis customization is powered by two filespowered by two files
wp-content/themes/thesis/custom/ custom_functions.php custom.css
Location:
What is a Hook?
What is a Hook?
Thesis features a simple hook system that is essentially an API—a set of basic commands that you can use to add to, subtract from, and modify the functionality of your Thesis installation.
Two step process:
1. construct a simple function to house your custom code2. Tell Thesis where to place your custom code by specifying the appropriate hook
You can add and remove any functions using add_action() and remove_action()
Available Thesis Hooks
thesis_hook_before_htmlthesis_hook_after_htmlthesis_hook_before_headerthesis_hook_after_headerthesis_hook_headerthesis_hook_before_titlethesis_hook_after_titlethesis_hook_before_content_boxthesis_hook_after_content_boxthesis_hook_before_contentthesis_hook_after_contentthesis_hook_feature_boxthesis_hook_before_post_boxthesis_hook_after_post_boxthesis_hook_before_teasers_boxthesis_hook_after_teasers_boxthesis_hook_before_postthesis_hook_after_postthesis_hook_before_teaser_boxthesis_hook_after_teaser_boxthesis_hook_before_teaserthesis_hook_after_teaserthesis_hook_before_headlinethesis_hook_after_headline
thesis_hook_before_teaser_headlinethesis_hook_after_teaser_headlinethesis_hook_byline_itemthesis_hook_before_comment_metathesis_hook_after_comment_metathesis_hook_after_commentthesis_hook_comment_formthesis_hook_archives_templatethesis_hook_custom_templatethesis_hook_faux_adminthesis_hook_archive_infothesis_hook_404_titlethesis_hook_404_contentthesis_hook_before_sidebarsthesis_hook_after_sidebarsthesis_hook_multimedia_boxthesis_hook_after_multimedia_boxthesis_hook_before_sidebar_1thesis_hook_after_sidebar_1thesis_hook_before_sidebar_2thesis_hook_after_sidebar_2thesis_hook_before_footerthesis_hook_after_footerthesis_hook_footer
48 Hooks
(In case you were counting)
Example 1: Hello WordCamp
<?php
add_action('hook_name', ‘hello_wordcamp');
Function hello_wordcamp() { echo “Hello WordCamp!”;}
?>
Example 2: Custom Footer
<?php
remove_action('thesis_hook_footer', 'thesis_attribution');add_action('thesis_hook_footer', 'my_footer');
function my_footer() { echo “<p>Copyright © WebDevStudios.com</p>“;}?>
Now for the fun stuffNow for the fun stuff
Example 3: Custom Page Template
<?php
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');add_action('thesis_hook_custom_template', 'home_custom');
?>
Remember to set the page template to Custom Template
Example 4: Add A Secondary Menu
Thesis by default has a single menu
So lets create a secondary menu!
Example 4: Add A Secondary Menu
<?php
function topnav_menu() { ?> <ul id="topnav">
<li><a href=“/wordpress">WordPress</a></li> <li><a href=“/wpmu">WPMU</a></li> <li><a href=“/buddypress”>BuddyPress</a></li> <li><a href=“/bbpress">bbPress</a></li>
</ul> <?php }
add_action('thesis_hook_before_header', 'topnav_menu'); ?>
Example 4: Add A Secondary Menu
/* Top Nav bar */.custom ul#topnav {border-style: none;list-style-image: none;list-style-position: outside;list-style-type: none;background:#E4E4E4 none repeat scroll 0 0;width: 100%;float: left;}.custom ul#topnav li { float: left; padding: 3px 10px 3px 0px; }.custom ul#topnav li a { font-size: 1.1em; color: #000000; }.custom ul#topnav li a:hover { text-decoration: underline; }
Add a little styling in custom.css
Example 4: Add A Secondary Menu
BAM! Another menu!
Ref: http://www.emptycabinmedia.com/thesis-theme-add-another-menu/
Example 5: Widgetize your Multimedia Box
Example 5: Widgetize your Multimedia Box
<?php
register_sidebar(array('name' => 'Multimedia Box', 'before_widget' => '<li class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
function multimedia_box_widgets() { echo '<ul class="sidebar_list">'; dynamic_sidebar('Multimedia Box'); echo '</ul>';
}
add_action('thesis_hook_multimedia_box', 'multimedia_box_widgets');?>
Example 5: Widgetize your Multimedia Box
Change the Multimedia Box settingto Custom code
Add any widgets you want to the Multimedia Box sidebar
Example 5: Widgetize your Multimedia Box
Now we are widgetized!
Ref: http://rickbeckman.org/widgetizing-thesis-multimedia-box/
And there is no more, I lied
In Summary, Thesis is a great theme for beginner and advanced users alike.
Thesis Official Website – http://diythemes.com/thesis/ Thesis Theme User’s Guide
› http://diythemes.com/thesis/rtfm/
Thesis Hook References› http://diythemes.com/thesis/rtfm/hooks/› http://diythemes.com/thesis/rtfm/default-hook-usage/
Thesis Pro Users› Chris Pearson http://www.pearsonified.com/› Rick Beckman (KingdomGeek) http://rickbeckman.org/› Kristarella http://www.kristarella.com/
Thesis Resource Sites› http://thesisthemehq.com/› http://thesisgallery.com/
Thesis ResourcesThesis Resources
Brad [email protected]
Blog: strangework.comtwitter.com/williamsbaIRC: WDS-Brad
Everywhere else: williamsba
ContactContact