[gnome-web-www: 34/68] Make the footer sticky



commit 1df43d63dc34cfa63dfc6f220f9089a6408854bb
Author: Tom Tryfonidis <tomtryf gnome org>
Date:   Mon Jan 9 17:44:11 2017 +0200

    Make the footer sticky

 theme/footer.php |   72 ++++++++++++++++++++++++++++-------------------------
 theme/header.php |    4 ++-
 theme/style.css  |   10 +++++++
 3 files changed, 51 insertions(+), 35 deletions(-)
---
diff --git a/theme/footer.php b/theme/footer.php
index 8c26d12..350752e 100644
--- a/theme/footer.php
+++ b/theme/footer.php
@@ -1,29 +1,28 @@
- <!-- footer -->
-    <div id="footer">   
-<!-- footer grass -->
-        <div id="footer_grass">
-            &nbsp;
-        </div>
+    </div> <!-- END gnome-content -->
 
+<!-- footer -->
+    <div id="footer">
         <div class="container">
-            <div class="links col-sm-9 col-md-9">
+            <div class="row">
+                    <div class="col-xs-12">
+            <div class="links col-xs-12 col-sm-9">
                 <?php
                 wp_nav_menu('menu=footer');
                 ?>
             </div>
-            
+
             <?php if (function_exists('wppo_get_all_available_langs') && function_exists('wppo_get_lang')) {
-                
+
                 $list_of_languages = wppo_get_all_available_langs();
                 if (count($list_of_languages) > 1) {
-                                
-                ?>
-                <div class="language col-md-3">
+
+            ?>
+                <div class="language col-xs-12 col-md-3">
                     <div>
-                        <strong><?php _e( 'This website is available in many languages', 'grass' ); 
?></strong>
+                        <strong><?php esc_html_e( 'This website is available in many languages', 'grass' ); 
?></strong>
                         <a href="<?php echo home_url('/languages/');?>" data-uri="<?php echo 
home_url('/');?>?select-language&amp;url=<?php echo $_SERVER['REQUEST_URI'];?>">
-                            <span class="switch"><?php _e( 'Switch Language', 'grass' ); ?></span>
-                            <span class="loading"><?php _e( 'Loading...', 'grass' ); ?></span>
+                            <span class="switch"><?php esc_html_e( 'Switch Language', 'grass' ); ?></span>
+                            <span class="loading"><?php esc_html_e( 'Loading...', 'grass' ); ?></span>
                         </a>
                     </div>
                 </div>
@@ -31,28 +30,33 @@
                 }
             }
             ?>
-            
-            <div class="icons col-sm-3">
-                 <?php require_once("social_icons.php"); ?>
+
+            <div class="icons col-xs-12 col-sm-3">
+                <?php require_once("social_icons.php"); ?>
             </div>
-           </div>
-           <!-- footnotes -->
-        <div class="container">
-            <div class="col-md-12">
-                <div id="footnotes" class="span9">
-                    <?php _e( 'Copyright', 'grass' ); ?> © 2005‒<?php echo date('Y');?> <strong 
class="gnome_logo"><?php _e( 'The GNOME Project', 'grass' ); ?></strong><br />
+        </div>
+    </div>
+    </div>
+    <div class="container">
+        <!-- footnotes -->
+        <div class="row">
+            <div class="col-sm-12">
+                <div id="footnotes" class="col-sm-9">
+                    <?php esc_html_e( 'Copyright', 'grass' ); ?> © 2005‒<?php echo date('Y');?> <strong 
class="gnome_logo"><?php esc_html_e( 'The GNOME Project', 'grass' ); ?></strong><br />
                     <small>
-                        <?php _e( 'Free to share and remix', 'grass' ); ?>: <a 
href="http://creativecommons.org/licenses/by/3.0/";>Creative Commons CC-BY</a>.
-                        <?php _e( 'Optimized for standards', 'grass' ); ?>.
-                        <?php _e( 'Hosted by', 'grass' ); ?> <a 
href="http://www.canonical.com/";>Canonical</a>.
-                        <?php _e( 'Powered by', 'grass' ); ?> <a 
href="http://www.wordpress.org";>WordPress</a>.
+                        <?php esc_html_e( 'Free to share and remix', 'grass' ); ?>: <a 
href="http://creativecommons.org/licenses/by/3.0/";>Creative Commons CC-BY</a>.
+                        <?php esc_html_e( 'Optimized for standards', 'grass' ); ?>.
+                        <?php esc_html_e( 'Hosted by', 'grass' ); ?> <a 
href="http://www.canonical.com/";>Canonical</a>.
+                        <?php esc_html_e( 'Powered by', 'grass' ); ?> <a 
href="http://www.wordpress.org";>WordPress</a>.
                     </small>
                 </div>
             </div>
-        </div>   
-            <div class="clear"></div>
+        </div>
+        </div>
     </div>
-    
+            <div class="clearfix"></div>
+
+
     <?php if ($_SERVER['HTTP_HOST'] != 'localhost') { ?>
 
     <!-- Piwik -->
@@ -74,6 +78,6 @@
     
     <?php } ?>
     
-    <?php
-    wp_footer();
-    ?>
+    <?php wp_footer(); ?>
+    </body>
+</html>
diff --git a/theme/header.php b/theme/header.php
index d7333f4..9c3a818 100644
--- a/theme/header.php
+++ b/theme/header.php
@@ -39,7 +39,7 @@ if (function_exists('wppo_get_lang')) {
     }
     ?>
 </head>
-<body>
+<body <?php body_class('gnome-body'); ?>>
     <!-- accessibility access -->
     <div id="accessibility_access">
         <ul>
@@ -92,3 +92,5 @@ if (function_exists('wppo_get_lang')) {
             </div>
         </nav>
     </header>
+
+    <div class="gnome-content">
diff --git a/theme/style.css b/theme/style.css
index e25ed93..9556bbc 100644
--- a/theme/style.css
+++ b/theme/style.css
@@ -44,6 +44,16 @@ a:visited {
     padding: 0 !important;
 }
 
+/* Sticky Footer */
+.gnome-body {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+}
+.gnome-content{
+  flex: 1;
+}
+
 /*
  * Bootstrap extension
  * Extend and overwrite Bootstrap Framework


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]