Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Footer Styles
  • Loading branch information
andrewmbacon committed Jun 27, 2014
1 parent 8f33b73 commit 44a5726
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 174 deletions.
120 changes: 61 additions & 59 deletions footer.php
Expand Up @@ -9,66 +9,68 @@
?>
</div><!-- .container-->
</div><!-- #content -->
<?php get_template_part('mega-footer'); ?>
<footer id="footer" class="site-footer" role="contentinfo">
<div class="container">
<ul id="uc-footer-links" class="clearfix">
<?php
$options = get_option('uconn_banner_options');
$text_string = $options['text_string'];
$location = $text_string;
if($location == 'uchc'){
?>
<li>
<a href="http://www.uchc.edu/siteindex/index.html">A-Z Index</a>
</li>
<li>
<a href="http://www.uchc.edu/" >UConn Health</a>
</li>
<li>
<a href="http://www.uchc.edu/disclaimer/index.html">Disclaimer, Privacy Notice &amp; Copyright</a>
</li>
<li>
<a href="http://www.uchc.edu/directions/index.html" >Maps &amp; Directions</a>
</li>
<li>
<a href="http://www.uchc.edu/contact/index.html">Contact Us</a>
</li>
<li>
&copy; University of Connecticut Health Center
</li>
<?php
} else {
?>
<li>
&copy; <a href="http://uconn.edu">University of Connecticut</a>
</li>
<li>
<a href="http://uconn.edu/disclaimers-and-copyrights.php">Disclaimers, Privacy &amp; Copyright</a>
</li>
<?php
}
?>
<li>
<a href="<?php echo site_url(); ?>/wp-admin/">Webmaster Login</a>
</li>
<?php
<div id="footers">
<?php get_template_part('mega-footer'); ?>
<footer id="footer" class="site-footer" role="contentinfo">
<div class="container">
<ul id="uc-footer-links" class="clearfix">
<?php
$options = get_option('uconn_banner_options');
$text_string = $options['text_string'];
$location = $text_string;
if($location == 'uchc'){
?>
<li>
<a href="http://www.uchc.edu/siteindex/index.html">A-Z Index</a>
</li>
<li>
<a href="http://www.uchc.edu/" >UConn Health</a>
</li>
<li>
<a href="http://www.uchc.edu/disclaimer/index.html">Disclaimer, Privacy Notice &amp; Copyright</a>
</li>
<li>
<a href="http://www.uchc.edu/directions/index.html" >Maps &amp; Directions</a>
</li>
<li>
<a href="http://www.uchc.edu/contact/index.html">Contact Us</a>
</li>
<li>
&copy; University of Connecticut Health Center
</li>
<?php
} else {
?>
<li>
&copy; <a href="http://uconn.edu">University of Connecticut</a>
</li>
<li>
<a href="http://uconn.edu/disclaimers-and-copyrights.php">Disclaimers, Privacy &amp; Copyright</a>
</li>
<?php
}
?>
<li>
<a href="<?php echo site_url(); ?>/wp-admin/">Webmaster Login</a>
</li>
<?php

// Only display the footer if a menu of "Footer" exists in the site.
if (wp_get_nav_menu_object('Footer')){
$defaults = array(
'menu' => 'Footer',
'container' => false,
'items_wrap' => '%3$s',
'depth' => 1
);
wp_nav_menu( $defaults );
}

// Only display the footer if a menu of "Footer" exists in the site.
if (wp_get_nav_menu_object('Footer')){
$defaults = array(
'menu' => 'Footer',
'container' => false,
'items_wrap' => '%3$s',
'depth' => 1
);
wp_nav_menu( $defaults );
}

?>
</ul>
</div>
</footer>
?>
</ul>
</div>
</footer>
</div>
</div><!-- #page -->

<?php wp_footer(); ?>
Expand Down
65 changes: 4 additions & 61 deletions inc/reg-sidebars.php
Expand Up @@ -17,63 +17,11 @@ if ( function_exists('register_sidebar') ) {
'before_title' => '<div class="widget-head"><h2 class="widget-title">',
'after_title' => '</h2></div><div class="widget-content">'
));
register_sidebar(array(
'name' => 'Home1',
'id' => 'home1',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home2',
'id' => 'home2',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home3',
'id' => 'home3',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home4',
'id' => 'home4',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home5',
'id' => 'home5',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home6',
'id' => 'home6',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));
register_sidebar(array(
'name' => 'Home7',
'id' => 'home7',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
));

