Skip to content

Instantly share code, notes, and snippets.

@nelsonJM
Created October 24, 2012 22:12
Show Gist options
  • Save nelsonJM/3949267 to your computer and use it in GitHub Desktop.
Save nelsonJM/3949267 to your computer and use it in GitHub Desktop.
Thesis-185: custom_functions stuff
function html5_doctype($content) {
return '<!DOCTYPE html>';
}
add_filter('thesis_doctype', 'html5_doctype');
/* Remove PROFILE attribute from HEAD tag */
function html5_profile_removal($content) {
return '';
}
add_filter('thesis_head_profile', 'html5_profile_removal');
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_after_title', 'thesis_nav_menu');
function suppress_title() {
return (is_page()) ? false : true;
}
add_filter('thesis_show_headline_area', 'suppress_title');
function remove_comment_text() {
return ;
}
add_filter('thesis_comments_closed', 'remove_comment_text');
// Remove original sidebars
function no_sidebars() {
if (is_page(11))
return false;
else
return true;
}
add_filter('thesis_show_sidebars', 'no_sidebars');
// Restore sidebar 1 to layout
function restore_sidebar(){
if (is_page(11)) { ?>
<div id="sidebars">
<div id="sidebar_1" class="sidebar">
<ul class="sidebar_list">
<?php wp_nav_menu(array(
'container' => '',
'menu_id' => 'side-menu',
'menu_class' => 'menu showsubs',
'fallback_cb' => 'thesis_nav_menu',
'theme_location' => 'side',
)); ?>
</ul>
<p align="left"><img src="<?php echo get_template_directory_uri() ?>/custom/images/clear.gif" alt="Swapper" name="swapper" width="175" height="50" id="swapper" /><br />
<onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Live Chat','',<?php echo get_template_directory_uri() ?>/custom/'images/livechat2.jpg',1)"><img src="<?php echo get_template_directory_uri() ?>/custom/images/livechat.jpg" alt="Click an Option Below" name="Live Chat" width="180" height="78" hspace="1" border="0" id="Live Chat" /></a><p align="center"><SCRIPT language="Javascript" type="text/javascript" src="<?php echo get_template_directory_uri() ?>/custom/Scripts/whoson_steelsentry.js"></SCRIPT><br> &nbsp;&nbsp;<a href="#" onclick="javascript:window.open('https://hosted7.whoson.com/chat/callback.htm?domain=www.steelsentry.com','wocallback','width=484,height=361');return false;">Request A Call Back</a><br />
<p><a href="/steelsentry/10-reasons" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('10 Reasons','','<?php echo get_template_directory_uri() ?>/custom/images/10reasons2.jpg',1)"><img src="<?php echo get_template_directory_uri() ?>/custom/images/10reasons.jpg" alt="10 Reasons to Buy from Us" name="10 Reasons" width="180" height="58" hspace="1" border="0" id="10 Reasons" /></a>
<br>
<br />
<a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Contest','','<?php echo get_template_directory_uri() ?>/custom/images/contest2.jpg',1)"></a><br />
</p>
</div>
</div>
<?php }
}
add_action('thesis_hook_content_box_bottom','restore_sidebar',1);
// Add a class for styling
function one_sidebar($classes) {
if (is_page(11)) {
$classes[] = 'one_sidebar';
}
return $classes;
}
add_filter('thesis_body_classes', 'one_sidebar');
// Side Menu
register_nav_menu('side','Side Menu');
function custom_side_menu() {
wp_nav_menu(array(
'container' => '',
'menu_id' => 'side-menu',
'menu_class' => 'menu showsubs',
'fallback_cb' => 'thesis_nav_menu',
'theme_location' => 'side',
));
}
add_action('thesis_hook_after_sidebar_1','custom_side_menu');
// Footer Menus
register_nav_menu('footer','Footer Products');
function custom_footer_menu_one() {
wp_nav_menu(array(
'container' => 'div',
'menu_id' => 'footer-products',
'menu_class' => 'footer-inline aligncenter',
'fallback_cb' => 'thesis_nav_menu',
'theme_location' => 'footer',
));
}
add_action('thesis_hook_footer','custom_footer_menu_one');
register_nav_menu('footer2','Footer Menu');
function custom_footer_menu_two() {
wp_nav_menu(array(
'container' => 'div',
'menu_id' => 'footer-menu',
'menu_class' => 'footer-inline aligncenter',
'fallback_cb' => 'thesis_nav_menu',
'theme_location' => 'footer2',
));
}
add_action('thesis_hook_footer','custom_footer_menu_two');
// 404 page title
function custom_404_title() {
?>
<h1>Sorry, that page does not exist.</h1>
<?php
}
add_action('thesis_hook_404_title', 'custom_404_title');
remove_action('thesis_hook_404_title', 'thesis_404_title');
// 404 page content
function custom_404_content() {
?>
<p>Return <a href="/">home</a>.</p>
<?php
}
add_action('thesis_hook_404_content', 'custom_404_content');
remove_action('thesis_hook_404_content', 'thesis_404_content');
remove_action('thesis_hook_footer', 'thesis_attribution');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment