Skip to content

Commit

Permalink
Add option to foot layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanhuazong committed Oct 6, 2022
1 parent 89ebb65 commit 0a5f9cf
Show file tree
Hide file tree
Showing 12 changed files with 31,472 additions and 12 deletions.
10,787 changes: 10,787 additions & 0 deletions build/css/admin.33166dcbbc76ec6c00c1.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/css/admin.be8262cd9e374f4f9ee0.css

This file was deleted.

15,377 changes: 15,377 additions & 0 deletions build/css/app.33166dcbbc76ec6c00c1.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/css/app.be8262cd9e374f4f9ee0.css

This file was deleted.

60 changes: 60 additions & 0 deletions build/js/admin.33166dcbbc76ec6c00c1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ "./src/js/back-end/admin.js":
/*!**********************************!*\
!*** ./src/js/back-end/admin.js ***!
\**********************************/
/***/ (() => {

eval("//Hide/show footer layout options\n\n//# sourceURL=webpack://purdue-wp-theme/./src/js/back-end/admin.js?");

/***/ }),

/***/ "./src/style/back-end/admin.scss":
/*!***************************************!*\
!*** ./src/style/back-end/admin.scss ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://purdue-wp-theme/./src/style/back-end/admin.scss?");

/***/ })

/******/ });
/************************************************************************/
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ __webpack_modules__["./src/js/back-end/admin.js"](0, {}, __webpack_require__);
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./src/style/back-end/admin.scss"](0, __webpack_exports__, __webpack_require__);
/******/
/******/ })()
;
Empty file.
5,205 changes: 5,205 additions & 0 deletions build/js/app.33166dcbbc76ec6c00c1.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/js/app.be8262cd9e374f4f9ee0.js

This file was deleted.

32 changes: 32 additions & 0 deletions build/js/customizer.33166dcbbc76ec6c00c1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ "./src/js/back-end/customizer.js":
/*!***************************************!*\
!*** ./src/js/back-end/customizer.js ***!
\***************************************/
/***/ (() => {

eval("//Hide/show footer layout options\n(function ($) {\n wp.customize.bind('ready', function () {\n // hide control at first load\n if ($('input[name=\"_customize-radio-header_layout_radio\"]:checked').val() === \"global\") {\n $('#customize-control-footer_layout_radio').hide();\n } else {\n $('#customize-control-footer_layout_radio').show();\n }\n\n $(document).on('click', 'input[name=\"_customize-radio-header_layout_radio\"]', function () {\n if ($(this).val() === \"global\") {\n $('#customize-control-footer_layout_radio').hide();\n } else {\n $('#customize-control-footer_layout_radio').show();\n }\n });\n });\n})(jQuery);\n\n//# sourceURL=webpack://purdue-wp-theme/./src/js/back-end/customizer.js?");

/***/ })

/******/ });
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./src/js/back-end/customizer.js"]();
/******/
/******/ })()
;
1 change: 0 additions & 1 deletion build/js/customizer.be8262cd9e374f4f9ee0.js

This file was deleted.

9 changes: 5 additions & 4 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<?php
$header_option = get_theme_mod('header_layout_settings', 'global');
$footer_option = get_theme_mod('footer_layout_settings', 'four');
var_dump($header_option);
?>
<footer id="colophon" role="contentinfo" class="footer">
<div class="footer footer__global__logo">
Expand All @@ -29,7 +30,7 @@
<div class="container is-fullhd">
<div class="columns is-desktop">
<div class="column is-four-fifths-desktop columns is-desktop">
<div class="column<?php echo($header_option == "simple"&&$footer_option == "three" ? ' is-half-desktop' :'') ?>">
<div class="column<?php echo(($header_option == "simple"||$header_option == "global2")&&$footer_option == "three" ? ' is-half-desktop' :'') ?>">
<?php
if($header_option == "global"){
purdueBrand_footer_links("global-footer-1.json");
Expand All @@ -38,7 +39,7 @@
}
?>
</div>
<div class="column<?php echo($header_option == "simple"&&$footer_option == "three" ? ' is-one-quarter-desktop' :'') ?>">
<div class="column<?php echo(($header_option == "simple"||$header_option == "global2")&&$footer_option == "three" ? ' is-one-quarter-desktop' :'') ?>">
<?php
if($header_option == "global"){
purdueBrand_footer_links("global-footer-2.json");
Expand All @@ -47,12 +48,12 @@
}
?>
</div>
<div class="column<?php echo($header_option == "simple"&&$footer_option == "three" ? ' is-one-quarter-desktop' :'') ?>">
<div class="column<?php echo(($header_option == "simple"||$header_option == "global2")&&$footer_option == "three" ? ' is-one-quarter-desktop' :'') ?>">
<?php if (is_active_sidebar('footer-column-3')) {dynamic_sidebar('footer-column-3');} ?>
</div>

<?php
if (($footer_option !== "three" && $header_option == "simple") || $header_option == "global") {
if (($footer_option !== "three" && ($header_option == "simple"||$header_option == "global2")) || $header_option == "global") {
echo('<div class="column">');
if (is_active_sidebar('footer-column-4')) {dynamic_sidebar('footer-column-4');}
echo('</div>');
Expand Down
10 changes: 6 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function purdue_layout_options($wp_customize){
'settings'=>'header_layout_settings',
'label'=>'Header Layout',
'choices'=>array(
'simple'=>_('Simple'),
'global'=>_('Global')
'simple'=>_('Simple with fully customizable footer'),
'global'=>_('Global with fixed first two columns of links on footer'),
'global2'=>_('Global with fully customizable footer')
)
));

Expand Down Expand Up @@ -407,8 +408,9 @@ function purdue_header_radio_select($input, $setting)
{
// list of valid choices
$valid = array(
'simple'=>_('Simple'),
'global'=>_('Global')
'simple'=>_('Simple with fully customizable footer'),
'global'=>_('Global with fixed first two columns of links on footer'),
'global2'=>_('Global with fully customizable footer')
);
// Ensure input is a slug.
$input = sanitize_key($input);
Expand Down

0 comments on commit 0a5f9cf

Please sign in to comment.