register_sidebar( array(
'name' => __( 'Mega Footer' ),
'id' => 'mega-footer',
'name' => __( 'Mega Footer' ),
'id' => 'mega-footer',
'description' => 'Limited to 6 widgets. Will appear at the bottom of every page in the site.',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</div></aside>',
'before_title' => '<div class="widget-head"><h2 class="widget-title">',
Expand All @@ -86,15 +34,12 @@ if ( function_exists('register_sidebar') ) {
add_filter( 'dynamic_sidebar_params', 'check_sidebar_params' );
function check_sidebar_params( $params ) {
global $wp_registered_widgets;

$settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ]['callback'][0];
$settings = $settings_getter->get_settings();
$settings = $settings[ $params[1]['number'] ];

if ( $params[0][ 'after_widget' ] == '</div></aside>' && isset( $settings[ 'title' ] ) && empty( $settings[ 'title' ] ) ){
$params[0][ 'before_widget' ] .= '<div class="widget-content">';
}

#Counts widgets in mega footer and adds column class accordingly
if( $params[0]['id'] == 'mega-footer' ){
if( is_multisite() ){
Expand All @@ -112,7 +57,6 @@ function check_sidebar_params( $params ) {
}
return $params;
}

function mf_remove_extra( $sidebars_widgets ){
$widgets = $sidebars_widgets['mega-footer'];
if( is_array($sidebars_widgets['mega-footer']) ){
Expand All @@ -125,5 +69,4 @@ function mf_remove_extra( $sidebars_widgets ){
return $sidebars_widgets;
}
add_filter( 'sidebars_widgets', 'mf_remove_extra' );

?>
93 changes: 61 additions & 32 deletions js/cs.js
Expand Up @@ -23,41 +23,45 @@ jQuery(document).ready(function($) {
var ext = null
var flag = null

if ((href.charAt(0) != '#' || href.charAt(0) != '?') && img == 0 ){

var hrefExploded = href.split('/')
base = hrefExploded[2]

if (base != site) {
//console.log('external link detected, adding icon...')
// is external, and is not a named anchor tag
var icon = '<span class="glyphicon glyphicon-new-window"></span>'
$(this).addClass('external').prepend(icon)
}

//console.log('checking to see if it might be a file...')
last = hrefExploded[hrefExploded.length-1] || ''
var lastExploded = last.split('.')

if (lastExploded[1]){
//console.log('ok, so there was a dot in the last value of the url.')
$.each(extensions, function(index, value){

if (value == lastExploded[1]){
flag = $('<span class="flag">')
//console.log('match!')
ext = lastExploded[1]
//console.log('ext:'+ext)
flag.append('.'+ext)
}
// if (((href.charAt(0) != '?') || (href.charAt(0) != '#')) && img == 0 ){
if (href.charAt(0) != '#' && img == 0){
if (href.charAt(0) != '/'){
var hrefExploded = href.split('/')
base = hrefExploded[2]

if (base != site) {
//console.log('external link detected, adding icon...')
// is external, and is not a named anchor tag
var icon = '<span class="glyphicon glyphicon-new-window"></span>'
$(this).addClass('external').prepend(icon)
}

//console.log('checking to see if it might be a file...')
last = hrefExploded[hrefExploded.length-1] || ''
var lastExploded = last.split('.')

if (lastExploded[1]){
//console.log('ok, so there was a dot in the last value of the url.')
$.each(extensions, function(index, value){

if (value == lastExploded[1]){
flag = $('<span class="flag">')
//console.log('match!')
ext = lastExploded[1]
//console.log('ext:'+ext)
flag.append('.'+ext)
}

})

})
//console.log('ext:'+ext)
}
if (flag != null){
$(this).append(flag)
}

//console.log('ext:'+ext)
}
if (flag != null){
$(this).append(flag)
}


}
})
Expand Down Expand Up @@ -162,7 +166,32 @@ jQuery(document).ready(function($) {
/**/


function stickyFoot(){
/* Andrew's Sticky Footer JS. */
var wrapperH = document.getElementById('page').clientHeight;
var footerH = document.getElementById('footers').clientHeight;
var comboH = wrapperH + footerH;
var windowH = window.innerHeight;
if(windowH>=comboH){
$('body').addClass('sticky')
} else {
$('body').removeClass('sticky')
}
}
window.onload = function (){
placeholderSupport = ("placeholder" in document.createElement("input"));
if(placeholderSupport!=false){
var d = document.getElementById("main");
d.classList.add("supports-placeholder");
}
stickyFoot();
}

window.onresize = function() {

stickyFoot();

}


})
2 changes: 1 addition & 1 deletion js/min/cs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions mega-footer.php
@@ -1,3 +1,7 @@
<div id="mega-footer" class="widget-area">
<?php ( is_active_sidebar('mega-footer') ? dynamic_sidebar('mega-footer'): '' ); ?>
</div>
<footer id="mega-footer" class="widget-area">
<div class="container">
<div class="row">
<?php ( is_active_sidebar('mega-footer') ? dynamic_sidebar('mega-footer'): '' ); ?>
</div>
</div>
</footer>

0 comments on commit 44a5726

Please sign in to comment.